rancher-partner-charts/charts/mongodb/community-operator/0.12.0/templates/operator.yaml

89 lines
3.2 KiB
YAML

---
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
email: support@mongodb.com
labels:
owner: mongodb
name: {{ .Values.operator.name }}
namespace: {{ .Release.Namespace }}
spec:
replicas: {{ .Values.operator.replicas }}
selector:
matchLabels:
name: {{ .Values.operator.name }}
strategy:
rollingUpdate:
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
name: {{ .Values.operator.name }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: name
operator: In
values:
- {{ .Values.operator.name }}
topologyKey: kubernetes.io/hostname
containers:
- command:
- /usr/local/bin/entrypoint
env:
{{- if .Values.operator.extraEnvs }}
{{ toYaml .Values.operator.extraEnvs | nindent 12 }}
{{- end }}
- name: WATCH_NAMESPACE
{{- if .Values.operator.watchNamespace}}
value: "{{ .Values.operator.watchNamespace }}"
{{- else }}
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- end }}
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: OPERATOR_NAME
value: {{ .Values.operator.name }}
- name: AGENT_IMAGE
value: "{{ .Values.registry.agent }}/{{ .Values.agent.name }}:{{ .Values.agent.version }}"
- name: VERSION_UPGRADE_HOOK_IMAGE
value: "{{ .Values.registry.versionUpgradeHook }}/{{ .Values.versionUpgradeHook.name }}:{{ .Values.versionUpgradeHook.version }}"
- name: READINESS_PROBE_IMAGE
value: "{{ .Values.registry.readinessProbe }}/{{ .Values.readinessProbe.name }}:{{ .Values.readinessProbe.version }}"
- name: MONGODB_IMAGE
value: {{ .Values.mongodb.name }}
- name: MONGODB_REPO_URL
value: {{ .Values.mongodb.repo }}
- name: MDB_IMAGE_TYPE
value: {{ .Values.mongodb.imageType }}
image: {{ .Values.registry.operator }}/{{ .Values.operator.operatorImageName }}:{{ .Values.operator.version }}
imagePullPolicy: {{ .Values.registry.pullPolicy}}
name: {{ .Values.operator.deploymentName }}
resources:
{{- toYaml .Values.operator.resources | nindent 12 }}
{{- if .Values.operator.securityContext }}
securityContext:
{{- toYaml .Values.operator.securityContext | nindent 12 }}
{{- end }}
{{- if .Values.operator.priorityClassName }}
priorityClassName: {{ .Values.operator.priorityClassName }}
{{- end }}
{{- if .Values.operator.podSecurityContext }}
securityContext:
{{- toYaml .Values.operator.podSecurityContext | nindent 8 }}
{{- end }}
serviceAccountName: {{ .Values.operator.name }}