apiVersion: apps/v1
kind: Deployment
metadata:
  name: mariadb-operator
  labels:
    helm.sh/chart: mariadb-operator-25.10.4
    app.kubernetes.io/name: mariadb-operator
    app.kubernetes.io/instance: mariadb-operator
    app.kubernetes.io/version: "25.10.4"
    app.kubernetes.io/managed-by: Helm
spec:
  replicas: 3
  selector:
    matchLabels:
      app.kubernetes.io/name: mariadb-operator
      app.kubernetes.io/instance: mariadb-operator
  template:
    metadata:
      labels:
        app.kubernetes.io/name: mariadb-operator
        app.kubernetes.io/instance: mariadb-operator
    spec:
      serviceAccountName: mariadb-operator
      automountServiceAccountToken: true
      terminationGracePeriodSeconds: 10
      containers:
        - image: "docker-registry3.mariadb.com/mariadb-operator/mariadb-operator:25.10.4"
          imagePullPolicy: IfNotPresent
          name: controller
          args:
            - --metrics-addr=:8080
            - --log-level=INFO
            - --leader-elect
          ports:
            - containerPort: 8080
              protocol: TCP
              name: metrics
          envFrom:
            - configMapRef:
                name: mariadb-operator-env
          env:
            - name: CLUSTER_NAME
              value: cluster.local
            - name: MARIADB_OPERATOR_NAME
              valueFrom:
                fieldRef:
                  fieldPath: spec.serviceAccountName
            - name: MARIADB_OPERATOR_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
            - name: MARIADB_OPERATOR_SA_PATH
              value: /var/run/secrets/kubernetes.io/serviceaccount/token
