Remember what started us down the path of managing a kubernetes cluster in the first place? No, it wasn't our own sadistic desire to to devops in an effort to avoid building an actual project, but close. We want to be able to leverage 'live view' in our project, that requires websockets, which all signs pointed to not available on appengine. But wait, what's this? App-Enggine WebSocket Support As of Feb 2019, it looks like we're good to go. That coupled with the $30/month bill we would incur when our gcp credits ran out, this switch seems to make a lot of sense.
Tearing down services
kubectl delete service postit-web
gcloud compute forwarding-rules listuse this to check that the loadbalancer is also removed
gcloud container clusters delete --zone=us-central1-a postit-cluster
update KMS key/value on key for beta app. remember we tore everything down and needed to create a smaller db instance
mix ecto.create to instantiate new db and
we can see that the app in prod was able to connect and create the db by the right name in the gcp console.
so we’ve got a new connection name and db name. I left the others the same, so I didn’t have to create all new keys for it.
env: flex runtime: gs://elixir-runtime/elixir.yaml runtime_config: release_app: postit beta_settings: cloud_sql_instances: [CONNECTION-DB]
and then just
gcloud app deploy
but wait - had to remove the dockerfile and the cloudbuild from the directory so it would run
mmmm, no env’s for database name or password?? grrrrr 😡
GenServer #PID<0.1713.0> terminating ** (RuntimeError) connect raised KeyError exception: key :database not found. The exception details are hidden, as they may contain sensitive data such as database credentials. You may set :show_sensitive_data_on_connection_error to true when starting your connection if you wish to see all of the details
So if we update the cloudbuild to publish the docker image we’ve been making to
app deploy instead of kubectl, then it will have all the compile time variables from KMS in it and run from the could build instead of locally, right?
update docker and cloudbuild to use the newest KMS key’s for database name and variables. printenv from the docker build to confirm.
do i need a custom start command?
enable App Engine Admin API 🤦♀️ you’d think i’d know that by now
change the sql directory to
/cloudsql/[CONNECTION_NAME] that’s just removing the
tmp/ from our KMS. Which i can just update and replace the base64 string in the cloudbuild file. so that’s rad.
At this point. For someone who is pretty vocal about not liking the devops side of things, you sure spend a lot of time working on those details.
git pushthat for me is the only sure fire way I will have a current release out there for me to play with on my phone.
Ok where’d we leave off?
And what’d we get for all that effort?