-
Notifications
You must be signed in to change notification settings - Fork 742
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add podinfo chart for GitOps testing
- Loading branch information
1 parent
3a05cfa
commit 26500e9
Showing
14 changed files
with
390 additions
and
4 deletions.
There are no files selected for viewing
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: v1 | ||
version: 1.2.1 | ||
appVersion: 1.2.1 | ||
engine: gotpl | ||
name: podinfo-steerer | ||
description: Podinfo Helm chart for Steerer progressive delivery | ||
home: https://github.com/stefanprodan/k8s-podinfo | ||
maintainers: | ||
- email: stefanprodan@users.noreply.github.com | ||
name: stefanprodan | ||
sources: | ||
- https://github.com/stefanprodan/steerer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Podinfo Istio | ||
|
||
Podinfo is a tiny web application made with Go | ||
that showcases best practices of running microservices in Kubernetes. | ||
|
||
## Installing the Chart | ||
|
||
Create an Istio enabled namespace: | ||
|
||
```console | ||
kubectl create namespace test | ||
kubectl label namespace test istio-injection=enabled | ||
``` | ||
|
||
Create an Istio Gateway in the `istio-system` namespace named `public-gateway`: | ||
|
||
```yaml | ||
apiVersion: networking.istio.io/v1alpha3 | ||
kind: Gateway | ||
metadata: | ||
name: public-gateway | ||
namespace: istio-system | ||
spec: | ||
selector: | ||
istio: ingressgateway | ||
servers: | ||
- port: | ||
number: 80 | ||
name: http | ||
protocol: HTTP | ||
hosts: | ||
- "*" | ||
tls: | ||
httpsRedirect: true | ||
- port: | ||
number: 443 | ||
name: https | ||
protocol: HTTPS | ||
hosts: | ||
- "*" | ||
tls: | ||
mode: SIMPLE | ||
privateKey: /etc/istio/ingressgateway-certs/tls.key | ||
serverCertificate: /etc/istio/ingressgateway-certs/tls.crt | ||
``` | ||
Create the `frontend` release by specifying the external domain name: | ||
|
||
```console | ||
helm upgrade frontend -i ./charts/podinfo-steerer \ | ||
--namespace=test \ | ||
--set gateway.enabled=true \ | ||
--set gateway.host=podinfo.example.com | ||
``` | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{{ template "podinfo-steerer.fullname" . }} has been deployed successfully! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{{/* vim: set filetype=mustache: */}} | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "podinfo-steerer.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create a default fully qualified app name. | ||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). | ||
The release name is used as a full name. | ||
*/}} | ||
{{- define "podinfo-steerer.fullname" -}} | ||
{{- if .Values.fullnameOverride -}} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} | ||
{{- else -}} | ||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
{{- end -}} | ||
|
||
{{- define "podinfo-steerer.primary" -}} | ||
{{- printf "%s-%s" .Release.Name "primary" | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{- define "podinfo-steerer.canary" -}} | ||
{{- printf "%s-%s" .Release.Name "canary" | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "podinfo-steerer.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} | ||
{{- end -}} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ template "podinfo-steerer.canary" . }} | ||
labels: | ||
app: {{ template "podinfo-steerer.fullname" . }} | ||
chart: {{ template "podinfo-steerer.chart" . }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
spec: | ||
strategy: | ||
type: RollingUpdate | ||
rollingUpdate: | ||
maxUnavailable: 0 | ||
selector: | ||
matchLabels: | ||
app: {{ template "podinfo-steerer.canary" . }} | ||
template: | ||
metadata: | ||
labels: | ||
app: {{ template "podinfo-steerer.canary" . }} | ||
annotations: | ||
prometheus.io/scrape: "true" | ||
spec: | ||
terminationGracePeriodSeconds: 30 | ||
containers: | ||
- name: podinfod | ||
image: "{{ .Values.canary.repository }}:{{ .Values.canary.tag }}" | ||
imagePullPolicy: {{ .Values.imagePullPolicy }} | ||
command: | ||
- ./podinfo | ||
- --port={{ .Values.containerPort }} | ||
- --level={{ .Values.logLevel }} | ||
env: | ||
- name: PODINFO_UI_COLOR | ||
value: green | ||
ports: | ||
- name: http | ||
containerPort: {{ .Values.containerPort }} | ||
protocol: TCP | ||
livenessProbe: | ||
exec: | ||
command: | ||
- podcli | ||
- check | ||
- http | ||
- localhost:{{ .Values.containerPort }}/healthz | ||
readinessProbe: | ||
exec: | ||
command: | ||
- podcli | ||
- check | ||
- http | ||
- localhost:{{ .Values.containerPort }}/readyz | ||
periodSeconds: 3 | ||
volumeMounts: | ||
- name: data | ||
mountPath: /data | ||
resources: | ||
{{ toYaml .Values.resources | indent 12 }} | ||
volumes: | ||
- name: data | ||
emptyDir: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
apiVersion: autoscaling/v2beta1 | ||
kind: HorizontalPodAutoscaler | ||
metadata: | ||
name: {{ template "podinfo-steerer.canary" . }} | ||
labels: | ||
app: {{ template "podinfo-steerer.fullname" . }} | ||
chart: {{ template "podinfo-steerer.chart" . }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
spec: | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: {{ template "podinfo-steerer.canary" . }} | ||
minReplicas: {{ .Values.hpa.minReplicas }} | ||
maxReplicas: {{ .Values.hpa.maxReplicas }} | ||
metrics: | ||
- type: Resource | ||
resource: | ||
name: cpu | ||
targetAverageUtilization: {{ .Values.hpa.targetAverageUtilization }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ template "podinfo-steerer.canary" . }} | ||
labels: | ||
app: {{ template "podinfo-steerer.fullname" . }} | ||
chart: {{ template "podinfo-steerer.chart" . }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
spec: | ||
type: ClusterIP | ||
ports: | ||
- port: {{ .Values.containerPort }} | ||
targetPort: http | ||
protocol: TCP | ||
name: http | ||
selector: | ||
app: {{ template "podinfo-steerer.canary" . }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: {{ template "podinfo-steerer.primary" . }} | ||
labels: | ||
app: {{ template "podinfo-steerer.fullname" . }} | ||
chart: {{ template "podinfo-steerer.chart" . }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
spec: | ||
strategy: | ||
type: RollingUpdate | ||
rollingUpdate: | ||
maxUnavailable: 0 | ||
selector: | ||
matchLabels: | ||
app: {{ template "podinfo-steerer.primary" . }} | ||
template: | ||
metadata: | ||
labels: | ||
app: {{ template "podinfo-steerer.primary" . }} | ||
annotations: | ||
prometheus.io/scrape: "true" | ||
spec: | ||
terminationGracePeriodSeconds: 30 | ||
containers: | ||
- name: podinfod | ||
image: "quay.io/stefanprodan/podinfo:1.1.1" | ||
imagePullPolicy: {{ .Values.imagePullPolicy }} | ||
command: | ||
- ./podinfo | ||
- --port={{ .Values.containerPort }} | ||
- --level={{ .Values.logLevel }} | ||
env: | ||
- name: PODINFO_UI_COLOR | ||
value: blue | ||
ports: | ||
- name: http | ||
containerPort: {{ .Values.containerPort }} | ||
protocol: TCP | ||
livenessProbe: | ||
exec: | ||
command: | ||
- podcli | ||
- check | ||
- http | ||
- localhost:{{ .Values.containerPort }}/healthz | ||
readinessProbe: | ||
exec: | ||
command: | ||
- podcli | ||
- check | ||
- http | ||
- localhost:{{ .Values.containerPort }}/readyz | ||
periodSeconds: 3 | ||
volumeMounts: | ||
- name: data | ||
mountPath: /data | ||
resources: | ||
{{ toYaml .Values.resources | indent 12 }} | ||
volumes: | ||
- name: data | ||
emptyDir: {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
apiVersion: autoscaling/v2beta1 | ||
kind: HorizontalPodAutoscaler | ||
metadata: | ||
name: {{ template "podinfo-steerer.primary" . }} | ||
labels: | ||
app: {{ template "podinfo-steerer.fullname" . }} | ||
chart: {{ template "podinfo-steerer.chart" . }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
spec: | ||
scaleTargetRef: | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
name: {{ template "podinfo-steerer.primary" . }} | ||
minReplicas: {{ .Values.hpa.minReplicas }} | ||
maxReplicas: {{ .Values.hpa.maxReplicas }} | ||
metrics: | ||
- type: Resource | ||
resource: | ||
name: cpu | ||
targetAverageUtilization: {{ .Values.hpa.targetAverageUtilization }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ template "podinfo-steerer.primary" . }} | ||
labels: | ||
app: {{ template "podinfo-steerer.fullname" . }} | ||
chart: {{ template "podinfo-steerer.chart" . }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
spec: | ||
type: ClusterIP | ||
ports: | ||
- port: {{ .Values.containerPort }} | ||
targetPort: http | ||
protocol: TCP | ||
name: http | ||
selector: | ||
app: {{ template "podinfo-steerer.primary" . }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
apiVersion: networking.istio.io/v1alpha3 | ||
kind: VirtualService | ||
metadata: | ||
name: {{ template "podinfo-steerer.fullname" . }} | ||
labels: | ||
app: {{ template "podinfo-steerer.fullname" . }} | ||
chart: {{ template "podinfo-steerer.chart" . }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
spec: | ||
hosts: | ||
- {{ template "podinfo-steerer.fullname" . }} | ||
{{- if .Values.gateway.enabled }} | ||
- {{ .Values.gateway.host }} | ||
gateways: | ||
- {{ .Values.gateway.name }} | ||
{{- end }} | ||
http: | ||
- route: | ||
- destination: | ||
host: {{ template "podinfo-steerer.primary" . }} | ||
port: | ||
number: {{ .Values.containerPort }} | ||
weight: 100 | ||
- destination: | ||
host: {{ template "podinfo-steerer.canary" . }} | ||
port: | ||
number: {{ .Values.containerPort }} | ||
weight: 0 | ||
timeout: {{ .Values.timeout }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Default values for podinfo-steerer. | ||
|
||
canary: | ||
repository: quay.io/stefanprodan/podinfo | ||
tag: "1.2.0" | ||
|
||
# enable the gateway when exposing the service outside the cluster | ||
gateway: | ||
enabled: false | ||
name: public-gateway.istio-system.svc.cluster.local | ||
# external domain name | ||
host: | ||
|
||
hpa: | ||
minReplicas: 2 | ||
maxReplicas: 4 | ||
targetAverageUtilization: 99 | ||
|
||
timeout: 30s | ||
logLevel: info | ||
containerPort: 9898 | ||
imagePullPolicy: IfNotPresent | ||
|
||
resources: | ||
limits: | ||
cpu: 2000m | ||
memory: 512Mi | ||
requests: | ||
cpu: 100m | ||
memory: 64Mi |
Oops, something went wrong.