Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(relay-proxy-helm): add ability to deploy extra manifests #2198

Merged
merged 3 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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: ""
Loading