Skip to content

Instantly share code, notes, and snippets.

@brandentimm
Last active February 1, 2019 17:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brandentimm/b6d68dbad58bb1425d2a5123c6cea32f to your computer and use it in GitHub Desktop.
Save brandentimm/b6d68dbad58bb1425d2a5123c6cea32f to your computer and use it in GitHub Desktop.
CloudSQL Proxy deployment
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: cloudsql-proxy
spec:
replicas: 1
selector:
matchLabels:
app: cloudsql-proxy
template:
metadata:
labels:
app: cloudsql-proxy
spec:
securityContext:
runAsUser: 2
allowPrivilegeEscalation: false
containers:
- name: cloudsql-proxy
image: gcr.io/cloudsql-docker/gce-proxy:1.12
command: [
"/cloud_sql_proxy",
"-instances=my-project:my-region:my-instance=tcp:3306",
"-credential_file=/secrets/cloudsql/credentials.json"
]
volumeMounts:
- name: cloudsql-credentials
mountPath: /secrets/cloudsql
readOnly: true
resources:
requests:
cpu: 5m
memory: 16M
limits:
cpu: 500m
memory: 64M
volumes:
- name: cloudsql-credentials
secret:
secretName: cloudsql-credentials
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment