apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    field.cattle.io/creatorId: user-gpcv5
  labels:
    cattle.io/creator: norman
    workload.user.cattle.io/workloadselector: deployment-artemis-artemis
  name: artemis
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      workload.user.cattle.io/workloadselector: deployment-artemis-artemis
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
    type: RollingUpdate
  template:
    metadata:
      labels:
        workload.user.cattle.io/workloadselector: deployment-artemis-artemis
    spec:
      containers:
      - envFrom:
        - configMapRef:
            name: artemis-app
            optional: false
        - secretRef:
            name: artemis-secrets
        image: <DockerId>/artemis
        imagePullPolicy: Always
        name: artemis
        ports:
        - containerPort: 8080
          name: 8080tcp02
          protocol: TCP
        resources: {}
        securityContext:
          allowPrivilegeEscalation: false
          capabilities: {}
          privileged: false
          readOnlyRootFilesystem: false
          runAsNonRoot: false
        stdin: true
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        tty: true
        volumeMounts:
        - mountPath: /artemisdata/
          name: artemis
      dnsPolicy: ClusterFirst
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30
      initContainers:
        - name: init-ds
          image: busybox:latest
          command:
              - '/bin/sh'
              - '-c'
              - |
                  while true
                  do
                    rt=$(nc -z -w 1 artemis-mysql 3306)
                    if [ $? -eq 0 ]; then
                      echo "DB is UP"
                      break
                    fi
                    echo "DB is not yet reachable;sleep for 10s before retry"
                    sleep 10
                  done
      volumes:
      - name: artemis
        persistentVolumeClaim:
          claimName: artemis
