---
name: &name autoneg-controller-manager

createNamespace: true

annotations:
  {}
  # annontated: true

labels:
  app: autoneg
  control-plane: controller-manager

securityContext:
  runAsNonRoot: true

# -- Autoscaling ranges, set minReplicas and maxReplicas if required
autoscaling: {}
#  minReplicas: 1
#  maxReplicas: 10

replicas: 1

serviceAccount:
  create: true
  name: autoneg-controller-manager
  annotations: {}

nodeSelector:
  iam.gke.io/gke-metadata-server-enabled: "true"

strategy:
  type: RollingUpdate
  rollingUpdate:
    maxUnavailable: 1

service:
  port: 8443

# containers

# kube-rbac-proxy is outdated and will be deprecated soon...
# https://github.com/kubernetes-sigs/kubebuilder/issues/3524#issuecomment-1687893746
kube_rbac_proxy:
  name: kube-rbac-proxy
  image: gcr.io/kubebuilder/kube-rbac-proxy:v0.16.0
  securityContext:
    allowPrivilegeEscalation: false
    privileged: false
    capabilities:
      drop:
        - ALL
    readOnlyRootFilesystem: true
    runAsUser: 65532
    runAsGroup: 65532
    runAsNonRoot: true
    seccompProfile:
      type: RuntimeDefault
  args:
    - --secure-listen-address=0.0.0.0:8443
    - --upstream=http://127.0.0.1:8080/
    - --logtostderr=true
    - --v=10
  port: 8443

gke_autoneg_controller:
  name: manager
  image: ghcr.io/googlecloudplatform/gke-autoneg-controller/gke-autoneg-controller:latest
  command:
    - /manager
  args:
    - --health-probe-bind-address=:8081
    - --metrics-bind-address=127.0.0.1:8080
    - --leader-elect
    - --zap-encoder=json
  securityContext:
    allowPrivilegeEscalation: false
    privileged: false
    capabilities:
      drop:
        - ALL
    readOnlyRootFilesystem: true
    runAsUser: 65532
    runAsGroup: 65532
    runAsNonRoot: true
    seccompProfile:
      type: RuntimeDefault
  livenessProbe:
    httpGet:
      path: /healthz
      port: 8081
    initialDelaySeconds: 15
    periodSeconds: 20
  readinessProbe:
    httpGet:
      path: /readyz
      port: 8081
    initialDelaySeconds: 5
    periodSeconds: 10
  resources:
    limits:
      cpu: 100m
      memory: 30Mi
    requests:
      cpu: 100m
      memory: 20Mi
