apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: hello-kubernetes
spec:
  selector:
    matchLabels:
      app: hello-kubernetes
  serviceName: "hello-kubernetes-headless"
  replicas: 3
  podManagementPolicy: Parallel
  template:
    metadata:
      name: hello-kubernetes
      labels:
        app: hello-kubernetes
    spec:
      shareProcessNamespace: true
      containers:
        - name: hello-kubernetes
          image: shikanime/hello-kubernetes
          imagePullPolicy: Never
          ports:
            - containerPort: 4369
              name: epmd
            - containerPort: 49200
              name: dist
          env:
            - name: SERVICE_NAME
              value: hello-kubernetes-headless
            - name: RELEASE_DISTRIBUTION
              value: name
          resources:
            requests:
              memory: "250Mi"
              cpu: "500m"
            limits:
              memory: "1Gi"
              cpu: "2000m"
          volumeMounts:
            - name: config
              mountPath: /etc/hello_kubernetes
      volumes:
        - name: config
          configMap:
            name: hello-kubernetes
            items:
              - key: config.exs
                path: config.exs
