apiVersion: apps/v1
kind: Deployment
metadata:
  name: registry-job-operator
  namespace: registry-system
  labels:
    control-plane: registry-job-operator
spec:
  selector:
    matchLabels:
      control-plane: registry-job-operator
  replicas: 1
  template:
    metadata:
      labels:
        control-plane: registry-job-operator
    spec:
      containers:
      - command:
        - /bin/dev/manager
        args:
        - --enable-leader-election
        image: tmaxcloudck/registry-job-operator:0.0.1-dev
        name: manager
        imagePullPolicy: Always
        env:
          - name: POD_NAME
            valueFrom:
              fieldRef:
                fieldPath: metadata.name
          - name: OPERATOR_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
          - name: OPERATOR_NAME
            value: "registry-operator"
          - name: TZ
            value: Asia/Seoul
          - name: KEYCLOAK_USERNAME
            valueFrom:
                secretKeyRef:
                  name: keycloak-secret
                  key: username
          - name: KEYCLOAK_PASSWORD
            valueFrom:
                secretKeyRef:
                  name: keycloak-secret
                  key: password
          - name: ENV
            value: "dev"
        volumeMounts:
        - name: manager-mnt
          mountPath: /bin/dev
        - name: operator-log-mnt
          mountPath: /var/log/registryjob-operator
        - name: registry-secret
          mountPath: /etc/ssl/certs/ca.crt
          subPath: ca.crt
      volumes:
      - name: manager-mnt
        hostPath:
          path: "/root/go/src/github.com/tmax-cloud/registry-operator/bin/registry-job-operator"
      - name: operator-log-mnt
        hostPath:
          path: "/root/go/src/github.com/tmax-cloud/registry-operator/logs/registry-job-operator"
      - name: registry-secret
        secret:
          secretName: registry-ca
      nodeSelector:
        kubernetes.io/hostname: node1
      terminationGracePeriodSeconds: 10
