75 lines
2.6 KiB
YAML
75 lines
2.6 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: 1
|
|
selector:
|
|
matchLabels:
|
|
name: {{ .Values.operator.name }}
|
|
strategy:
|
|
rollingUpdate:
|
|
maxUnavailable: 1
|
|
type: RollingUpdate
|
|
template:
|
|
metadata:
|
|
labels:
|
|
name: {{ .Values.operator.name }}
|
|
spec:
|
|
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 }}
|
|
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 }}
|
|
securityContext:
|
|
readOnlyRootFilesystem: true
|
|
runAsUser: 2000
|
|
serviceAccountName: {{ .Values.operator.name }}
|