Skip to content

Commit

Permalink
feat(relay-proxy-helm): add ability to deploy extra manifests (#2198)
Browse files Browse the repository at this point in the history
Signed-off-by: yafanasiev <[email protected]>
Co-authored-by: Thomas Poignant <[email protected]>
  • Loading branch information
yafanasiev and thomaspoignant committed Aug 16, 2024
1 parent 56a9c0a commit 1772228
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 3 deletions.
14 changes: 14 additions & 0 deletions cmd/relayproxy/helm-charts/relay-proxy/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,17 @@ Create the name of the service account to use
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}

{{/*
Renders a value that contains template
Usage:
{{ include "common.tplvalues.render" ( dict "value" .Values.path.to.the.Value "context" $ ) }}
*/}}
{{- define "relay-proxy.render" -}}
{{- $value := typeIs "string" .value | ternary .value (.value | toYaml) }}
{{- if contains "{{" (toJson .value) }}
{{- tpl $value .context }}
{{- else }}
{{- $value }}
{{- end }}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,11 @@ spec:
{{- include "relay-proxy.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
checksum/configmap: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
{{- if .Values.podAnnotations }}
{{- include "relay-proxy.render" (dict "value" .Values.podAnnotations "context" $) | nindent 8 }}
{{- end }}
labels:
{{- include "relay-proxy.selectorLabels" . | nindent 8 }}
spec:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{{- range .Values.extraManifests }}
---
{{ include "relay-proxy.render" (dict "value" . "context" $) }}
{{- end }}
26 changes: 26 additions & 0 deletions cmd/relayproxy/helm-charts/relay-proxy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,29 @@ tolerations: []

# -- Affinity settings for pod assignment to nodes
affinity: {}

# -- Array of extra objects to deploy with the release (evaluated as a template)
extraManifests: []
# - kind: Role
# apiVersion: rbac.authorization.k8s.io/v1
# metadata:
# name: feature-flags-relay-proxy
# namespace: "{{ .Release.Namespace }}"
# rules:
# - apiGroups: [""]
# resources:
# - configmaps
# verbs:
# - get
# - kind: RoleBinding
# apiVersion: rbac.authorization.k8s.io/v1
# metadata:
# name: feature-flags-relay-proxy
# namespace: "{{ .Release.Namespace }}"
# subjects:
# - kind: ServiceAccount
# name: feature-flags-relay-proxy
# roleRef:
# kind: Role
# name: feature-flags-relay-proxy
# apiGroup: ""

0 comments on commit 1772228

Please sign in to comment.