apiVersion: apps/v1
kind: Deployment
metadata:
  name: cloudsql-proxy
spec:
  selector:
    matchLabels:
      app: cloudsql-proxy
  replicas: 1
  template:
    metadata:
      labels:
        app: cloudsql-proxy
    spec:
      containers:
      - name: cloudsql-proxy
        image: gcr.io/cloudsql-docker/gce-proxy:1.11
        command: ["/cloud_sql_proxy", "-instances=dd-decaf-cfbf6:europe-west1:dd-decaf=tcp:0.0.0.0:5432", "-credential_file=/secrets/cloudsql/credentials.json"]
        resources:
          requests:
            cpu: "1m"
          limits:
            cpu: "2000m"
        volumeMounts:
          - name: cloudsql-instance-credentials
            mountPath: /secrets/cloudsql
            readOnly: true
      volumes:
        - name: cloudsql-instance-credentials
          secret:
            secretName: cloudsql-instance-credentials
