Skip to content

Fix GKE#80

Merged
mclasmeier merged 5 commits into
mainfrom
mc/gke-fix-2
Apr 8, 2026
Merged

Fix GKE#80
mclasmeier merged 5 commits into
mainfrom
mc/gke-fix-2

Conversation

@mclasmeier
Copy link
Copy Markdown
Collaborator

@mclasmeier mclasmeier commented Apr 7, 2026

I finally wanted to fix deployments to GKE when using containerized roxie.

I figured out it fails due to two distinct problems:

  1. The installation of the gcloud SDK was broken due to an architecture mismatch. This is fixed by moving the gcloud install step to the runtime stage.
  2. roxie kept failing during initialization, I don't completely understand why, but my testing has shown that when doing something like
podman run --rm -v $KUBECONFIG:/kubeconfig:U -v $HOME/.config/gcloud:/.config/gcloud:U localhost/roxie:latest env

it kept failing -- the initial attempt to use the GKE auth plugin failed because it was lacking write permissions to some files (several!) in ~/.config/gcloud, even though I instructed ownership translation using the :U mount flag. Hypothesis: there is likely to be some kind of race caused by the container starting up even though the file permissions in ~/.config/gcloud are not really effective immediately during container startup. I have verified that adding a dumb delay mitigates this. So, this PR also contains a simply retry mechanism for the initialization, which seems to do the trick. See:

❮ podman run --rm -v $KUBECONFIG:/kubeconfig:U -v $HOME/.config/gcloud:/.config/gcloud:U localhost/roxie:latest env 
00:00 Running containerized.
00:00 Using kubeconfig /kubeconfig
00:00 Attempt 1/3 failed: failed to retrieve API resources: exit status 1, retrying...
00:00 Using kubeconfig /kubeconfig
Roxie Environment Information:
==============================
Kube config:          /kubeconfig
Running in Container: true
Current Context:      gke_acs-team-temp-dev_us-central1-a_mc-04-08-unhappy-danger-soci
Cluster Type:         GKE

Comment thread internal/env/env.go
Comment thread internal/env/env.go Outdated
@mclasmeier mclasmeier requested a review from AlexVulaj April 8, 2026 07:36
@mclasmeier mclasmeier merged commit 59fc9c7 into main Apr 8, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants