apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    app: hello-world-cicd
  name: hello-world-cicd
spec:
  replicas: 1
  selector:
    matchLabels:
      app: hello-world-cicd
  template:
    metadata:
      labels:
        app: hello-world-cicd
    spec:
      containers:
        - image: hello-world-cicd
          name: hello-world-cicd
          ports:
            - name: http
              containerPort: 8080
          env:
            - name: DB_USERNAME
              valueFrom:
                secretKeyRef:
                  name: db-secret
                  key: db_username
            - name: DB_PASSWORD
              valueFrom:
                secretKeyRef:
                  name: db-secret
                  key: db_password
            - name: DB_HOST
              valueFrom:
                configMapKeyRef:
                  name: config-db
                  key: db_host
            - name: DB_NAME
              valueFrom:
                configMapKeyRef:
                  name: config-db
                  key: db_name
      imagePullSecrets:
        - name: registry-esys
