# Source: mongodb-atlas-operator/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mongodb-atlas-operator
  labels:
    helm.sh/chart: mongodb-atlas-operator-0.2.2
    app.kubernetes.io/name: mongodb-atlas-operator
    app.kubernetes.io/instance: mongodb-atlas-operator
    app.kubernetes.io/version: "0.5.0"
    app.kubernetes.io/managed-by: Helm
    gitops.jenkins-x.io/pipeline: 'namespaces'
  annotations:
    meta.helm.sh/release-name: 'mongodb-atlas-operator'
    wave.pusher.com/update-on-config-change: 'true'
  namespace: atlas-operator
spec:
  selector:
    matchLabels:
      app.kubernetes.io/name: mongodb-atlas-operator
      app.kubernetes.io/instance: mongodb-atlas-operator
  replicas: 1
  template:
    metadata:
      labels:
        app.kubernetes.io/name: mongodb-atlas-operator
        app.kubernetes.io/instance: mongodb-atlas-operator
    spec:
      serviceAccountName: mongodb-atlas-operator
      securityContext:
        runAsNonRoot: true
        runAsUser: 2000
      terminationGracePeriodSeconds: 10
      containers:
        - args:
            - --secure-listen-address=0.0.0.0:8443
            - --upstream=http://127.0.0.1:8080/
            - --logtostderr=true
            - --v=10
          image: gcr.io/kubebuilder/kube-rbac-proxy:v0.8.0
          name: kube-rbac-proxy
          ports:
            - containerPort: 8443
              name: https
          securityContext:
            allowPrivilegeEscalation: false
        - name: manager
          args:
            - --atlas-domain=https://cloud.mongodb.com
            - --health-probe-bind-address=:8081
            - --metrics-bind-address=127.0.0.1:8080
            - --leader-elect
          command:
            - /manager
          securityContext:
            allowPrivilegeEscalation: false
          image: "mongodb/mongodb-atlas-kubernetes-operator:0.5.0"
          imagePullPolicy: Always
          env:
            - name: OPERATOR_POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
          ports:
            - name: http
              containerPort: 80
              protocol: TCP
          livenessProbe:
            httpGet:
              path: /healthz
              port: 8081
            initialDelaySeconds: 15
            periodSeconds: 20
          readinessProbe:
            httpGet:
              path: /readyz
              port: 8081
            initialDelaySeconds: 5
            periodSeconds: 10
          resources:
            limits:
              cpu: 500m
              memory: 256Mi
            requests:
              cpu: 100m
              memory: 50Mi
