apiVersion: apps/v1
kind: Deployment
metadata:
  name: promena
  namespace: promena
  labels:
    app: promena
spec:
  replicas: 3
  selector:
    matchLabels:
      app: promena
  template:
    metadata:
      labels:
        app: promena
    spec:
      containers:
      - name: promena
        image: promena-file-http-kubernetes-executable:1.0.0
        env:
          - name: kubernetes.promena.label.app
            valueFrom:
              fieldRef:
                apiVersion: v1
                fieldPath: 'metadata.labels[''app'']'
          - name: kubernetes.promena.namespace
            valueFrom:
              fieldRef:
                apiVersion: v1
                fieldPath: metadata.namespace
          - name: kubernetes.promena.pod.ip
            valueFrom:
              fieldRef:
                apiVersion: v1
                fieldPath: status.podIP
          - name: communication.file.internal.directory.path
            value: /tmp/promena-communication
        ports:
          - containerPort: 8558
            name: management
            protocol: TCP
          - containerPort: 2552
            name: remoting
            protocol: TCP
        resources:
          limits:
            memory: 4Gi
        volumeMounts:
          - name: promena-communication
            mountPath: /tmp/promena-communication
        livenessProbe:
          httpGet:
            path: /alive
            port: management
            scheme: HTTP
          periodSeconds: 5
          initialDelaySeconds: 10
          timeoutSeconds: 2
        readinessProbe:
          httpGet:
            path: /ready
            port: management
            scheme: HTTP
          periodSeconds: 5
          initialDelaySeconds: 10
          timeoutSeconds: 2
      volumes:
        - name: promena-communication
          persistentVolumeClaim:
            claimName: promena-communication