Skip to content

Commit

Permalink
Merge pull request #44 from stefanprodan/helm-docs
Browse files Browse the repository at this point in the history
Add Helm and Weave Flux GitOps article
  • Loading branch information
stefanprodan authored Feb 13, 2019
2 parents 8a03ae1 + bb0175a commit 5dfb580
Show file tree
Hide file tree
Showing 16 changed files with 433 additions and 10 deletions.
6 changes: 6 additions & 0 deletions artifacts/cluster/namespaces/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
apiVersion: v1
kind: Namespace
metadata:
name: test
labels:
istio-injection: enabled
26 changes: 26 additions & 0 deletions artifacts/cluster/releases/test/backend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
apiVersion: flux.weave.works/v1beta1
kind: HelmRelease
metadata:
name: backend
namespace: test
annotations:
flux.weave.works/automated: "true"
flux.weave.works/tag.chart-image: regexp:^1.4.*
spec:
releaseName: backend
chart:
repository: https://flagger.app/
name: podinfo
version: 2.0.0
values:
image:
repository: quay.io/stefanprodan/podinfo
tag: 1.4.0
httpServer:
timeout: 30s
canary:
enabled: true
istioIngress:
enabled: false
loadtest:
enabled: true
27 changes: 27 additions & 0 deletions artifacts/cluster/releases/test/frontend.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
apiVersion: flux.weave.works/v1beta1
kind: HelmRelease
metadata:
name: frontend
namespace: test
annotations:
flux.weave.works/automated: "true"
flux.weave.works/tag.chart-image: semver:~1.4
spec:
releaseName: frontend
chart:
repository: https://flagger.app/
name: podinfo
version: 2.0.0
values:
image:
repository: quay.io/stefanprodan/podinfo
tag: 1.4.0
backend: http://backend-podinfo:9898/echo
canary:
enabled: true
istioIngress:
enabled: true
gateway: public-gateway.istio-system.svc.cluster.local
host: frontend.istio.example.com
loadtest:
enabled: true
18 changes: 18 additions & 0 deletions artifacts/cluster/releases/test/loadtester.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: flux.weave.works/v1beta1
kind: HelmRelease
metadata:
name: loadtester
namespace: test
annotations:
flux.weave.works/automated: "true"
flux.weave.works/tag.chart-image: glob:0.*
spec:
releaseName: flagger-loadtester
chart:
repository: https://flagger.app/
name: loadtester
version: 0.1.0
values:
image:
repository: quay.io/stefanprodan/flagger-loadtester
tag: 0.1.0
15 changes: 15 additions & 0 deletions charts/podinfo/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "podinfo.fullname" . }}
labels:
app: {{ template "podinfo.name" . }}
chart: {{ template "podinfo.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
data:
config.yaml: |-
# http settings
http-client-timeout: 1m
http-server-timeout: {{ .Values.httpServer.timeout }}
http-server-shutdown-timeout: 5s
7 changes: 7 additions & 0 deletions charts/podinfo/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ spec:
- --level={{ .Values.logLevel }}
- --random-delay={{ .Values.faults.delay }}
- --random-error={{ .Values.faults.error }}
- --config-path=/podinfo/config
env:
{{- if .Values.message }}
- name: PODINFO_UI_MESSAGE
Expand Down Expand Up @@ -67,6 +68,9 @@ spec:
volumeMounts:
- name: data
mountPath: /data
- name: config
mountPath: /podinfo/config
readOnly: true
resources:
{{ toYaml .Values.resources | indent 12 }}
{{- with .Values.nodeSelector }}
Expand All @@ -84,3 +88,6 @@ spec:
volumes:
- name: data
emptyDir: {}
- name: config
configMap:
name: {{ template "podinfo.fullname" . }}
5 changes: 5 additions & 0 deletions charts/podinfo/templates/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
name: {{ template "podinfo.fullname" . }}
labels:
app: {{ template "podinfo.name" . }}
chart: {{ template "podinfo.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
scaleTargetRef:
apiVersion: apps/v1beta2
Expand Down
13 changes: 8 additions & 5 deletions charts/podinfo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ service:
hpa:
enabled: true
minReplicas: 2
maxReplicas: 4
maxReplicas: 2
cpu: 80
memory: 512Mi

canary:
enabled: false
enabled: true
istioIngress:
enabled: false
# Istio ingress gateway name
Expand All @@ -33,7 +33,7 @@ canary:
maxWeight: 50
# canary increment step
# percentage (0-100)
stepWeight: 2
stepWeight: 5
thresholds:
# minimum req success rate (non 5xx responses)
# percentage (0-100)
Expand All @@ -42,7 +42,7 @@ canary:
# milliseconds
latency: 500
loadtest:
enabled: true
enabled: false
# load tester address
url: http://flagger-loadtester.test/

Expand All @@ -67,4 +67,7 @@ message: #UI greetings

faults:
delay: false
error: false
error: false

httpServer:
timeout: 30s
Binary file added docs/diagrams/flagger-flux-gitops.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions docs/gitbook/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ description: Flagger is an Istio progressive delivery Kubernetes operator

[Flagger](https://github.com/stefanprodan/flagger) is a **Kubernetes** operator that automates the promotion of canary
deployments using **Istio** routing for traffic shifting and **Prometheus** metrics for canary analysis.
The canary analysis can be extended with webhooks for running integration tests,
load tests or any other custom validation.
The canary analysis can be extended with webhooks for running
system integration/acceptance tests, load tests, or any other custom validation.

Flagger implements a control loop that gradually shifts traffic to the canary while measuring key performance
indicators like HTTP requests success rate, requests average duration and pods health.
Based on the **KPIs** analysis a canary is promoted or aborted and the analysis result is published to **Slack**.
Based on analysis of the **KPIs** a canary is promoted or aborted, and the analysis result is published to **Slack**.

![Flagger overview diagram](https://github.com/raw/stefanprodan/flagger/master/docs/diagrams/flagger-canary-overview.png)

Flagger can be configured with Kubernetes custom resources \(canaries.flagger.app kind\) and is compatible with
Flagger can be configured with Kubernetes custom resources and is compatible with
any CI/CD solutions made for Kubernetes. Since Flagger is declarative and reacts to Kubernetes events,
it can be used in **GitOps** pipelines together with Weave Flux or JenkinsX.

Expand Down
3 changes: 2 additions & 1 deletion docs/gitbook/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
* [Monitoring](usage/monitoring.md)
* [Alerting](usage/alerting.md)

# Tutorials


* [Canary Deployments with Helm charts](tutorials/canary-helm-gitops.md)
Loading

0 comments on commit 5dfb580

Please sign in to comment.