apiVersion: apps/v1
kind: Deployment
metadata:
  name: cake-operator
  labels:
    app: cake-operator
spec:
  # we always run a single replica of the operator to avoid duplicate handling of events
  replicas: 1 
  strategy:
    # during an upgrade the operator will shut down before the new 
    # version comes up to prevent two instances running at the same time
    type: Recreate 
  selector:
    matchLabels:
      app: cake-operator
  template:
    metadata:
      labels:
        app: cake-operator
    spec:
      serviceAccountName: cake-operator
      containers:
        - name: cake-operator
          image: quay.io/fvaleri/cake-operator:latest
          imagePullPolicy: Always
          ports:
            - name: http
              containerPort: 8080
          #env:
          #readinessProbe:
          #livenessProbe:
          resources:
            limits:
              cpu: 200m
              memory: 200Mi
            requests:
              cpu: 100m
              memory: 100Mi
