apiVersion: apps/v1
kind: Deployment
metadata:
  name: hello-k8s-deploy
  labels:
    app: spring-k8s
spec:
  replicas: 1
  selector:
    matchLabels:
      app: spring-k8s
  template:
    metadata:
      labels:
        app: spring-k8s
    spec:
      containers:
      - name: hello-k8s-container
        image: habuma/hello-world:latest
        env:
        - name: SPRING_CONFIG_IMPORT
          value: "configtree:/etc/config/"
        livenessProbe:
          initialDelaySeconds: 2
          periodSeconds: 5
          httpGet:
            path: /actuator/health/liveness
            port: 8080
        readinessProbe:
          initialDelaySeconds: 2
          periodSeconds: 5
          httpGet:
            path: /actuator/health/readiness
            port: 8080
        volumeMounts:
        - name: hello-config
          mountPath: /etc/config/
      volumes:
      - name: hello-config
        configMap: 
          name: hello-config
          
        
#---
#apiVersion: v1
#kind: Service
#metadata:
#  name: hello-svc
#  labels:
#    app: spring-k8s
#spec:
#  type: NodePort
#  ports:
#  - port: 31234
#    nodePort: 30123
#    targetPort: 8080
#    protocol: TCP
#    name: http
#  selector:
#    app: spring-k8s
