Created
August 30, 2018 21:40
-
-
Save claudiobastos/15cfc58bd73c70a99552b7b9149b2b0f to your computer and use it in GitHub Desktop.
Google Cloud SQL Proxy Deployment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: extensions/v1beta1 | |
| kind: Deployment | |
| metadata: | |
| name: cloudsql | |
| spec: | |
| replicas: 1 | |
| strategy: | |
| type: Recreate | |
| template: | |
| metadata: | |
| labels: | |
| app: cloudsql | |
| tier: database | |
| env: production | |
| namespace: default | |
| spec: | |
| containers: | |
| - name: cloudsql | |
| image: gcr.io/cloudsql-docker/gce-proxy:latest | |
| ports: | |
| - containerPort: 3306 | |
| env: | |
| - name: PROJECT_NAME | |
| value: "your_project_name_here" | |
| - name: REGION_NAME | |
| value: "your_zone_here" | |
| - name: INSTANCE_NAME | |
| value: "your_instance_name" | |
| - name: CREDENTIALS_FILENAME | |
| value: "cloudsql-credential.json" | |
| command: ["/cloud_sql_proxy"] | |
| args: ["-instances=$(PROJECT_NAME):$(REGION_NAME):$(INSTANCE_NAME)=tcp:0.0.0.0:3306", "-credential_file=/config/$(CREDENTIALS_FILENAME)"] | |
| resources: {} | |
| volumeMounts: | |
| - mountPath: /config | |
| name: keys | |
| readOnly: true | |
| resources: {} | |
| restartPolicy: Always | |
| volumes: | |
| - name: keys | |
| secret: | |
| secretName: my-cloudsql-credential | |
| status: {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment