Skip to content

Commit 841f4e5

Browse files
committed
Major update
1 parent 4b08492 commit 841f4e5

35 files changed

+1109
-223
lines changed

charts/generic-service/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,14 @@
33
This Helm chart simplifies deploying a typical "80% case" service on Kubernetes. It takes care of creating common [Resources](#resources) such as `Deployment`, `Service` and `Ingress`. It also provides optional support for:
44

55
- [nginx Ingress Controller](https://kubernetes.github.io/ingress-nginx/), [Contour](https://projectcontour.io/) or [Istio](https://istio.io/) for routing
6+
- HAProxy
7+
- Contour
68
- [Prometheus Operator](https://github.com/prometheus-operator/prometheus-operator) for monitoring
79
- [Loki Rule Operator](https://github.com/opsgy/loki-rule-operator) or Loki sidecar for logging-based alerting
810
- [OpenTelemetry Operator](https://github.com/open-telemetry/opentelemetry-operator) or [Jaeger Operator](https://www.jaegertracing.io/docs/latest/operator/) for tracing
911
- [Flagger](https://flagger.app/) and [Argo Rollouts](https://argoproj.github.io/argo-rollouts/) for canary and blue-green deployments
12+
- Cillium Network Policies
13+
- Sealed Secrets
1014

1115
The [Generic Service Grafana Dashboard](https://grafana.com/grafana/dashboards/14759) is a useful companion to this chart.
1216

charts/generic-service/ci/additional-mounts-values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ additionalMounts:
88
/tmp:
99
name: temp
1010
emptyDir: {}
11+
/etc/nginx/nginx.conf:
12+
name: temp
13+
emptyDir: {}
14+
subPath: nginx.conf
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Argo Rollout controller BlueGreen test
2+
3+
image:
4+
repository: jwilder/whoami
5+
tag: latest
6+
7+
ingress:
8+
enabled: true
9+
port: 8000
10+
11+
rollout:
12+
controller: ArgoRollout
13+
strategy: BlueGreen
14+
blueGreen:
15+
autoPromotion: true
16+
prePromotionAnalysis:
17+
templates:
18+
- templateName: pod-ready
19+
clusterScope: true
20+
- templateName: success-rate
21+
postPromotionAnalysis:
22+
templates:
23+
- templateName: success-rate
24+
- templateName: pod-ready
25+
clusterScope: true
26+
args:
27+
- name: service-name
28+
value: canary-demo
29+
analysisTemplates:
30+
success-rate:
31+
args:
32+
- name: service-name
33+
metrics:
34+
- name: success-rate
35+
interval: 5m
36+
count: 10
37+
successCondition: "result[0] >= 0.95"
38+
query: |
39+
sum(irate(
40+
istio_requests_total{reporter="source",destination_service=~"{{args.service-name}}",response_code!~"5.*"}[5m]
41+
)) /
42+
sum(irate(
43+
istio_requests_total{reporter="source",destination_service=~"{{args.service-name}}"}[5m]
44+
))
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Argo Rollout controller Canary test
2+
3+
image:
4+
repository: jwilder/whoami
5+
tag: latest
6+
7+
ingress:
8+
enabled: true
9+
port: 8000
10+
11+
replicas: 2
12+
13+
rollout:
14+
controller: ArgoRollout
15+
strategy: Canary
16+
canary:
17+
analysis:
18+
templates:
19+
- templateName: success-rate
20+
- templateName: success-rate
21+
clusterScope: true
22+
args:
23+
- name: service-name
24+
value: canary-demo
25+
steps:
26+
- setWeight: 20
27+
- analysis:
28+
templates:
29+
- templateName: success-rate
30+
- templateName: success-rate
31+
clusterScope: true
32+
args:
33+
- name: service-name
34+
value: canary-demo
35+
- pause:
36+
duration: 1h
37+
- setWeight: 40
38+
analysisTemplates:
39+
success-rate:
40+
args:
41+
- name: service-name
42+
value: canary-demo
43+
metrics:
44+
- name: success-rate
45+
interval: 5m
46+
count: 10
47+
successCondition: "result[0] >= 0.95"
48+
query: |
49+
sum(irate(
50+
istio_requests_total{reporter="source",destination_service=~"{{args.service-name}}",response_code!~"5.*"}[5m]
51+
)) /
52+
sum(irate(
53+
istio_requests_total{reporter="source",destination_service=~"{{args.service-name}}"}[5m]
54+
))

charts/generic-service/ci/argo-values.yaml

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Autoscaling custom metrics test
2+
3+
image:
4+
repository: jwilder/whoami
5+
tag: latest
6+
7+
autoscaling:
8+
enabled: true
9+
metrics:
10+
- type: External
11+
external:
12+
metric:
13+
name: some_metric
14+
selector:
15+
key: value
16+
target:
17+
type: AverageValue
18+
averageValue: 30
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Extra ingress test
2+
3+
image:
4+
repository: jwilder/whoami
5+
tag: latest
6+
7+
ingress:
8+
enabled: true
9+
port: 8000
10+
domains: ['example.com']
11+
class: nginx
12+
cors:
13+
enabled: true
14+
allowOrigin:
15+
- foo
16+
- bar
17+
exposeHeaders:
18+
- Content-Type
19+
extra:
20+
additional-annotation:
21+
domains: ['custom-annotation.example.com']
22+
annotations:
23+
key: value
24+
cors-disabled:
25+
cors:
26+
enabled: false
27+
domains: ['cors-disabled.example.com']
28+
haproxy:
29+
class: haproxy
30+
domains: ['haproxy.example.com']
31+
haproxy-no-allow-origin:
32+
class: haproxy
33+
cors:
34+
enabled: true
35+
allowOrigin: []
36+
domains: ['haproxy-no-allow-origin.example.com']

charts/generic-service/ci/ingress-extra-values.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ ingress:
99
port: 8000
1010
domains: ['example.com']
1111
class: nginx
12+
cors:
13+
enabled: true
1214
annotations:
1315
nginx.ingress.kubernetes.io/configuration-snippet: dummy-config;
1416
extra:
@@ -29,3 +31,7 @@ ingress:
2931
annotations:
3032
nginx.ingress.kubernetes.io/configuration-snippet: other-dummy-config;
3133
timeoutSeconds: 5
34+
cors-disabled:
35+
cors:
36+
enabled: true
37+
domains: ['cors-disabled.example.com']
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# HAProxy ingress test
2+
3+
image:
4+
repository: jwilder/whoami
5+
tag: latest
6+
7+
ingress:
8+
enabled: true
9+
port: 8000
10+
class: haproxy-public
11+
domains: ['somedomain.example.com']
12+
protocol: h2c
13+
timeoutSeconds: 2
14+
cors:
15+
enabled: true
16+
extra:
17+
timeout:
18+
domains: ['timeout.example.com']
19+
timeoutSeconds: 10
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Extra ingress test
2+
3+
image:
4+
repository: jwilder/whoami
5+
tag: latest
6+
7+
ingress:
8+
enabled: true
9+
port: 8000
10+
domains: ['somedomain.example.com']
11+
pathType: Exact
12+
extra:
13+
some-extra:
14+
domains: ['some-extra.example.com']
15+
pathType: ImplementationSpecific

0 commit comments

Comments
 (0)