#deployment
apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: testing-singletonXYZ
  name: testing-singleton
spec:
  replicas: 3
  selector:
    matchLabels:
     app: testing-singleton-label
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
    type: RollingUpdate

  template:
    metadata:
      labels:
        app: testing-singleton-label
        actorSystemName: testing-singleton
    spec:
      serviceAccountName: my-cluster 
      containers:    
      - name: testing-singleton
        image: franciscolopezsancho/clustering-singleton:0.1.0-SNAPSHOT
        # Remove for a real project, the image is picked up locally for the integratio test
        imagePullPolicy: Always
        #health
        livenessProbe:
          httpGet:
            path: /alive
            port: management
        readinessProbe:
          httpGet:
            path: /ready
            port: management
        #health
        ports:
        # akka-management bootstrap
        - name: management
          containerPort: 8558
          protocol: TCP
          # when contact-point-discovery.port-name is set for cluster bootstrap,
          # the management port must be named accordingly:
          # name: management
        env:
        # The Kubernetes API discovery will use this service name to look for
        # nodes with this value in the 'app' label.
        # This can be customized with the 'pod-label-selector' setting.
        - name: AKKA_CLUSTER_BOOTSTRAP_SERVICE_NAME
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: "metadata.labels['app']"