Compare commits

...

33 Commits

Author SHA1 Message Date
stefanprodan
18af1ea3a6 Merge remote-tracking branch 'origin/master' 2019-07-26 00:53:35 +03:00
stefanprodan
2e9917a6b9 Bump version to 1.7.0 2019-07-26 00:53:22 +03:00
Stefan Prodan
bf00d07b17 Merge pull request #20 from grampelberg/master
Upgrade to vuetify 2.x
2019-07-26 00:45:06 +03:00
grampelberg
aab8e464e8 Upgrade to vuetify 2.x 2019-07-25 13:31:12 -07:00
stefanprodan
1475a2da00 Release charts 2019-06-15 18:33:10 +03:00
Stefan Prodan
44f588dd4c Merge pull request #19 from stefanprodan/metrics-port
Add option to run the metrics exporter on a different port
2019-06-15 17:14:01 +03:00
stefanprodan
951d82abb9 Add option to run the metrics exporter on a different port
Add port-metrics flag, when specified the Prometheus /metrics endpoint will be exposed on that port.
2019-06-15 17:07:34 +03:00
Stefan Prodan
3301f6f8d4 Merge pull request #18 from stefanprodan/fix-helm-test
Fix storage tests
2019-04-19 12:45:53 +03:00
stefanprodan
0339d3beb0 Fix storage tests 2019-04-19 12:44:58 +03:00
Stefan Prodan
d1b77c97b8 Merge pull request #17 from mumoshu/patch-1
fix(doc): Update README about read/write endpoints
2019-04-19 11:02:02 +03:00
KUOKA Yusuke
bfa3aaf9ac fix(doc): Update README about read/write endpoints
I was following https://github.com/stefanprodan/k8s-podinfo/blob/master/docs/1-deploy.md#using-the-helm-chart and `helm test` failed.

The cause seemed like changes in two endpoints. `POST /write` seems to have changed to `POST /store`, and `GET /read/{hash}` to `GET /store/{hash}`. Here's the fix according to my observation :)
2019-04-19 16:39:09 +09:00
stefanprodan
43df2d19c6 Bump version to 1.5.1 2019-03-25 12:16:20 +02:00
stefanprodan
7181351c89 Bump version to 1.5.0 2019-03-25 12:08:37 +02:00
Stefan Prodan
1c3bf10de2 Merge pull request #16 from luxas/ui-pathprefix
Fix the UI XHRs when the webserver is mounted at a non-root URL
2019-03-25 11:28:51 +02:00
Lucas Käldström
c28c11d4a5 Release v1.4.4 2019-03-25 11:22:38 +02:00
Lucas Käldström
5c2f9a19d6 Make the UI perform XHRs relative to its own path 2019-03-25 11:21:33 +02:00
Stefan Prodan
7d5200a78a Merge pull request #15 from stefanprodan/fix-port
Add port validation
2019-03-21 21:06:10 +02:00
stefanprodan
66b8948473 Bump version to 1.4.3 2019-03-21 20:57:07 +02:00
stefanprodan
db04ce117b Add port validation 2019-03-21 20:43:02 +02:00
stefanprodan
5142c39a8e Add arm64 and amd64 Drone pipelines 2019-02-08 01:07:15 +02:00
stefanprodan
001486ac0a Push ARMv7 image with Drone 2019-02-08 00:43:53 +02:00
stefanprodan
ed553135b2 Set Drone platform to arm 2019-02-08 00:32:15 +02:00
stefanprodan
c21c24b2fd Build master with Drone 2019-02-08 00:25:55 +02:00
stefanprodan
4dbbfa9239 Rename Drone pipeline 2019-02-08 00:12:04 +02:00
stefanprodan
bc8ff9b412 Build ARM image with Drone on Scaleway 2019-02-08 00:06:23 +02:00
stefanprodan
cdf9b06b86 Upgrade golang GitHub action to 1.11 2018-12-20 17:52:56 +02:00
stefanprodan
431ab9e19e Disable Travis Kubernetes in Docker (kind) 2018-12-20 15:57:09 +02:00
stefanprodan
1273d3745e Run podinfo local image on Travis Kubernetes in Docker 2018-12-20 15:36:58 +02:00
stefanprodan
caa49b96aa Run podinfo on Travis Kubernetes in Docker 2018-12-20 15:22:06 +02:00
stefanprodan
319e444ddf Fix kubectl perm for Travis Kubernetes in Docker 2018-12-20 15:12:39 +02:00
stefanprodan
0529fff9aa Test Travis Kubernetes in Docker 2018-12-20 15:07:58 +02:00
stefanprodan
0fc239aaca Test Kubernetes in Docker 2018-12-20 14:56:21 +02:00
stefanprodan
f0b19b63e9 Add sem ver release to TravisCI docs 2018-12-20 10:22:49 +02:00
23 changed files with 285 additions and 66 deletions

104
.drone.yml Normal file
View File

@@ -0,0 +1,104 @@
---
kind: pipeline
name: linux-amd64
platform:
os: linux
arch: amd64
steps:
- name: build
image: plugins/docker:linux-amd64
settings:
dry_run: true
dockerfile: Dockerfile.ci
repo: stefanprodan/podinfo
tag: linux-amd64
when:
event:
- push
- pull_request
- name: push-commit
image: plugins/docker:linux-amd64
settings:
dockerfile: Dockerfile.arm
repo: stefanprodan/podinfo
tag: "amd64-${DRONE_COMMIT_SHA:0:8}"
username:
from_secret: DOCKER_USERNAME
password:
from_secret: DOCKER_PASSWORD
when:
branch:
- master
---
kind: pipeline
name: linux-arm64
platform:
os: linux
arch: arm64
steps:
- name: build
image: plugins/docker:linux-arm64
settings:
dry_run: true
dockerfile: Dockerfile.arm
repo: stefanprodan/podinfo
tag: linux-arm64
when:
event:
- push
- pull_request
- name: push-commit
image: plugins/docker:linux-arm64
settings:
dockerfile: Dockerfile.arm
repo: stefanprodan/podinfo
tag: "arm64-${DRONE_COMMIT_SHA:0:8}"
username:
from_secret: DOCKER_USERNAME
password:
from_secret: DOCKER_PASSWORD
when:
branch:
- master
---
kind: pipeline
name: linux-arm
platform:
os: linux
arch: arm
steps:
- name: build
image: plugins/docker:linux-arm
settings:
dry_run: true
dockerfile: Dockerfile.arm
repo: stefanprodan/podinfo
tag: linux-arm
when:
event:
- push
- pull_request
- name: push-commit
image: plugins/docker:linux-arm
settings:
dockerfile: Dockerfile.arm
repo: stefanprodan/podinfo
tag: "arm-${DRONE_COMMIT_SHA:0:8}"
username:
from_secret: DOCKER_USERNAME
password:
from_secret: DOCKER_PASSWORD
when:
branch:
- master

View File

@@ -1,8 +1,8 @@
FROM golang:1.10
FROM golang:1.11
LABEL "name"="golang tools action"
LABEL "maintainer"="Stefan Prodan <support@weave.works>"
LABEL "version"="1.0.0"
LABEL "version"="1.11.0"
LABEL "com.github.actions.icon"="code"
LABEL "com.github.actions.color"="green-dark"

View File

@@ -14,6 +14,17 @@ addons:
before_install:
- make dep
# - go get sigs.k8s.io/kind
# - curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
# - chmod +x ./kubectl
# - kind create cluster
# - export KUBECONFIG="$(kind get kubeconfig-path --name="1")"
# - ./kubectl cluster-info
# - docker build -t podinfo:test -f Dockerfile.ci .
# - ./kubectl run podinfo --image=podinfo:test --port=9898 --image-pull-policy=Never -- ./podinfo --port=9898
# - sleep 5
# - ./kubectl describe deployment podinfo
# - ./kubectl describe po
script:
- make test

33
Dockerfile.arm Normal file
View File

@@ -0,0 +1,33 @@
FROM golang:1.11 as builder
RUN mkdir -p /go/src/github.com/stefanprodan/k8s-podinfo/
WORKDIR /go/src/github.com/stefanprodan/k8s-podinfo
COPY . .
RUN GIT_COMMIT=$(git rev-list -1 HEAD) && CGO_ENABLED=0 GOOS=linux \
go build -ldflags "-s -w -X github.com/stefanprodan/k8s-podinfo/pkg/version.REVISION=${GIT_COMMIT}" \
-a -installsuffix cgo -o podinfo ./cmd/podinfo
RUN GIT_COMMIT=$(git rev-list -1 HEAD) && CGO_ENABLED=0 GOOS=linux \
go build -ldflags "-s -w -X github.com/stefanprodan/k8s-podinfo/pkg/version.REVISION=${GIT_COMMIT}" \
-a -installsuffix cgo -o podcli ./cmd/podcli
FROM alpine:3.8
RUN addgroup -S app \
&& adduser -S -g app app \
&& apk --no-cache add \
curl openssl netcat-openbsd
WORKDIR /home/app
COPY --from=builder /go/src/github.com/stefanprodan/k8s-podinfo/podinfo .
COPY --from=builder /go/src/github.com/stefanprodan/k8s-podinfo/podcli /usr/local/bin/podcli
COPY ./ui ./ui
RUN chown -R app:app ./
USER app
CMD ["./podinfo"]

View File

@@ -8,15 +8,15 @@ COPY . .
RUN go test $(go list ./... | grep -v integration | grep -v /vendor/ | grep -v /template/) -cover
RUN gofmt -l -d $(find . -type f -name '*.go' -not -path "./vendor/*") && \
GIT_COMMIT=$(git rev-list -1 HEAD) && \
CGO_ENABLED=0 GOOS=linux go build -ldflags "-s -w \
-X github.com/stefanprodan/k8s-podinfo/pkg/version.REVISION=${GIT_COMMIT}" \
-a -installsuffix cgo -o podinfo ./cmd/podinfo
RUN GIT_COMMIT=$(git rev-list -1 HEAD) && \
CGO_ENABLED=0 GOOS=linux go build -ldflags "-s -w \
-X github.com/stefanprodan/k8s-podinfo/pkg/version.REVISION=${GIT_COMMIT}" \
-a -installsuffix cgo -o podinfo ./cmd/podinfo
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags "-s -w \
-X github.com/stefanprodan/k8s-podinfo/pkg/version.REVISION=${GIT_COMMIT}" \
-a -installsuffix cgo -o podcli ./cmd/podcli
RUN GIT_COMMIT=$(git rev-list -1 HEAD) && \
CGO_ENABLED=0 GOOS=linux go build -ldflags "-s -w \
-X github.com/stefanprodan/k8s-podinfo/pkg/version.REVISION=${GIT_COMMIT}" \
-a -installsuffix cgo -o podcli ./cmd/podcli
FROM alpine:3.8

View File

@@ -35,8 +35,8 @@ Web API:
* `POST /token` issues a JWT token valid for one minute `JWT=$(curl -sd 'anon' podinfo:9898/token | jq -r .token)`
* `GET /token/validate` validates the JWT token `curl -H "Authorization: Bearer $JWT" podinfo:9898/token/validate`
* `GET /configs` returns a JSON with configmaps and/or secrets mounted in the `config` volume
* `POST /write` writes the posted content to disk at /data/hash and returns the SHA1 hash of the content
* `GET /read/{hash}` returns the content of the file /data/hash if exists
* `POST /store` writes the posted content to disk at /data/hash and returns the SHA1 hash of the content
* `GET /store/{hash}` returns the content of the file /data/hash if exists
* `GET /ws/echo` echos content via websockets `podcli ws ws://localhost:9898/ws/echo`
### Guides

View File

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

View File

@@ -11,8 +11,8 @@ metadata:
"helm.sh/hook": test-success
spec:
containers:
- name: curl
image: radial/busyboxplus:curl
- name: tools
image: giantswarm/tiny-tools
command: ["/bin/sh", "/scripts/ping.sh"]
env:
- name: PODINFO_SVC
@@ -38,4 +38,4 @@ metadata:
data:
ping.sh: |
#!/bin/sh
curl -sSd "$(curl -sSd 'test' ${PODINFO_SVC}/write)" ${PODINFO_SVC}/read|grep test
curl -sS ${PODINFO_SVC}/store/$(curl -sSd 'test' ${PODINFO_SVC}/store | jq -r .hash) |grep test

View File

@@ -1,6 +1,6 @@
# Default values for podinfo.
replicaCount: 2
replicaCount: 1
logLevel: info
color: blue
backend: #http://backend-podinfo:9898/echo
@@ -12,7 +12,7 @@ faults:
image:
repository: quay.io/stefanprodan/podinfo
tag: 1.4.1
tag: 1.6.1
pullPolicy: IfNotPresent
service:

View File

@@ -12,6 +12,7 @@ import (
"io/ioutil"
"os"
"path/filepath"
"strconv"
"strings"
"time"
)
@@ -20,6 +21,7 @@ func main() {
// flags definition
fs := pflag.NewFlagSet("default", pflag.ContinueOnError)
fs.Int("port", 9898, "port")
fs.Int("port-metrics", 0, "metrics port")
fs.String("level", "info", "log level debug, info, warn, error, flat or panic")
fs.String("backend-url", "", "backend service URL")
fs.Duration("http-client-timeout", 2*time.Minute, "client timeout duration")
@@ -82,6 +84,12 @@ func main() {
// start stress tests if any
beginStressTest(viper.GetInt("stress-cpu"), viper.GetInt("stress-memory"), logger)
// validate port
if _, err := strconv.Atoi(viper.GetString("port")); err != nil {
port, _ := fs.GetInt("port")
viper.Set("port", strconv.Itoa(port))
}
// load HTTP server config
var srvCfg api.Config
if err := viper.Unmarshal(&srvCfg); err != nil {
@@ -92,7 +100,7 @@ func main() {
logger.Info("Starting podinfo",
zap.String("version", viper.GetString("version")),
zap.String("revision", viper.GetString("revision")),
zap.String("port", viper.GetString("port")),
zap.String("port", srvCfg.Port),
)
// start HTTP server

View File

@@ -1,21 +1,28 @@
---
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: Deployment
metadata:
name: podinfo
spec:
replicas: 1
minReadySeconds: 5
progressDeadlineSeconds: 60
strategy:
rollingUpdate:
maxUnavailable: 0
type: RollingUpdate
selector:
matchLabels:
app: podinfo
template:
metadata:
annotations:
prometheus.io/scrape: "true"
labels:
app: podinfo
#role: openfaas-system
annotations:
prometheus.io/scrape: 'true'
spec:
containers:
- name: podinfod
image: quay.io/stefanprodan/podinfo:1.0.1
image: quay.io/stefanprodan/podinfo:1.4.3
command:
- ./podinfo
- --port=9898

View File

@@ -1,4 +1,4 @@
# GitHub Actions
# GitHub Actions and Docker Hub
Create a private repository named `demo-app` on GitHub and navigate to Settings/Secrets and add the following secrets:
@@ -21,11 +21,11 @@ Clone your private repository (preferable in your `$GOPATH`) and initialize podi
git clone https://github.com/stefanprodan/demo-app
cd demo-app
podcli code init demo-app --git-user=stefanprodan --version=v1.3.1
podcli code init demo-app --git-user=stefanprodan --version=master
```
The above command does the following:
* downloads podinfo source code v1.3.1 from GitHub
* downloads podinfo source code from GitHub
* replaces golang imports with your git username and project name
* creates a Dockerfile and Makefile customized for GitHub actions
* creates the main workflow for GitHub actions
@@ -46,9 +46,9 @@ 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>
* `QUAY_REPOSITORY` = `<YOUR-QUAY-USERNAME>/podinfo`
* `QUAY_USER` = `<YOUR-QUAY-ROBOT-USERNAME>`
* `QUAY_PASS` = `<YOUR-QUAY-ROBOT-PASSWORD>`
Install podinfo CLI:
@@ -74,4 +74,6 @@ The above command does the following:
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.
In order to make a semantic version release, edit `./pgk/version/version/go` and set the version to `1.5.0`.
Push your changes to git and create a GitHub release.
TravisCI will build a Docker image with the format `${DOCKER_IMAGE}:${GIT-TAG}` and will push it 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-12-04T16:25:13.052113+07:00
created: 2019-06-15T18:31:59.598479+03:00
description: A Helm chart for Datawire Ambassador
digest: 882effd24eee8cabd2fb08eafc6b367a4b49b893ae4998610be2d2a64cb6fdee
digest: 25c0c9c71410dfc279eb013586bdaf82d5bccf45068d9d1b2261c6d731826f41
engine: gotpl
maintainers:
- email: stefanprodan@users.noreply.github.com
@@ -19,9 +19,9 @@ entries:
grafana:
- apiVersion: v1
appVersion: "1.0"
created: 2018-12-04T16:25:13.052962+07:00
created: 2019-06-15T18:31:59.599191+03:00
description: A Helm chart for Kubernetes
digest: 3587f10e8159ff2779cadaa0af21606892848fc4e13a037a42b9d131475570aa
digest: 4a40019b6789e047f8ca720f3400c60277cc8c19f493367c2014b97942acdf10
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-12-04T16:25:13.053182+07:00
created: 2019-06-15T18:31:59.599397+03:00
description: Hey load test Helm chart for Kubernetes
digest: ee2c363030494c42b5ff9b4b4baa43c121d357357627c2748aab810274d3bf0e
digest: 30e7bb670bb0fca08ee9746f2b81369d3a7a3fcbc9f38c2f9d69c36625cc75b5
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-12-04T16:25:13.053736+07:00
created: 2019-06-15T18:31:59.600312+03:00
description: A Ngrok Helm chart for Kubernetes
digest: 2f4779d8a659aebf8cc14116a4805d895aa3e15be7528b95e1a1c86cae565157
digest: 89ebf8bcfd09eb19da3c73acd5ad5dd56791781171e4bc6d1fd883832ca3c628
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-12-04T16:25:13.053451+07:00
created: 2019-06-15T18:31:59.600036+03:00
description: A Ngrok Helm chart for Kubernetes
digest: 5678de7c8aac246df507f40b3f4f8fd6d06f4447e636398819a232dd26e1fc41
name: ngrok
@@ -56,9 +56,41 @@ entries:
- https://stefanprodan.github.io/k8s-podinfo/ngrok-0.1.0.tgz
version: 0.1.0
podinfo:
- apiVersion: v1
appVersion: 1.6.1
created: 2019-06-15T18:31:59.614364+03:00
description: Podinfo Helm chart for Kubernetes
digest: 4427173ee540f1f222030d8f4b38fbd812cd5bad3d2f55ec862e2db5f966cdbc
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.6.0.tgz
version: 1.6.0
- apiVersion: v1
appVersion: 1.5.0
created: 2019-06-15T18:31:59.613942+03:00
description: Podinfo Helm chart for Kubernetes
digest: 88207baab1922f6ba64d0f5b67650562a948bd0236c290e2bdad4b3ac2005be3
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.5.0.tgz
version: 1.5.0
- apiVersion: v1
appVersion: 1.4.1
created: 2018-12-04T16:25:13.059775+07:00
created: 2019-06-15T18:31:59.612612+03:00
description: Podinfo Helm chart for Kubernetes
digest: 0a1a25b12a2882e2641094b235f57dee6d95f9175823936be1dce73b75e808c3
engine: gotpl
@@ -74,7 +106,7 @@ entries:
version: 1.4.2
- apiVersion: v1
appVersion: 1.4.1
created: 2018-12-04T16:25:13.059386+07:00
created: 2019-06-15T18:31:59.611788+03:00
description: Podinfo Helm chart for Kubernetes
digest: 91ea71d56bf74135b3115a723f345a12022d5910abf21a8ee8d77d74385bc127
engine: gotpl
@@ -90,7 +122,7 @@ entries:
version: 1.4.1
- apiVersion: v1
appVersion: 1.4.0
created: 2018-12-04T16:25:13.058992+07:00
created: 2019-06-15T18:31:59.610465+03:00
description: Podinfo Helm chart for Kubernetes
digest: d30a844229125217f85d5c52ceb48c980f47027a5a1f9ee5c41bac44b9d18088
engine: gotpl
@@ -106,7 +138,7 @@ entries:
version: 1.4.0
- apiVersion: v1
appVersion: 1.3.1
created: 2018-12-04T16:25:13.058609+07:00
created: 2019-06-15T18:31:59.609318+03:00
description: Podinfo Helm chart for Kubernetes
digest: 9116966f2b1300655be11669789842a3d01e326fe1feb205198df3ba22bac3a5
engine: gotpl
@@ -122,7 +154,7 @@ entries:
version: 1.3.1
- apiVersion: v1
appVersion: 1.3.0
created: 2018-12-04T16:25:13.058177+07:00
created: 2019-06-15T18:31:59.608378+03:00
description: Podinfo Helm chart for Kubernetes
digest: 7111b868a11014ab56da11b7edbea9ce0d1a483500969252f66c9ae1943bac67
engine: gotpl
@@ -138,7 +170,7 @@ entries:
version: 1.3.0
- apiVersion: v1
appVersion: 1.2.1
created: 2018-12-04T16:25:13.057796+07:00
created: 2019-06-15T18:31:59.607605+03:00
description: Podinfo Helm chart for Kubernetes
digest: c750c1d4a7606a06cd89ae4433431c7e3ecf2ccc9a0e5f6baa26095397bd72da
engine: gotpl
@@ -154,7 +186,7 @@ entries:
version: 1.2.1
- apiVersion: v1
appVersion: 1.2.0
created: 2018-12-04T16:25:13.057382+07:00
created: 2019-06-15T18:31:59.606836+03:00
description: Podinfo Helm chart for Kubernetes
digest: 24460e15e6da77106eb5212cd683dc2c1d4404b927be6b9f0c89433ba865722e
engine: gotpl
@@ -170,7 +202,7 @@ entries:
version: 1.2.0
- apiVersion: v1
appVersion: 1.1.0
created: 2018-12-04T16:25:13.056624+07:00
created: 2019-06-15T18:31:59.6062+03:00
description: Podinfo Helm chart for Kubernetes
digest: 973d60c629d7ae476776098ad6b654d78d91f91b3faa8bc016b94c73c42be094
engine: gotpl
@@ -186,7 +218,7 @@ entries:
version: 1.1.0
- apiVersion: v1
appVersion: 1.0.0
created: 2018-12-04T16:25:13.055764+07:00
created: 2019-06-15T18:31:59.605471+03:00
description: Podinfo Helm chart for Kubernetes
digest: 82068727ba5b552341b14a980e954e27a8517f0ef76aab314c160b0f075e6de4
engine: gotpl
@@ -202,7 +234,7 @@ entries:
version: 1.0.0
- apiVersion: v1
appVersion: 0.6.0
created: 2018-12-04T16:25:13.055325+07:00
created: 2019-06-15T18:31:59.603735+03:00
description: Podinfo Helm chart for Kubernetes
digest: bd25a710eddb3985d3bd921a11022b5c68a04d37cf93a1a4aab17eeda35aa2f8
engine: gotpl
@@ -218,7 +250,7 @@ entries:
version: 0.2.2
- apiVersion: v1
appVersion: 0.5.1
created: 2018-12-04T16:25:13.054931+07:00
created: 2019-06-15T18:31:59.602991+03:00
description: Podinfo Helm chart for Kubernetes
digest: 631ca3e2db5553541a50b625f538e6a1f2a103c13aa8148fdd38baf2519e5235
engine: gotpl
@@ -234,7 +266,7 @@ entries:
version: 0.2.1
- apiVersion: v1
appVersion: 0.5.0
created: 2018-12-04T16:25:13.054523+07:00
created: 2019-06-15T18:31:59.602221+03:00
description: Podinfo Helm chart for Kubernetes
digest: dfe7cf44aef0d170549918b00966422a07e7611f9d0081fb34f5b5beb0641c00
engine: gotpl
@@ -250,7 +282,7 @@ entries:
version: 0.2.0
- apiVersion: v1
appVersion: 0.3.0
created: 2018-12-04T16:25:13.054109+07:00
created: 2019-06-15T18:31:59.601433+03:00
description: Podinfo Helm chart for Kubernetes
digest: 4865a2d8b269cf453935cda9661c2efb82c16411471f8c11221a6d03d9bb58b1
engine: gotpl
@@ -267,9 +299,9 @@ entries:
podinfo-istio:
- apiVersion: v1
appVersion: 1.2.1
created: 2018-12-04T16:25:13.062006+07:00
created: 2019-06-15T18:31:59.617629+03:00
description: Podinfo Helm chart for Istio
digest: f7b489ac446be5ae6d01c1085ecb8bf272502f5b7db06e9c9c70d8bb5dedaab6
digest: 3dd09269a03a55252da332a9d0260ff31b47b3dd96b7e7a547273bb5ccb6167d
engine: gotpl
home: https://github.com/stefanprodan/k8s-podinfo
maintainers:
@@ -283,7 +315,7 @@ entries:
version: 1.2.1
- apiVersion: v1
appVersion: 1.2.0
created: 2018-12-04T16:25:13.061474+07:00
created: 2019-06-15T18:31:59.617041+03:00
description: Podinfo Helm chart for Istio
digest: 8115e72f232f82eb3e6da1965364cfede7c069f95a627dddac45cfbe6cb90dc4
engine: gotpl
@@ -299,7 +331,7 @@ entries:
version: 1.2.0
- apiVersion: v1
appVersion: 1.1.0
created: 2018-12-04T16:25:13.060897+07:00
created: 2019-06-15T18:31:59.616155+03:00
description: Podinfo Helm chart for Istio
digest: bcceb63ff780a8f0ba0b30997040e4e82170f9cce17c26ec817648ed024c83f5
engine: gotpl
@@ -315,7 +347,7 @@ entries:
version: 0.2.0
- apiVersion: v1
appVersion: 0.6.0
created: 2018-12-04T16:25:13.060315+07:00
created: 2019-06-15T18:31:59.615212+03:00
description: Podinfo Helm chart for Istio
digest: f12f8aa1eca1328e9eaa30bd757f6ed3ff97205e2bf016a47265bc2de6a63d8f
engine: gotpl
@@ -329,4 +361,4 @@ entries:
urls:
- https://stefanprodan.github.io/k8s-podinfo/podinfo-istio-0.1.0.tgz
version: 0.1.0
generated: 2018-12-04T16:25:13.051514+07:00
generated: 2019-06-15T18:31:59.597729+03:00

Binary file not shown.

Binary file not shown.

BIN
docs/podinfo-1.5.0.tgz Normal file

Binary file not shown.

BIN
docs/podinfo-1.6.0.tgz Normal file

Binary file not shown.

Binary file not shown.

View File

@@ -33,6 +33,7 @@ type Config struct {
DataPath string `mapstructure:"data-path"`
ConfigPath string `mapstructure:"config-path"`
Port string `mapstructure:"port"`
PortMetrics int `mapstructure:"port-metrics"`
Hostname string `mapstructure:"hostname"`
RandomDelay bool `mapstructure:"random-delay"`
RandomError bool `mapstructure:"random-error"`
@@ -96,6 +97,7 @@ func (s *Server) registerMiddlewares() {
}
func (s *Server) ListenAndServe(stopCh <-chan struct{}) {
go s.startMetricsServer()
s.registerHandlers()
s.registerMiddlewares()
@@ -157,6 +159,24 @@ func (s *Server) ListenAndServe(stopCh <-chan struct{}) {
}
}
func (s *Server) startMetricsServer() {
if s.config.PortMetrics > 0 {
mux := http.DefaultServeMux
mux.Handle("/metrics", promhttp.Handler())
mux.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)
w.Write([]byte("OK"))
})
srv := &http.Server{
Addr: fmt.Sprintf(":%v", s.config.PortMetrics),
Handler: mux,
}
srv.ListenAndServe()
}
}
func (s *Server) printRoutes() {
s.router.Walk(func(route *mux.Route, router *mux.Router, ancestors []*mux.Route) error {
pathTemplate, err := route.GetPathTemplate()

View File

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

View File

@@ -125,12 +125,14 @@
</v-content>
</v-app>
</div>
<script src="https://unpkg.com/vue/dist/vue.min.js"></script>
<script src="https://unpkg.com/vuetify/dist/vuetify.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue@2.x/dist/vue.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vuetify@2.x/dist/vuetify.js"></script>
<script>
new Vue({
delimiters: ['${', '}'],
el: '#app',
vuetify: new Vuetify(),
data: function() {
return {
info: {},
@@ -147,7 +149,7 @@
getInfo: function() {
var xhr = new XMLHttpRequest()
var self = this
xhr.open('GET', "/api/info")
xhr.open('GET', "api/info")
xhr.onload = function () {
data = JSON.parse(xhr.responseText)
// reload page when the version changes
@@ -170,7 +172,7 @@
},
postBackend: function() {
var self = this
fetch("/api/echo", {
fetch("api/echo", {
method: 'post',
headers: {
"Content-type": "application/json; charset=UTF-8",