---
kind: StatefulSet
apiVersion: apps/v1
metadata:
  name: dc1-adm
spec:
  serviceName: "pod-dns"
  replicas: 1
  podManagementPolicy: "Parallel"
  updateStrategy:
    type: OnDelete
  selector:
    matchLabels:
      name: pod-dns
  template:
    metadata:
      labels:
        app: adm-app
        name: pod-dns
    spec:
      imagePullSecrets:
      - name: regcred
      containers:
      - name: adm-container
        # The image must be available on each K8s Worker
        # Either make this image avalable on every K8s worker node
        # Or host the images on a private repository and update this entry accordingly
        image: ffeldhaus/storagegrid-11.2.0:Admin_Node
        resources:
          limits:
            cpu: 4
            memory: 12Gi
        ports:
        - name: gmi-https
          containerPort: 443
        securityContext:
          capabilities:
            add: [NET_ADMIN, SYS_ADMIN, SYS_TIME, NET_BIND_SERVICE, SETGID, SETUID, DAC_READ_SEARCH, SYS_RESOURCE, SYSLOG, SYS_PTRACE]
        env:
        - name: SG_CONTAINER_TYPE
          value: Kubernetes
        - name: ADMIN_ROLE
          value: Primary
        - name: NODE_NAME
          valueFrom:
            fieldRef:
              fieldPath: metadata.name
        volumeMounts:
        - mountPath: "/var/local"
          name: var-local
        - mountPath: "/var/local/mysql_ibdata"
          name: mysql
        - mountPath: "/var/local/audit/export"
          name: audit
  volumeClaimTemplates:
  # These are mapped using the namespace and StatefullSet ID
  - metadata:
      name: var-local
  - metadata:
      name: mysql
  - metadata:
      name: audit
