I have been manually deploying new pods with GKE for the past three years. Once done, I then configure Cloud Build for my CI/CD to deploy to GKE once the image is created, etc.
For the CD from CloudBuild, I use:
# GKE run deploy
- name: "gcr.io/cloud-builders/gke-deploy"
args:
...
However, this year I keep getting an error with this process, because now GKE add a selector:
selector:
matchLabels:
app: healthcheck
app.kubernetes.io/managed-by: cloud-console <- this one
environment: development
The conflict is that the CD cloud-builders/gke-deploy has its own selector. However, selectors are immutable, so my CD process cannot complete.
Because there are a few setups required and I prefer to do it manually, my current process involves saving the YAML generated by GKE, deleting the pod once the configuration, etc., has been set up, and then letting Cloud Build regenerate the pod after fetching the previously saved YAML.
But this is tedious. I am currently unable to find alternatives. I would love to hear about a different approach.