Compare commits

..

8 Commits

Author SHA1 Message Date
stefanprodan
d10ba4ac43 Release 1.4.2 2018-12-20 09:57:19 +02:00
stefanprodan
7a2dca6798 Add TravisCI and Quay docs 2018-12-20 09:56:17 +02:00
stefanprodan
62ccb1b67e run go 1.11 fmt 2018-12-20 09:41:08 +02:00
stefanprodan
579284c775 Bootstrap travis in podcli code init 2018-12-20 09:33:55 +02:00
Stefan Prodan
a4948e16dd Remove labels and update deployment to API apps/v1 2018-12-04 16:26:44 +07:00
Stefan Prodan
995dcb5042 Publish chart v1.4.1
- set probes timeout to 5s (fix for GKE containerd)
2018-12-04 16:15:56 +07:00
stefanprodan
cbf1d671df Bump version to 1.4.1 2018-11-28 12:11:18 +02:00
stefanprodan
f6987a0a09 Publish v1.4 Helm chart 2018-11-28 12:01:05 +02:00
21 changed files with 198 additions and 55 deletions

View File

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

View File

@@ -1,4 +1,4 @@
apiVersion: apps/v1beta2
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "podinfo.fullname" . }}
@@ -7,8 +7,6 @@ metadata:
chart: {{ template "podinfo.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
color: {{ .Values.color }}
version: {{ .Values.image.tag }}
spec:
replicas: {{ .Values.replicaCount }}
strategy:
@@ -18,15 +16,11 @@ spec:
selector:
matchLabels:
app: {{ template "podinfo.name" . }}
color: {{ .Values.color }}
version: {{ .Values.image.tag }}
release: {{ .Release.Name }}
template:
metadata:
labels:
app: {{ template "podinfo.name" . }}
color: {{ .Values.color }}
version: {{ .Values.image.tag }}
release: {{ .Release.Name }}
annotations:
prometheus.io/scrape: 'true'
@@ -64,6 +58,8 @@ spec:
- check
- http
- localhost:{{ .Values.service.containerPort }}/healthz
initialDelaySeconds: 5
timeoutSeconds: 5
readinessProbe:
exec:
command:
@@ -71,7 +67,8 @@ spec:
- check
- http
- localhost:{{ .Values.service.containerPort }}/readyz
periodSeconds: 3
initialDelaySeconds: 5
timeoutSeconds: 5
volumeMounts:
- name: data
mountPath: /data

View File

@@ -12,7 +12,7 @@ faults:
image:
repository: quay.io/stefanprodan/podinfo
tag: 1.3.1
tag: 1.4.1
pullPolicy: IfNotPresent
service:

View File

@@ -159,6 +159,39 @@ func runCodeInit(cmd *cobra.Command, args []string) error {
}
}
dockerFiles := []string{"Dockerfile.ci"}
for _, file := range dockerFiles {
fileContent, err := ioutil.ReadFile(path.Join(tmpPath, versionName, file))
if err != nil {
log.Fatalf("Error: %s", err)
os.Exit(1)
}
newContent := strings.Replace(string(fileContent), projFrom, projTo, -1)
err = ioutil.WriteFile(path.Join(codeProjectPath, file), []byte(newContent), os.ModePerm)
if err != nil {
log.Fatalf("Error: %s", err)
os.Exit(1)
}
}
travisFiles := []string{"travis.lite.yml"}
for _, file := range travisFiles {
fileContent, err := ioutil.ReadFile(path.Join(tmpPath, versionName, file))
if err != nil {
log.Fatalf("Error: %s", err)
os.Exit(1)
}
destFile := strings.Replace(file, "travis.lite.yml", ".travis.yml", -1)
newContent := strings.Replace(string(fileContent), projFrom, projTo, -1)
err = ioutil.WriteFile(path.Join(codeProjectPath, destFile), []byte(newContent), os.ModePerm)
if err != nil {
log.Fatalf("Error: %s", err)
os.Exit(1)
}
}
err = gitPush()
if err != nil {
log.Fatalf("git push error: %s", err)

View File

@@ -2,12 +2,11 @@ package main
import (
"fmt"
"github.com/spf13/cobra"
"go.uber.org/zap"
"log"
"os"
"strings"
"github.com/spf13/cobra"
"go.uber.org/zap"
)
var rootCmd = &cobra.Command{

View File

@@ -2,7 +2,6 @@ package main
import (
"fmt"
"github.com/spf13/cobra"
"github.com/stefanprodan/k8s-podinfo/pkg/version"
)

View File

@@ -2,12 +2,6 @@ package main
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
"time"
"github.com/spf13/pflag"
"github.com/spf13/viper"
"github.com/stefanprodan/k8s-podinfo/pkg/api"
@@ -15,6 +9,11 @@ import (
"github.com/stefanprodan/k8s-podinfo/pkg/version"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"io/ioutil"
"os"
"path/filepath"
"strings"
"time"
)
func main() {

View File

@@ -38,3 +38,40 @@ If you create a GitHub release a Docker image with the format `${DOCKER_IMAGE}:$
![github-actions-ci](https://github.com/stefanprodan/k8s-podinfo/blob/master/docs/screens/github-actions-ci.png)
# TravisCI and Quay
Make a public repository named `podinfo` on Quay and add a robot user with write access to it.
Create a public repository named `podinfo` on GitHub.
In TravisCI create a job for your GitHub repository and in Settings/Environment Variables add the following keys:
* `QUAY_REPOSITORY` <YOUR-QUAY-USERNAME>/podinfo
* `QUAY_USER` <YOUR-QUAY-ROBOT-USERNAME>
* `QUAY_PASS` <YOUR-QUAY-ROBOT-PASSWORD>
Install podinfo CLI:
```bash
brew install weaveworks/tap/podcli
```
On your computer clone your git repository and initialize it with:
```bash
git clone https://github.com/<YOUR-GITHUB-USERNAME>/podinfo
cd podinfo
podcli code init podinfo --git-user=<YOUR-GITHUB-USERNAME> --version=master
```
The above command does the following:
* downloads podinfo source code from GitHub
* replaces golang imports with your git username and project name
* creates a `Dockerfile.ci` and `.travis.yml` customized for your Quay account
* commits and pushes the code to GitHub
When the code init command finishes, TravisCI will test, build and push a Docker image
`${DOCKER_IMAGE}:${GIT-BRANCH}-${GIT-SHORT-SHA}` to your Quay repository.
If you create a GitHub release a Docker image with the format `${DOCKER_IMAGE}:${GIT-TAG}` will be published to Quay.

Binary file not shown.

Binary file not shown.

View File

@@ -3,9 +3,9 @@ entries:
ambassador:
- apiVersion: v1
appVersion: 0.29.0
created: 2018-10-27T12:02:03.482966+03:00
created: 2018-12-04T16:25:13.052113+07:00
description: A Helm chart for Datawire Ambassador
digest: 6b637ed4b5d7190ea52b8ef6e4ac123001fd0e247be1cde5b90b6334c5d768d9
digest: 882effd24eee8cabd2fb08eafc6b367a4b49b893ae4998610be2d2a64cb6fdee
engine: gotpl
maintainers:
- email: stefanprodan@users.noreply.github.com
@@ -19,9 +19,9 @@ entries:
grafana:
- apiVersion: v1
appVersion: "1.0"
created: 2018-10-27T12:02:03.483771+03:00
created: 2018-12-04T16:25:13.052962+07:00
description: A Helm chart for Kubernetes
digest: 845d2b2e42b8dc0ae8848ec2ddb5de9a22554fbc1112a8417a8b6f4f818596eb
digest: 3587f10e8159ff2779cadaa0af21606892848fc4e13a037a42b9d131475570aa
name: grafana
urls:
- https://stefanprodan.github.io/k8s-podinfo/grafana-0.1.0.tgz
@@ -29,9 +29,9 @@ entries:
loadtest:
- apiVersion: v1
appVersion: "1.0"
created: 2018-10-27T12:02:03.484003+03:00
created: 2018-12-04T16:25:13.053182+07:00
description: Hey load test Helm chart for Kubernetes
digest: e36c02267ee82cc16e5c5783543f7e8147646e6637d8fd22265e447e9b043446
digest: ee2c363030494c42b5ff9b4b4baa43c121d357357627c2748aab810274d3bf0e
name: loadtest
urls:
- https://stefanprodan.github.io/k8s-podinfo/loadtest-0.1.0.tgz
@@ -39,16 +39,16 @@ entries:
ngrok:
- apiVersion: v1
appVersion: "1.0"
created: 2018-10-27T12:02:03.484773+03:00
created: 2018-12-04T16:25:13.053736+07:00
description: A Ngrok Helm chart for Kubernetes
digest: 3d8316b560c30631cdd1ba4a7ccadb611c119452f5cbbebe70ae356cec9e6b53
digest: 2f4779d8a659aebf8cc14116a4805d895aa3e15be7528b95e1a1c86cae565157
name: ngrok
urls:
- https://stefanprodan.github.io/k8s-podinfo/ngrok-0.2.0.tgz
version: 0.2.0
- apiVersion: v1
appVersion: "1.0"
created: 2018-10-27T12:02:03.484477+03:00
created: 2018-12-04T16:25:13.053451+07:00
description: A Ngrok Helm chart for Kubernetes
digest: 5678de7c8aac246df507f40b3f4f8fd6d06f4447e636398819a232dd26e1fc41
name: ngrok
@@ -56,9 +56,57 @@ entries:
- https://stefanprodan.github.io/k8s-podinfo/ngrok-0.1.0.tgz
version: 0.1.0
podinfo:
- apiVersion: v1
appVersion: 1.4.1
created: 2018-12-04T16:25:13.059775+07:00
description: Podinfo Helm chart for Kubernetes
digest: 0a1a25b12a2882e2641094b235f57dee6d95f9175823936be1dce73b75e808c3
engine: gotpl
home: https://github.com/stefanprodan/k8s-podinfo
maintainers:
- email: stefanprodan@users.noreply.github.com
name: stefanprodan
name: podinfo
sources:
- https://github.com/stefanprodan/k8s-podinfo
urls:
- https://stefanprodan.github.io/k8s-podinfo/podinfo-1.4.2.tgz
version: 1.4.2
- apiVersion: v1
appVersion: 1.4.1
created: 2018-12-04T16:25:13.059386+07:00
description: Podinfo Helm chart for Kubernetes
digest: 91ea71d56bf74135b3115a723f345a12022d5910abf21a8ee8d77d74385bc127
engine: gotpl
home: https://github.com/stefanprodan/k8s-podinfo
maintainers:
- email: stefanprodan@users.noreply.github.com
name: stefanprodan
name: podinfo
sources:
- https://github.com/stefanprodan/k8s-podinfo
urls:
- https://stefanprodan.github.io/k8s-podinfo/podinfo-1.4.1.tgz
version: 1.4.1
- apiVersion: v1
appVersion: 1.4.0
created: 2018-12-04T16:25:13.058992+07:00
description: Podinfo Helm chart for Kubernetes
digest: d30a844229125217f85d5c52ceb48c980f47027a5a1f9ee5c41bac44b9d18088
engine: gotpl
home: https://github.com/stefanprodan/k8s-podinfo
maintainers:
- email: stefanprodan@users.noreply.github.com
name: stefanprodan
name: podinfo
sources:
- https://github.com/stefanprodan/k8s-podinfo
urls:
- https://stefanprodan.github.io/k8s-podinfo/podinfo-1.4.0.tgz
version: 1.4.0
- apiVersion: v1
appVersion: 1.3.1
created: 2018-10-27T12:02:03.494429+03:00
created: 2018-12-04T16:25:13.058609+07:00
description: Podinfo Helm chart for Kubernetes
digest: 9116966f2b1300655be11669789842a3d01e326fe1feb205198df3ba22bac3a5
engine: gotpl
@@ -74,7 +122,7 @@ entries:
version: 1.3.1
- apiVersion: v1
appVersion: 1.3.0
created: 2018-10-27T12:02:03.493988+03:00
created: 2018-12-04T16:25:13.058177+07:00
description: Podinfo Helm chart for Kubernetes
digest: 7111b868a11014ab56da11b7edbea9ce0d1a483500969252f66c9ae1943bac67
engine: gotpl
@@ -90,7 +138,7 @@ entries:
version: 1.3.0
- apiVersion: v1
appVersion: 1.2.1
created: 2018-10-27T12:02:03.493261+03:00
created: 2018-12-04T16:25:13.057796+07:00
description: Podinfo Helm chart for Kubernetes
digest: c750c1d4a7606a06cd89ae4433431c7e3ecf2ccc9a0e5f6baa26095397bd72da
engine: gotpl
@@ -106,7 +154,7 @@ entries:
version: 1.2.1
- apiVersion: v1
appVersion: 1.2.0
created: 2018-10-27T12:02:03.491318+03:00
created: 2018-12-04T16:25:13.057382+07:00
description: Podinfo Helm chart for Kubernetes
digest: 24460e15e6da77106eb5212cd683dc2c1d4404b927be6b9f0c89433ba865722e
engine: gotpl
@@ -122,7 +170,7 @@ entries:
version: 1.2.0
- apiVersion: v1
appVersion: 1.1.0
created: 2018-10-27T12:02:03.489961+03:00
created: 2018-12-04T16:25:13.056624+07:00
description: Podinfo Helm chart for Kubernetes
digest: 973d60c629d7ae476776098ad6b654d78d91f91b3faa8bc016b94c73c42be094
engine: gotpl
@@ -138,7 +186,7 @@ entries:
version: 1.1.0
- apiVersion: v1
appVersion: 1.0.0
created: 2018-10-27T12:02:03.488849+03:00
created: 2018-12-04T16:25:13.055764+07:00
description: Podinfo Helm chart for Kubernetes
digest: 82068727ba5b552341b14a980e954e27a8517f0ef76aab314c160b0f075e6de4
engine: gotpl
@@ -154,7 +202,7 @@ entries:
version: 1.0.0
- apiVersion: v1
appVersion: 0.6.0
created: 2018-10-27T12:02:03.487979+03:00
created: 2018-12-04T16:25:13.055325+07:00
description: Podinfo Helm chart for Kubernetes
digest: bd25a710eddb3985d3bd921a11022b5c68a04d37cf93a1a4aab17eeda35aa2f8
engine: gotpl
@@ -170,7 +218,7 @@ entries:
version: 0.2.2
- apiVersion: v1
appVersion: 0.5.1
created: 2018-10-27T12:02:03.487248+03:00
created: 2018-12-04T16:25:13.054931+07:00
description: Podinfo Helm chart for Kubernetes
digest: 631ca3e2db5553541a50b625f538e6a1f2a103c13aa8148fdd38baf2519e5235
engine: gotpl
@@ -186,7 +234,7 @@ entries:
version: 0.2.1
- apiVersion: v1
appVersion: 0.5.0
created: 2018-10-27T12:02:03.48656+03:00
created: 2018-12-04T16:25:13.054523+07:00
description: Podinfo Helm chart for Kubernetes
digest: dfe7cf44aef0d170549918b00966422a07e7611f9d0081fb34f5b5beb0641c00
engine: gotpl
@@ -202,7 +250,7 @@ entries:
version: 0.2.0
- apiVersion: v1
appVersion: 0.3.0
created: 2018-10-27T12:02:03.48566+03:00
created: 2018-12-04T16:25:13.054109+07:00
description: Podinfo Helm chart for Kubernetes
digest: 4865a2d8b269cf453935cda9661c2efb82c16411471f8c11221a6d03d9bb58b1
engine: gotpl
@@ -219,9 +267,9 @@ entries:
podinfo-istio:
- apiVersion: v1
appVersion: 1.2.1
created: 2018-10-27T12:02:03.497708+03:00
created: 2018-12-04T16:25:13.062006+07:00
description: Podinfo Helm chart for Istio
digest: cb0cff1a5d77dadede477f5bf0e93d460de705c3642e93f9a6901f0bc2edec7f
digest: f7b489ac446be5ae6d01c1085ecb8bf272502f5b7db06e9c9c70d8bb5dedaab6
engine: gotpl
home: https://github.com/stefanprodan/k8s-podinfo
maintainers:
@@ -235,7 +283,7 @@ entries:
version: 1.2.1
- apiVersion: v1
appVersion: 1.2.0
created: 2018-10-27T12:02:03.497134+03:00
created: 2018-12-04T16:25:13.061474+07:00
description: Podinfo Helm chart for Istio
digest: 8115e72f232f82eb3e6da1965364cfede7c069f95a627dddac45cfbe6cb90dc4
engine: gotpl
@@ -251,7 +299,7 @@ entries:
version: 1.2.0
- apiVersion: v1
appVersion: 1.1.0
created: 2018-10-27T12:02:03.496261+03:00
created: 2018-12-04T16:25:13.060897+07:00
description: Podinfo Helm chart for Istio
digest: bcceb63ff780a8f0ba0b30997040e4e82170f9cce17c26ec817648ed024c83f5
engine: gotpl
@@ -267,7 +315,7 @@ entries:
version: 0.2.0
- apiVersion: v1
appVersion: 0.6.0
created: 2018-10-27T12:02:03.495373+03:00
created: 2018-12-04T16:25:13.060315+07:00
description: Podinfo Helm chart for Istio
digest: f12f8aa1eca1328e9eaa30bd757f6ed3ff97205e2bf016a47265bc2de6a63d8f
engine: gotpl
@@ -281,4 +329,4 @@ entries:
urls:
- https://stefanprodan.github.io/k8s-podinfo/podinfo-istio-0.1.0.tgz
version: 0.1.0
generated: 2018-10-27T12:02:03.482443+03:00
generated: 2018-12-04T16:25:13.051514+07:00

Binary file not shown.

Binary file not shown.

BIN
docs/podinfo-1.4.0.tgz Normal file

Binary file not shown.

BIN
docs/podinfo-1.4.1.tgz Normal file

Binary file not shown.

BIN
docs/podinfo-1.4.2.tgz Normal file

Binary file not shown.

Binary file not shown.

View File

@@ -9,7 +9,7 @@ import (
func NewMockServer() *Server {
config := &Config{
Port: "9898",
Port: "9898",
HttpServerShutdownTimeout: 5 * time.Second,
HttpServerTimeout: 30 * time.Second,
BackendURL: "",

View File

@@ -3,19 +3,17 @@ package api
import (
"context"
"fmt"
"github.com/gorilla/mux"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/spf13/viper"
"github.com/stefanprodan/k8s-podinfo/pkg/fscache"
"go.uber.org/zap"
"net/http"
_ "net/http/pprof"
"os"
"strings"
"sync/atomic"
"time"
"github.com/spf13/viper"
"github.com/gorilla/mux"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/stefanprodan/k8s-podinfo/pkg/fscache"
"go.uber.org/zap"
)
var (

View File

@@ -1,4 +1,4 @@
package version
var VERSION = "1.4.0"
var VERSION = "1.4.2"
var REVISION = "unknown"

33
travis.lite.yml Normal file
View File

@@ -0,0 +1,33 @@
sudo: required
language: go
go:
- 1.11.x
services:
- docker
addons:
apt:
packages:
- docker-ce
script:
- make test
after_success:
- if [ -z "$QUAY_USER" ]; then
echo "PR build, skipping Quay push";
else
echo $QUAY_PASS | docker login -u $QUAY_USER --password-stdin quay.io;
DOCKER_TAG=${TRAVIS_BRANCH}-$(echo ${TRAVIS_COMMIT} | head -c7);
docker build -t quay.io/${QUAY_REPOSITORY}:${DOCKER_TAG} -f Dockerfile.ci . ;
echo "Pushing to quay.io/${QUAY_REPOSITORY}:${DOCKER_TAG}";
docker push quay.io/${QUAY_REPOSITORY}:${DOCKER_TAG};
echo "Pushing to quay.io/${QUAY_REPOSITORY}:${TRAVIS_BRANCH}";
docker tag quay.io/${QUAY_REPOSITORY}:${DOCKER_TAG} quay.io/${QUAY_REPOSITORY}:${TRAVIS_BRANCH};
docker push quay.io/${QUAY_REPOSITORY}:${TRAVIS_BRANCH};
fi