Skip to content

Commit

Permalink
feat(helm): support annotations for certgen resources (envoyproxy#1996)
Browse files Browse the repository at this point in the history
* support annotations for certgen resources

* support annotations for certgen resources
* support configuration for certgen job ttlSecondsAfterFinished

Signed-off-by: Federico M. Facca <federico.facca@zaphiro.ch>

* apply review

Signed-off-by: Federico M. Facca <federico.facca@zaphiro.ch>

* update helm chart docs

Signed-off-by: Federico M. Facca <federico.facca@zaphiro.ch>

* apply comments

Signed-off-by: Federico M. Facca <federico.facca@zaphiro.ch>

---------

Signed-off-by: Federico M. Facca <federico.facca@zaphiro.ch>
  • Loading branch information
chicco785 authored Oct 19, 2023
1 parent 98213e4 commit f203fe5
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 1 deletion.
18 changes: 18 additions & 0 deletions charts/gateway-helm/templates/certgen-rbac.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@ metadata:
namespace: '{{ .Release.Namespace }}'
labels:
{{- include "eg.labels" . | nindent 4 }}
{{- if .Values.certgen.rbac.labels }}
{{- toYaml .Values.certgen.rbac.labels | nindent 4 }}
{{- end }}
annotations:
"helm.sh/hook": pre-install
{{- if .Values.certgen.rbac.annotations }}
{{- toYaml .Values.certgen.rbac.annotations | nindent 4 -}}
{{- end }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
Expand All @@ -15,8 +21,14 @@ metadata:
namespace: '{{ .Release.Namespace }}'
labels:
{{- include "eg.labels" . | nindent 4 }}
{{- if .Values.certgen.rbac.labels }}
{{- toYaml .Values.certgen.rbac.labels | nindent 4 }}
{{- end }}
annotations:
"helm.sh/hook": pre-install
{{- if .Values.certgen.rbac.annotations }}
{{- toYaml .Values.certgen.rbac.annotations | nindent 4 -}}
{{- end }}
rules:
- apiGroups:
- ""
Expand All @@ -34,8 +46,14 @@ metadata:
namespace: '{{ .Release.Namespace }}'
labels:
{{- include "eg.labels" . | nindent 4 }}
{{- if .Values.certgen.rbac.labels }}
{{- toYaml .Values.certgen.rbac.labels | nindent 4 }}
{{- end }}
annotations:
"helm.sh/hook": pre-install
{{- if .Values.certgen.rbac.annotations }}
{{- toYaml .Values.certgen.rbac.annotations | nindent 4 -}}
{{- end }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
Expand Down
7 changes: 6 additions & 1 deletion charts/gateway-helm/templates/certgen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ metadata:
{{- include "eg.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": pre-install
{{- if .Values.certgen.job.annotations }}
{{- toYaml .Values.certgen.job.annotations | nindent 4 -}}
{{- end }}
spec:
backoffLimit: 1
completions: 1
Expand Down Expand Up @@ -37,4 +40,6 @@ spec:
runAsNonRoot: true
runAsUser: 65534
serviceAccountName: {{ include "eg.fullname" . }}-certgen
ttlSecondsAfterFinished: 0
{{- if not ( kindIs "invalid" .Values.certgen.job.ttlSecondsAfterFinished) }}
ttlSecondsAfterFinished: {{ .Values.certgen.job.ttlSecondsAfterFinished }}
{{- end }}
8 changes: 8 additions & 0 deletions charts/gateway-helm/values.tmpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,11 @@ envoyGatewayMetricsService:
createNamespace: false

kubernetesClusterDomain: cluster.local

certgen:
job:
annotations: {}
ttlSecondsAfterFinished: 0
rbac:
annotations: {}
labels: {}
4 changes: 4 additions & 0 deletions site/content/en/latest/install/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ The Helm chart for Envoy Gateway

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| certgen.job.annotations | object | `{}` | |
| certgen.job.ttlSecondsAfterFinished | int | `0` | |
| certgen.rbac.annotations | object | `{}` | |
| certgen.rbac.labels | object | `{}` | |
| config.envoyGateway.gateway.controllerName | string | `"gateway.envoyproxy.io/gatewayclass-controller"` | |
| config.envoyGateway.logging.level.default | string | `"info"` | |
| config.envoyGateway.provider.type | string | `"Kubernetes"` | |
Expand Down

0 comments on commit f203fe5

Please sign in to comment.