apiVersion: apps/v1
kind: Deployment
metadata:
  name: example-service
spec:
  selector:
    matchLabels:
      app: example-service
  replicas: 2
  template:
    metadata:
      labels:
        app: example-service
        app.kubernetes.io/instance: example-service-1337
    spec:
      containers:
        - name: example-service
          image: micronaut-kubernetes-example-service
          imagePullPolicy: "Never"
          volumeMounts:
            - name: secrets
              mountPath: /etc/example-service/secrets
              readOnly: true
            - name: configmap
              mountPath: /etc/example-service/configmap
              readOnly: true
          ports:
            - name: http
              containerPort: 8081
            - name: "jvm-debug"
              containerPort: 5004
          livenessProbe:
            httpGet:
              port: 8081
              path: /health/liveness
            initialDelaySeconds: 2
            periodSeconds: 3
            failureThreshold: 10
          readinessProbe:
            httpGet:
              port: 8081
              path: /health/readiness
            initialDelaySeconds: 2
            periodSeconds: 3
            failureThreshold: 10
      volumes:
        - name: secrets
          secret:
            secretName: mounted-secret
            defaultMode: 256
        - name: configmap
          configMap:
            name: mounted-configmap
