apiVersion: apps/v1
kind: Deployment
metadata:
  name: hello
  labels:
    app: hello
spec:
  replicas: 3
  selector:
    matchLabels:
      app: hello
  template:
    metadata:
      labels:
        app: hello
    spec:
      containers:
      - name: hello
        image: cy4n/hello:0.0.5
        ports:
        - containerPort: 8080
        livenessProbe:
          httpGet:
            path: /actuator/health
            port: 8080
          initialDelaySeconds: 20
        readinessProbe:
          httpGet:
            path: /actuator/health
            port: 8080
          initialDelaySeconds: 20
        volumeMounts:
        - name: helloproperties
          mountPath: /app/config
          readOnly: true
        env:
        - name: SPRING_SECURITY_USER_NAME
          valueFrom:
            secretKeyRef:
              name: management-user
              key: user
        - name: SPRING_SECURITY_USER_PASSWORD
          valueFrom:
            secretKeyRef:
              name: management-user
              key: password
      volumes:
      - name: helloproperties
        configMap:
          name: helloproperties
