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.
Clean upupdate KMS key/value on key for beta app. remember we tore everything down and needed to create a smaller db instance
run mix ecto.create to instantiate new db and mix ecto.migrate
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.
Create app.yaml file
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 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 detailsSo 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.
Ok where’d we leave off?
And what’d we get for all that effort?
Follow
Podchaser is the ultimate destination for podcast data, search, and discovery. Learn More