apiVersion: apps/v1
kind: Deployment
metadata:
  name: cue-controller
  labels:
    app: cue-controller
spec:
  selector:
    matchLabels:
      app: cue-controller
  replicas: 1
  template:
    metadata:
      annotations:
        kubectl.kubernetes.io/default-container: manager
      labels:
        app: cue-controller
    spec:
      serviceAccountName: cue-controller
      securityContext:
        runAsNonRoot: true
      containers:
      - args:
          - --watch-all-namespaces
          - --log-level=info
          - --log-encoding=json
          - --enable-leader-election
        name: manager
        image: phoban01/cue-controller:latest
        env:
        - name: RUNTIME_NAMESPACE
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.namespace
        ports:
          - containerPort: 8080
            name: http-prom
            protocol: TCP
          - containerPort: 9440
            name: healthz
            protocol: TCP
        readinessProbe:
          httpGet:
            path: /readyz
            port: healthz
        livenessProbe:
          httpGet:
            path: /healthz
            port: healthz
        resources:
          limits:
            cpu: "1"
            memory: 1Gi
          requests:
            cpu: 100m
            memory: 64Mi
        securityContext:
          allowPrivilegeEscalation: false
      terminationGracePeriodSeconds: 10
