apiVersion: apps/v1
kind: Deployment
metadata:
  name: kraan-controller
  namespace: kraan
  labels:
    control-plane: controller
spec:
  selector:
    matchLabels:
      app: kraan-controller
  replicas: 1
  template:
    metadata:
      labels:
        app: kraan-controller
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/port: "9090"
    spec:
      terminationGracePeriodSeconds: 10
      containers:
      - name: manager
        image: docker.pkg.github.com/fidelity/kraan/kraan-controller:master
        imagePullPolicy: Always
        securityContext:
          allowPrivilegeEscalation: false
          readOnlyRootFilesystem: true
        args:
        - --enable-leader-election
        - --zap-log-level=99
        - --zap-encoder=json
        env:
          - name: DATA_PATH
            value: /controller/data
          - name: RUNTIME_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.namespace
        ports:
        - containerPort: 9440
          name: healthz
          protocol: TCP
        readinessProbe:
          httpGet:
            path: /readyz
            port: healthz
          initialDelaySeconds: 10
          periodSeconds: 10
          failureThreshold: 5
          timeoutSeconds: 15
        livenessProbe:
          httpGet:
            path: /healthz
            port: healthz
          initialDelaySeconds: 10
          periodSeconds: 10
          failureThreshold: 5
          timeoutSeconds: 15
        resources:
          limits:
            cpu: 1000m
            memory: 1Gi
          requests:
            cpu: 500m
            memory: 128Mi

