Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.

Commit 8b31577

Browse files
absoluditysebito91
authored andcommitted
Helm: Pass etcd_cluster_name to command args. Allow service annotations (#500)
* Pass etcd_cluster_name to command args. Allow service annotations * Update annotation example to use values. Add etcd_cluster_port option
1 parent 80284af commit 8b31577

File tree

3 files changed

+33
-3
lines changed

3 files changed

+33
-3
lines changed

contrib/helm/README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,34 @@ helm delete ego
3939
| `images.tag` | Event Gateway image tag | `0.9.0` |
4040
| `replicaCount` | Number of containers | `3` |
4141
| `service.type` | Type of Kubernetes service | `LoadBalancer` |
42+
| `service.annotations` | Custom annotations for the service | `[]` |
4243
| `service.config.port` | Config API port number | `4001` |
4344
| `service.events.port` | Events API port number | `4000` |
4445
| `resources.limits.cpu` | CPU resource limits | `200m` |
4546
| `resources.limits.memory` | Memory resource limits | `256Mi` |
4647
| `resources.requests.cpu` | CPU resource requests | `200m` |
4748
| `resources.requests.memory` | Memory resource requests | `256Mi` |
4849
| `command` | Options to pass to `event-gateway` command | `[-db-hosts=eg-etcd-cluster-client:2379, -log-level=debug]`|
49-
| `etcd_cluster_name` | Name of the etcd cluster. Must be passed to the `-db-host` option as `<etcd-cluster-name>-client` | `eg-etcd-cluster`|
50+
| `etcd_cluster_name` | Name of the etcd cluster. Passed to the `-db-hosts` option as `<etcd-cluster-name>-client` | `eg-etcd-cluster`|
51+
52+
The service annotations can be used to set any annotations required by your platform, for example, if
53+
you update your values.yml with:
54+
55+
```
56+
- annotations: []
57+
+ annotations:
58+
+ - "service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0"
59+
+ - "foo: bar"
60+
```
61+
62+
then the service will be annotated as shown:
63+
64+
```
65+
$ helm install event-gateway --debug --dry-run | grep "kind: Service" -A5
66+
kind: Service
67+
metadata:
68+
name: rafting-umbrellabird-event-gateway
69+
annotations:
70+
service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0
71+
foo: bar
72+
```

contrib/helm/event-gateway/templates/event-gateway.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ spec:
2424
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
2525
imagePullPolicy: {{ .Values.image.pullPolicy }}
2626
args:
27+
- "-db-hosts={{ .Values.etcd_cluster_name }}-client:{{ .Values.etcd_cluster_port }}"
2728
{{- range .Values.command }}
2829
- {{ . }}
2930
{{- end }}
@@ -40,6 +41,10 @@ apiVersion: v1
4041
kind: Service
4142
metadata:
4243
name: {{ template "event-gateway.fullname" . }}
44+
annotations:
45+
{{- range .Values.service.annotations }}
46+
{{ . }}
47+
{{- end }}
4348
labels:
4449
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
4550
spec:

contrib/helm/event-gateway/values.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,14 @@ service:
99
port: 4001
1010
events:
1111
port: 4000
12+
annotations: []
1213
resources:
1314
limits:
1415
cpu: 200m
1516
memory: 256Mi
1617
requests:
1718
cpu: 200m
1819
memory: 256Mi
19-
command: ["-db-hosts=eg-etcd-cluster-client:2379", "-log-level=debug"]
20-
etcd_cluster_name: eg-etcd-cluster
20+
command: ["-log-level=debug"]
21+
etcd_cluster_name: eg-etcd-cluster
22+
etcd_cluster_port: 2379

0 commit comments

Comments
 (0)