apiVersion: apps/v1
kind: Deployment
metadata:
  name: mangle
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mangle
  template:
    metadata:
      labels:
        app: mangle
        environment: test
    spec:
      volumes:
      - name: procdir
        hostPath:
          path: /proc
      - name: cgroups
        hostPath:
          path: /sys/fs/cgroup
      - name: mangle-logs
        emptyDir: {}
      containers:
      - name: mangle
        image: mangleuser/mangle:3.5.0
        livenessProbe:
         httpGet:
           path: "/mangle-services/application/health"
           port: 8443
           scheme: HTTPS
         initialDelaySeconds: 60
         periodSeconds: 60
        readinessProbe:
         httpGet:
           path: "/mangle-services/application/health"
           port: 8443
           scheme: HTTPS
         initialDelaySeconds: 60
         periodSeconds: 60
        ports:
        - containerPort: 8443
        - containerPort: 5701
        env:
        - name: POD_IP
          valueFrom:
           fieldRef:
            fieldPath: status.podIP
        - name: DB_OPTIONS
          value: "-DcassandraContactPoints=cassandra.mangle.svc.cluster.local -DcassandraSslEnabled=true -DcassandraUsername=cassandra -DcassandraPassword=cassandra -DcassandraClusterName=manglecassandracluster"
        - name: CLUSTER_OPTIONS
          value: "-DclusterValidationToken=mangle -DpublicAddress=$(POD_IP) -DclusterMembers=mangle-cluster-service.mangle.svc.cluster.local -DdeploymentMode=STANDALONE -DkubernetesMode=true"
        volumeMounts:
        - name: mangle-logs
          mountPath: /home/mangle/var/opt/mangle-tomcat/logs
        imagePullPolicy: Always
        resources:
          limits:
            cpu: "1000m"
            memory: "4000Mi"
      restartPolicy: Always
