Compare commits

..

9 Commits
6.1.0 ... 6.1.1

Author SHA1 Message Date
Stefan Prodan
b891025365 Fix Helm OCI packaging job
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-03-30 11:38:41 +03:00
Stefan Prodan
3c3f2a2e60 Merge pull request #183 from stefanprodan/release-6.1.1
Release v6.1.1
2022-03-30 11:24:21 +03:00
Stefan Prodan
06b5e969db Publish v6.1.1
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-03-30 11:17:38 +03:00
Stefan Prodan
8508550ee6 Merge pull request #182 from stefanprodan/helm-oci
Published signed Helm charts to GHCR
2022-03-30 11:16:19 +03:00
Stefan Prodan
5c1032c578 Published signed Helm charts to GHCR
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2022-03-30 11:11:45 +03:00
Stefan Prodan
9febc66b98 Merge pull request #180 from mmontes11/redis-basic-auth
Adapted cache to support redis authentication
2022-03-29 10:26:13 +03:00
Stefan Prodan
59dc738b25 Merge pull request #181 from nozaq/fix-typo
Fix a typo
2022-03-29 10:25:56 +03:00
nozaq
8524be7240 Fix a typo 2022-03-27 21:44:09 +09:00
Martín Montes
065a18c258 Adapted cache to support redis authentication 2022-03-23 22:13:14 +01:00
14 changed files with 55 additions and 19 deletions

View File

@@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
helm-version:
- 3.6.0
- 3.8.1
runs-on: ubuntu-latest
steps:
- name: Checkout

View File

@@ -17,6 +17,10 @@ jobs:
- uses: actions/checkout@v2
- uses: imjasonh/setup-crane@v0.1
- uses: sigstore/cosign-installer@main
- name: Setup Helm
uses: ./.github/actions/helm
with:
version: 3.8.1
- name: Setup QEMU
uses: docker/setup-qemu-action@v1
with:
@@ -64,6 +68,11 @@ jobs:
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.version=${{ steps.prep.outputs.VERSION }}
org.opencontainers.image.created=${{ steps.prep.outputs.BUILD_DATE }}
- name: Publish Helm chart to GHCR
run: |
helm package charts/podinfo
helm push podinfo-${{ steps.prep.outputs.VERSION }}.tgz oci://ghcr.io/stefanprodan/charts
rm podinfo-${{ steps.prep.outputs.VERSION }}.tgz
- name: Sign images
env:
COSIGN_EXPERIMENTAL: 1
@@ -71,6 +80,7 @@ jobs:
cosign sign docker.io/stefanprodan/podinfo:${{ steps.prep.outputs.VERSION }}
cosign sign docker.io/stefanprodan/podinfo:latest
cosign sign ghcr.io/stefanprodan/podinfo:${{ steps.prep.outputs.VERSION }}
cosign sign ghcr.io/stefanprodan/charts/podinfo:${{ steps.prep.outputs.VERSION }}
- name: Publish base image
uses: docker/build-push-action@v2
with:
@@ -108,6 +118,6 @@ jobs:
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --release-notes=/tmp/release.txt
args: release --release-notes=/tmp/release.txt --skip-validate
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -76,7 +76,9 @@ To access the Swagger UI open `<podinfo-host>/swagger/index.html` in a browser.
### Install
Helm:
#### Helm
Install from github.io:
```bash
helm repo add podinfo https://stefanprodan.github.io/podinfo
@@ -95,13 +97,20 @@ helm upgrade --install --wait backend \
podinfo/podinfo
```
Kustomize:
Install from ghcr.io:
```bash
helm upgrade --install --wait podinfo --namespace default \
oci://ghcr.io/stefanprodan/charts/podinfo
```
#### Kustomize
```bash
kubectl apply -k github.com/stefanprodan/podinfo//kustomize
```
Docker:
#### Docker
```bash
docker run -dp 9898:9898 stefanprodan/podinfo

View File

@@ -1,6 +1,6 @@
apiVersion: v1
version: 6.1.0
appVersion: 6.1.0
version: 6.1.1
appVersion: 6.1.1
name: podinfo
engine: gotpl
description: Podinfo Helm chart for Kubernetes

View File

@@ -8,7 +8,7 @@ backends: []
image:
repository: ghcr.io/stefanprodan/podinfo
tag: 6.1.0
tag: 6.1.1
pullPolicy: IfNotPresent
ui:

View File

@@ -8,7 +8,7 @@ backends: []
image:
repository: ghcr.io/stefanprodan/podinfo
tag: 6.1.0
tag: 6.1.1
pullPolicy: IfNotPresent
ui:

View File

@@ -29,7 +29,7 @@ func main() {
fs.Int("port-metrics", 0, "metrics port")
fs.Int("grpc-port", 0, "gRPC port")
fs.String("grpc-service-name", "podinfo", "gPRC service name")
fs.String("level", "info", "log level debug, info, warn, error, flat or panic")
fs.String("level", "info", "log level debug, info, warn, error, fatal or panic")
fs.StringSlice("backend-url", []string{}, "backend service URL")
fs.Duration("http-client-timeout", 2*time.Minute, "client timeout duration")
fs.Duration("http-server-timeout", 30*time.Second, "server read and write timeout duration")

View File

@@ -23,7 +23,7 @@ spec:
spec:
containers:
- name: backend
image: ghcr.io/stefanprodan/podinfo:6.1.0
image: ghcr.io/stefanprodan/podinfo:6.1.1
imagePullPolicy: IfNotPresent
ports:
- name: http

View File

@@ -23,7 +23,7 @@ spec:
spec:
containers:
- name: frontend
image: ghcr.io/stefanprodan/podinfo:6.1.0
image: ghcr.io/stefanprodan/podinfo:6.1.1
imagePullPolicy: IfNotPresent
ports:
- name: http

View File

@@ -25,7 +25,7 @@ spec:
serviceAccountName: webapp
containers:
- name: backend
image: ghcr.io/stefanprodan/podinfo:6.1.0
image: ghcr.io/stefanprodan/podinfo:6.1.1
imagePullPolicy: IfNotPresent
ports:
- name: http

View File

@@ -25,7 +25,7 @@ spec:
serviceAccountName: webapp
containers:
- name: frontend
image: ghcr.io/stefanprodan/podinfo:6.1.0
image: ghcr.io/stefanprodan/podinfo:6.1.1
imagePullPolicy: IfNotPresent
ports:
- name: http

View File

@@ -23,7 +23,7 @@ spec:
spec:
containers:
- name: podinfod
image: ghcr.io/stefanprodan/podinfo:6.1.0
image: ghcr.io/stefanprodan/podinfo:6.1.1
imagePullPolicy: IfNotPresent
ports:
- name: http

View File

@@ -1,8 +1,10 @@
package api
import (
"fmt"
"io/ioutil"
"net/http"
"net/url"
"time"
"github.com/gomodule/redigo/redis"
@@ -119,6 +121,23 @@ func (s *Server) cacheReadHandler(w http.ResponseWriter, r *http.Request) {
w.Write([]byte(data))
}
func (s *Server) getCacheConn() (redis.Conn, error) {
redisUrl, err := url.Parse(s.config.CacheServer)
if err != nil {
return nil, fmt.Errorf("failed to parse redis url: %v", err)
}
var opts []redis.DialOption
if user := redisUrl.User; user != nil {
opts = append(opts, redis.DialUsername(user.Username()))
if password, ok := user.Password(); ok {
opts = append(opts, redis.DialPassword(password))
}
}
return redis.Dial("tcp", redisUrl.Host, opts...)
}
func (s *Server) startCachePool(ticker *time.Ticker, stopCh <-chan struct{}) {
if s.config.CacheServer == "" {
return
@@ -126,9 +145,7 @@ func (s *Server) startCachePool(ticker *time.Ticker, stopCh <-chan struct{}) {
s.pool = &redis.Pool{
MaxIdle: 3,
IdleTimeout: 240 * time.Second,
Dial: func() (redis.Conn, error) {
return redis.Dial("tcp", s.config.CacheServer)
},
Dial: s.getCacheConn,
TestOnBorrow: func(c redis.Conn, t time.Time) error {
_, err := c.Do("PING")
return err

View File

@@ -1,4 +1,4 @@
package version
var VERSION = "6.1.0"
var VERSION = "6.1.1"
var REVISION = "unknown"