Skip to content

feat: install krew + kubectl oidc-login plugin#497

Merged
venkatamutyala merged 4 commits into
mainfrom
feat/krew-oidc-login
Jun 18, 2026
Merged

feat: install krew + kubectl oidc-login plugin#497
venkatamutyala merged 4 commits into
mainfrom
feat/krew-oidc-login

Conversation

@venkatamutyala

Copy link
Copy Markdown
Contributor

Summary

  • Installs krew (the kubectl plugin manager) and pre-installs the oidc-login plugin so users can authenticate to GlueOps clusters via OIDC without any manual setup.
  • Matches the steps in our developer docs (kubectl krew install oidc-login, $HOME/.krew/bin on PATH) — but now those steps are baked into the image.

Changes

  • New VERSION_KREW ARG, renovate-tracked from kubernetes-sigs/krew.
  • krew installs into $HOME/.krew as the vscode user, then kubectl krew install oidc-login runs.
  • Build fails fast if either kubectl krew version or kubectl oidc-login --help does not succeed.
  • $HOME/.krew/bin appended to PATH in /home/vscode/.zshrc.

Test plan

  • Build the image (docker build -t test .devcontainer/) and confirm both kubectl krew version and kubectl oidc-login --help succeed during build.
  • Launch a codespace from a pre-release tag (!vm in #testing-developer-workspaces) and verify kubectl krew list shows oidc-login without any user action.
  • In the same codespace, run kubectl oidc-login --help to confirm the plugin resolves through $HOME/.krew/bin on PATH.
  • Walk through the GlueOps docs flow (Access Your Cluster with kubectl) end to end and confirm the sign-in works.

Companion docs: GlueOps/glueops-dev#482 — Reader Plus tier, also referencing this same krew/oidc-login flow.

🤖 Generated with Claude Code

Adds the kubectl plugin manager (krew) and pre-installs the oidc-login
plugin so users can sign in to GlueOps clusters via OIDC the way the
developer docs describe (kubectl krew install oidc-login + $HOME/.krew/bin
on PATH) without any manual setup.

- New ARG VERSION_KREW renovate-tracked from kubernetes-sigs/krew.
- krew installs to $HOME/.krew as the vscode user; oidc-login is then
  installed via krew per the canonical instructions.
- Build fails fast if either kubectl krew version or kubectl oidc-login
  --help does not succeed.
- $HOME/.krew/bin appended to PATH in /home/vscode/.zshrc so kubectl
  finds plugins without any user-side configuration.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 18, 2026 10:13
Switches from "kubectl krew install oidc-login" (which pulls whatever the
krew-index has at build time) to "--manifest-url" against a specific
krew-index commit SHA. The pinned manifest itself fixes the upstream
kubelogin binary version and sha256, so two builds of the same Docker tag
now resolve to byte-identical oidc-login binaries.

Bump instructions are inlined as a comment above the ARG.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds krew (kubectl plugin manager) and pre-installs the oidc-login plugin into the devcontainer image so developers can authenticate to clusters via OIDC without manual setup.

Changes:

  • Introduces a renovate-tracked VERSION_KREW build arg and installs krew under the vscode user’s home.
  • Installs the oidc-login plugin during build and validates installation by running kubectl krew version and kubectl oidc-login --help.
  • Updates /home/vscode/.zshrc PATH export to include $HOME/.krew/bin.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .devcontainer/Dockerfile
Krew-index has no tags or releases, so the SHA pin was not renovate-trackable
without a custom regex manager. Per discussion, going with "kubectl krew
install oidc-login" against latest in the index instead. krew itself
sha256-verifies the downloaded binary against the manifest, so transport
integrity still holds. Versions will drift on rebuilds, which is acceptable
for a developer codespace.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 18, 2026 10:21

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread .devcontainer/Dockerfile
Two hardening tweaks surfaced by adversarial review:

1. PATH coverage: kubeconfig "exec:" plugins (the oidc-login auth flow)
   inherit PATH from whichever process spawned kubectl. If that process
   is not an interactive zsh shell, the prior .zshrc-only PATH update
   wouldn't reach the plugin. Now:
   - ENV PATH at the container level so every spawned process (including
     non-interactive scripts and CI) sees $HOME/.krew/bin.
   - Same export also tee'd into .bashrc for parity with .zshrc.
2. ~/.kube directory created with mode 0700 instead of the default 0755
   so directory listings can't leak cluster/issuer names to other UIDs
   inside the container. kubelogin's own cache files are already 0600.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@venkatamutyala venkatamutyala merged commit 71a5bda into main Jun 18, 2026
2 checks passed
@venkatamutyala venkatamutyala deleted the feat/krew-oidc-login branch June 18, 2026 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants