apiVersion: apps/v1
kind: Deployment
metadata:
  name: '{{ include "camaraaas-qod-provisioning-api-op-chart.fullname" . }}-deployment'
  namespace: {{ .Release.Namespace }}
  labels:
  {{- include "camaraaas-qod-provisioning-api-op-chart.labels" . | nindent 4 }}
spec:
  replicas: {{ .Values.operator.replicas }}
  selector:
    matchLabels:
      app: camaraaas-qod-provisioning-api-op
    {{- include "camaraaas-qod-provisioning-api-op-chart.selectorLabels" . | nindent 6 }}
  template:
    metadata:
      labels:
        app: camaraaas-qod-provisioning-api-op
      {{- include "camaraaas-qod-provisioning-api-op-chart.selectorLabels" . | nindent 8 }}
    spec:
      containers:
      - command:
        - python
        - k8s_operator.py
        env:
        - name: LOG_LEVEL
          value: {{ quote .Values.logLevel }}
        - name: CR_GROUP
          value:  {{ quote .Values.customResource.group }}
        - name: CR_VERSION
          value: {{ quote .Values.customResource.version }}
        - name: CR_PLURAL
          value: {{ quote .Values.customResource.plural }}
        - name: CAMARA_API_DOCKER_IMAGE
          value: {{ quote .Values.camaraQoDAPI.image }}
        - name: CAMARA_API_DOCKER_IMAGE_PORT
          value: {{ quote .Values.camaraQoDAPI.port }}
        - name: KUBERNETES_CLUSTER_DOMAIN
          value: {{ quote .Values.kubernetesClusterDomain }}
        image:  '{{ .Values.operator.image }}'
        name: camaraaas-qod-provisioning-api-op-container
        resources: {}
      restartPolicy: Always
      serviceAccountName: '{{ include "camaraaas-qod-provisioning-api-op-chart.fullname" . }}-svc-account'