apiVersion: apps/v1
kind: Deployment
metadata:
  name: myapp-deployment
  labels:
    name: myapp-deployment
spec:
  replicas: 1
  selector:
    matchLabels:
      app: myapp-deployment
  template:
    metadata:
      labels:
        app: myapp-deployment
    spec:
      containers:
      - name: myapp-deployment
        image: aishy/java
        ports:
        - containerPort: 8080

      - name: mysql
        image: mysql:5.7
        env:
        - name: MYSQL_ROOT_PASSWORD
          valueFrom:
            configMapKeyRef:
              name: DB-conf
              key: MYSQL_ROOT_PASSWORD
        - name: MYSQL_ALLOW_EMPTY_PASSWORD
          valueFrom:
            configMapKeyRef:
              name: DB-conf
              key: MYSQL_ALLOW_EMPTY_PASSWORD
        - name: MYSQL_USER
          valueFrom:
            configMapKeyRef:
              name: DB-conf
              key: MYSQL_USER
        - name: MYSQL_PASSWORD
          valueFrom:
            configMapKeyRef:
              name: DB-conf
              key: MYSQL_PASSWORD
        - name: MYSQL_DATABASE
          valueFrom:
            configMapKeyRef:
              name: DB-conf
              key: MYSQL_DATABASE
        ports:
        - containerPort: 3306
          

      
  
    
