apiVersion: v1
kind: ReplicationController
metadata:
  name: backend
spec:
  replicas: 3
  template:
    metadata:
      labels:
        app:  easy-mvc
        tier: backend
    spec:
      containers:
      - name: springboot
        image: gcr.io/YOUR_PROJECT_ID/springboot-app-gke
        env:
        - name: CLOUDSQL_MYSQL_HOST
          valueFrom:
            configMapKeyRef:
              name: app-config
              key: db.host
        - name: CLOUDSQL_MYSQL_USER
          valueFrom:
            secretKeyRef:
              name: easy-mvc-secret
              key: mysql_username
        - name: CLOUDSQL_MYSQL_PASSWORD
          valueFrom:
            secretKeyRef:
              name: easy-mvc-secret
              key: mysql_password
        resources:
          requests:
            cpu: 100m
            memory: 100Mi
        ports:
        - containerPort: 8080