Skip to content

Commit

Permalink
feat: add safe-to-evict pod annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
edosrecki committed Jan 31, 2022
1 parent 21898b1 commit 904fa26
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.adoc
Expand Up @@ -99,5 +99,7 @@ npx pkg <NODE_RANGE>-<PLATFORM>-<ARCH>
To deploy a new version of `google-cloud-sql` app, https://docs.github.com/en/actions/managing-workflow-runs/manually-running-a-workflow[manually run a "Continuous Deployment" worklow in GitHub Actions].

== Todo
* Add snap for Linux
* Add completions
* https://www.npmjs.com/package/update-notifier[Notify user] when new version of the app is available
* Cache user's running pods, and alert user on next startup if they were not cleaned up on previous app exit.
3 changes: 2 additions & 1 deletion src/lib/kubectl/pods.ts
Expand Up @@ -17,7 +17,8 @@ export const runCloudSqlProxyPod = (pod: CloudSqlProxyPod): string => {
--image=gcr.io/cloudsql-docker/gce-proxy \
--context="${pod.context}" \
--namespace="${pod.namespace}" \
--overrides='{"spec": {"serviceAccount": "${pod.serviceAccount}"}}' \
--serviceaccount="${pod.serviceAccount}" \
--annotations="cluster-autoscaler.kubernetes.io/safe-to-evict=true" \
--labels=app=google-cloud-sql \
${pod.name} \
-- /cloud_sql_proxy -ip_address_types=PRIVATE -instances=${pod.instance}=tcp:${pod.remotePort}
Expand Down

0 comments on commit 904fa26

Please sign in to comment.