apiVersion: apps/v1
kind: Deployment
metadata:
  name: clusterd
  namespace: mindx-dl
spec:
  replicas: 1
  selector:
    matchLabels:
      app: clusterd
  template:
    metadata:
      labels:
        app: clusterd
      ##### For Kubernetes versions lower than 1.19, seccomp is used with annotations.
      annotations:
        seccomp.security.alpha.kubernetes.io/pod: runtime/default
    spec:
      ##### For Kubernetes version 1.19 and above, seccomp is used with securityContext:seccompProfile
      securityContext:
        seccompProfile:
          type: RuntimeDefault
      nodeSelector:
        masterselector: dls-master-node
      serviceAccountName: clusterd
      containers:
        - name: clusterd
          image: "FILLED_BY_OPERATOR"
          resources:
            requests:
              memory: 1Gi
              cpu: 1000m
            limits:
              memory: 1Gi
              cpu: 1000m
          env:
            - name: NODE_NAME
              valueFrom:
                fieldRef:
                  fieldPath: spec.nodeName
            - name: POD_IP
              valueFrom:
                fieldRef:
                  fieldPath: status.podIP
          imagePullPolicy: Always
          command: [ "/bin/bash", "-c", "--"]
          args: [ "FILLED_BY_OPERATOR" ]
          securityContext:
            runAsUser: 0
            runAsGroup: 0
          volumeMounts:
            - name: log-clusterd
              mountPath: /var/log/mindx-dl/clusterd
            - name: config-clusterd
              mountPath: /user1/mindx-dl/clusterd
            - name: localtime
              mountPath: /etc/localtime
              readOnly: true
            - name: slownode
              mountPath: /user/slownode-cluster
      volumes:
        - name: log-clusterd
          hostPath:
            path: /var/log/mindx-dl/clusterd
            type: DirectoryOrCreate
        - name: localtime
          hostPath:
            path: /etc/localtime
        - name: config-clusterd
          hostPath:
            path: /user1/mindx-dl/clusterd
            type: DirectoryOrCreate
        - name: slownode
          hostPath:
            path: /user/slownode-cluster
            type: DirectoryOrCreate