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

Commit

Permalink
Helm: Pass etcd_cluster_name to command args. Allow service annotatio…
Browse files Browse the repository at this point in the history
…ns (#500)

* Pass etcd_cluster_name to command args. Allow service annotations

* Update annotation example to use values. Add etcd_cluster_port option
  • Loading branch information
absoludity authored and sebito91 committed Aug 15, 2018
1 parent 80284af commit 8b31577
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
25 changes: 24 additions & 1 deletion contrib/helm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,34 @@ helm delete ego
| `images.tag` | Event Gateway image tag | `0.9.0` |
| `replicaCount` | Number of containers | `3` |
| `service.type` | Type of Kubernetes service | `LoadBalancer` |
| `service.annotations` | Custom annotations for the service | `[]` |
| `service.config.port` | Config API port number | `4001` |
| `service.events.port` | Events API port number | `4000` |
| `resources.limits.cpu` | CPU resource limits | `200m` |
| `resources.limits.memory` | Memory resource limits | `256Mi` |
| `resources.requests.cpu` | CPU resource requests | `200m` |
| `resources.requests.memory` | Memory resource requests | `256Mi` |
| `command` | Options to pass to `event-gateway` command | `[-db-hosts=eg-etcd-cluster-client:2379, -log-level=debug]`|
| `etcd_cluster_name` | Name of the etcd cluster. Must be passed to the `-db-host` option as `<etcd-cluster-name>-client` | `eg-etcd-cluster`|
| `etcd_cluster_name` | Name of the etcd cluster. Passed to the `-db-hosts` option as `<etcd-cluster-name>-client` | `eg-etcd-cluster`|

The service annotations can be used to set any annotations required by your platform, for example, if
you update your values.yml with:

```
- annotations: []
+ annotations:
+ - "service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0"
+ - "foo: bar"
```

then the service will be annotated as shown:

```
$ helm install event-gateway --debug --dry-run | grep "kind: Service" -A5
kind: Service
metadata:
name: rafting-umbrellabird-event-gateway
annotations:
service.beta.kubernetes.io/aws-load-balancer-internal: 0.0.0.0/0
foo: bar
```
5 changes: 5 additions & 0 deletions contrib/helm/event-gateway/templates/event-gateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ spec:
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- "-db-hosts={{ .Values.etcd_cluster_name }}-client:{{ .Values.etcd_cluster_port }}"
{{- range .Values.command }}
- {{ . }}
{{- end }}
Expand All @@ -40,6 +41,10 @@ apiVersion: v1
kind: Service
metadata:
name: {{ template "event-gateway.fullname" . }}
annotations:
{{- range .Values.service.annotations }}
{{ . }}
{{- end }}
labels:
chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
spec:
Expand Down
6 changes: 4 additions & 2 deletions contrib/helm/event-gateway/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@ service:
port: 4001
events:
port: 4000
annotations: []
resources:
limits:
cpu: 200m
memory: 256Mi
requests:
cpu: 200m
memory: 256Mi
command: ["-db-hosts=eg-etcd-cluster-client:2379", "-log-level=debug"]
etcd_cluster_name: eg-etcd-cluster
command: ["-log-level=debug"]
etcd_cluster_name: eg-etcd-cluster
etcd_cluster_port: 2379

0 comments on commit 8b31577

Please sign in to comment.