Skip to content

Instantly share code, notes, and snippets.

@mmontes11
Last active July 31, 2021 11:21
Show Gist options
  • Save mmontes11/97eead33fd4c1c4e469827b63740dc8d to your computer and use it in GitHub Desktop.
Save mmontes11/97eead33fd4c1c4e469827b63740dc8d to your computer and use it in GitHub Desktop.
Operator deployment
{{ $fullName := include "echoperator.fullname" . }}
{{ $selectorLabels := include "echoperator.selectorLabels" . }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ $fullName }}
labels:
{{ include "echoperator.labels" . | nindent 4 }}
spec:
{{ if .Values.ha.enabled}}
replicas: {{ .Values.ha.replicaCount }}
{{ end }}
selector:
matchLabels:
{{ $selectorLabels | nindent 6 }}
template:
metadata:
labels:
{{ $selectorLabels | nindent 8 }}
spec:
serviceAccountName: {{ $fullName }}
containers:
- name: {{ $fullName }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{ with .Values.resources }}
resources:
{{ toYaml . | nindent 12 }}
{{ end }}
envFrom:
- configMapRef:
name: {{ $fullName }}
{{ with .Values.nodeSelector }}
nodeSelector:
{{ toYaml . | nindent 8 }}
{{ end }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment