mirror of
https://github.com/stefanprodan/podinfo.git
synced 2026-04-07 03:26:54 +00:00
Compare commits
33 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
18af1ea3a6 | ||
|
|
2e9917a6b9 | ||
|
|
bf00d07b17 | ||
|
|
aab8e464e8 | ||
|
|
1475a2da00 | ||
|
|
44f588dd4c | ||
|
|
951d82abb9 | ||
|
|
3301f6f8d4 | ||
|
|
0339d3beb0 | ||
|
|
d1b77c97b8 | ||
|
|
bfa3aaf9ac | ||
|
|
43df2d19c6 | ||
|
|
7181351c89 | ||
|
|
1c3bf10de2 | ||
|
|
c28c11d4a5 | ||
|
|
5c2f9a19d6 | ||
|
|
7d5200a78a | ||
|
|
66b8948473 | ||
|
|
db04ce117b | ||
|
|
5142c39a8e | ||
|
|
001486ac0a | ||
|
|
ed553135b2 | ||
|
|
c21c24b2fd | ||
|
|
4dbbfa9239 | ||
|
|
bc8ff9b412 | ||
|
|
cdf9b06b86 | ||
|
|
431ab9e19e | ||
|
|
1273d3745e | ||
|
|
caa49b96aa | ||
|
|
319e444ddf | ||
|
|
0529fff9aa | ||
|
|
0fc239aaca | ||
|
|
f0b19b63e9 |
104
.drone.yml
Normal file
104
.drone.yml
Normal 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
|
||||
4
.github/actions/golang/Dockerfile
vendored
4
.github/actions/golang/Dockerfile
vendored
@@ -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"
|
||||
|
||||
11
.travis.yml
11
.travis.yml
@@ -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
33
Dockerfile.arm
Normal 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"]
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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.
@@ -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
BIN
docs/podinfo-1.5.0.tgz
Normal file
Binary file not shown.
BIN
docs/podinfo-1.6.0.tgz
Normal file
BIN
docs/podinfo-1.6.0.tgz
Normal file
Binary file not shown.
Binary file not shown.
@@ -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()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package version
|
||||
|
||||
var VERSION = "1.4.2"
|
||||
var VERSION = "1.7.0"
|
||||
var REVISION = "unknown"
|
||||
|
||||
10
ui/vue.html
10
ui/vue.html
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user