apiVersion: apps/v1
kind: Deployment
metadata:
  name: osgi-config-deployment-demo
spec:
  replicas: 1
  selector:
    matchLabels:
      app: osgi-config
  revisionHistoryLimit: 5
  progressDeadlineSeconds: 300
  minReadySeconds: 10
  template:
    metadata:
      labels:
        app: osgi-config
    spec:
      containers:
        - name: osgi-configmap-demo-pod-demo
          image: rotty3000/config-osgi-k8s-demo:0.3.0
          ## Set `imagePullPolicy` to `Never` when images only exist locally
          #imagePullPolicy: Never
          resources:
            limits:
              cpu: "250m"
              memory: "128Mi"
          env:
            # Define an environment variable
            # Enable DEBUGGING
            - name: JAVA_OPTS
              value: "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=*:8000"
          volumeMounts:
          - name: osgi-config         # Mount the volume with this name
            mountPath: "/app/configs" # Mount it this path
            readOnly: true
          - name: logback-config
            mountPath: "/app/log"
            readOnly: true
      volumes:
        # You set volumes at the Pod level, then mount them into containers inside that Pod
        - name: osgi-config
          configMap:
            # Provide the name of the ConfigMap you want to mount.
            name: osgi-configmap-demo
        - name: logback-config
          configMap:
            name: logback-configmap-demo
