apiVersion: apps/v1
kind: Deployment
metadata:
  name: myapp
  namespace: dev-to
  labels:
    app: myapp
spec:
  replicas: 1
  selector:
    matchLabels:
      app: myapp
  template:
      metadata:
        labels:
          app: myapp
      spec:
        containers:
          - name: myapp
            image: java-k8s:latest
            imagePullPolicy: Never
            ports:
              - containerPort: 8080
                name: http
            envFrom:
              - configMapRef:
                  name: myapp
            livenessProbe:
              httpGet:
                path: /health
                port: 8080
              initialDelaySeconds: 60
              periodSeconds: 5

