apiVersion: apps/v1
kind: Deployment
metadata:
  labels:
    io.kompose.group: todo-web-application
    io.kompose.service: todo-web-application
  name: todo-web-application
spec:
  replicas: 1
  selector:
    matchLabels:
      io.kompose.group: todo-web-application
      io.kompose.service: todo-web-application
  template:
    metadata:
      labels:
        io.kompose.group: todo-web-application
        io.kompose.service: todo-web-application
    spec:
      restartPolicy: Always
      containers:
      - env:
        - name: RDS_DB_NAME
          valueFrom: 
            configMapKeyRef: 
              name: todo-web-application-config
              key: RDS_DB_NAME
        - name: RDS_HOSTNAME
          valueFrom: 
            configMapKeyRef: 
              name: todo-web-application-config
              key: RDS_HOSTNAME
        - name: RDS_PORT
          valueFrom: 
            configMapKeyRef: 
              name: todo-web-application-config
              key: RDS_PORT
        - name: RDS_PASSWORD
          valueFrom: 
            secretKeyRef:
              name: todo-web-application-secrets 
              key: RDS_PASSWORD
        - name: RDS_USERNAME
          value: todos-user
        image: in28min/todo-web-application-mysql:0.0.1-SNAPSHOT
        name: todo-web-application
        ports:
        - containerPort: 8080
