--- apiVersion: v1 kind: Service metadata: name: mysql spec: ports: - port: 3306 protocol: TCP targetPort: 3306 selector: run: mysql status: loadBalancer: {} --- --- apiVersion: apps/v1 kind: Deployment metadata: labels: run: mysql name: mysql spec: replicas: 1 selector: matchLabels: run: mysql strategy: {} template: metadata: labels: run: mysql spec: containers: - env: - name: MYSQL_ROOT_PASSWORD value: password123 image: mysql name: mysql ports: - containerPort: 3306 resources: limits: cpu: 100m memory: 512Mi requests: cpu: 75m memory: 512Mi status: {} --- apiVersion: v1 kind: Service metadata: name: webapp spec: ports: - port: 8080 protocol: TCP targetPort: 8080 selector: run: webapp status: loadBalancer: {} --- --- apiVersion: apps/v1 kind: Deployment metadata: labels: run: webapp name: webapp spec: replicas: 1 selector: matchLabels: run: webapp strategy: {} template: metadata: labels: run: webapp spec: containers: - envFrom: - secretRef: name: db-secret image: kodekloud/simple-webapp-mysql name: webapp ports: - containerPort: 8080 resources: limits: cpu: 100m memory: 100Mi requests: cpu: 50m memory: 50Mi status: {} --- apiVersion: v1 data: DB_Host: bXlzcWw= DB_Password: cGFzc3dvcmQxMjM= DB_User: cm9vdA== kind: Secret metadata: name: db-secret namespace: default