apiVersion: apps/v1
kind: Deployment
metadata:
  name: chaosblade-operator
  namespace: kube-system
spec:
  replicas: 1
  selector:
    matchLabels:
      name: chaosblade-operator
  template:
    metadata:
      labels:
        name: chaosblade-operator
    spec:
      serviceAccountName: chaosblade
      containers:
        - name: chaosblade-operator
          # Replace this with the built image name
          image: chaosbladeio/chaosblade-operator:0.6.0
          command: ["chaosblade-operator"]
          args:
            - --chaosblade-version=0.6.0
            - --chaosblade-image-repository=chaosbladeio/chaosblade-tool
            - --chaosblade-image-pull-policy=IfNotPresent
            - --chaosblade-namespace=kube-system
            - --webhook-enable
          imagePullPolicy: IfNotPresent
          env:
            - name: WATCH_NAMESPACE
              value: ""
            - name: POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: OPERATOR_NAME
              value: "chaosblade-operator"
          ports:
            - containerPort: 9443
              protocol: TCP
          volumeMounts:
            - mountPath: /tmp/k8s-webhook-server/serving-certs
              name: cert
              readOnly: true
      volumes:
        - name: cert
          secret:
            defaultMode: 420
            secretName: chaosblade-webhook-server-cert