apiVersion: apps/v1
kind: Deployment
metadata:
  name: scylla-operator
  namespace: scylla-operator
  labels:
    app.kubernetes.io/name: scylla-operator
    app.kubernetes.io/instance: scylla-operator
spec:
  replicas: 2
  strategy:
    type: RollingUpdate
  selector:
    matchLabels:
      app.kubernetes.io/name: scylla-operator
      app.kubernetes.io/instance: scylla-operator
  template:
    metadata:
      labels:
        app.kubernetes.io/name: scylla-operator
        app.kubernetes.io/instance: scylla-operator
    spec:
      serviceAccountName: scylla-operator
      containers:
      - name: scylla-operator
        image: docker.io/scylladb/scylla-operator:latest
        imagePullPolicy: IfNotPresent
        env:
        - name: SCYLLA_OPERATOR_IMAGE
          value: docker.io/scylladb/scylla-operator:latest
        args:
        - operator
        - --loglevel=2
        resources:
          requests:
            cpu: 10m
            memory: 20Mi
      terminationGracePeriodSeconds: 10
      affinity:
        podAntiAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
          - podAffinityTerm:
              labelSelector:
                matchLabels:
                  app.kubernetes.io/instance: webhook-server
                  app.kubernetes.io/name: webhook-server
              topologyKey: kubernetes.io/hostname
            weight: 1
