Skip to content

Refactor deploy-to-preview job to set explicit kubectx #8997

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
meysholdt opened this issue Mar 29, 2022 · 0 comments · Fixed by #9016
Closed

Refactor deploy-to-preview job to set explicit kubectx #8997

meysholdt opened this issue Mar 29, 2022 · 0 comments · Fixed by #9016
Assignees

Comments

@meysholdt
Copy link
Member

Right now, we set the kubectx config for k3s in VMs to be the default:

VM.copyk3sKubeconfig({ name: destname, path: 'k3s.yml', timeoutMS: 1000 * 60 * 3, slice: vmSlices.KUBECONFIG })
// NOTE: This was a quick have to override the existing kubeconfig so all future kubectl commands use the k3s cluster.
// We might want to keep both kubeconfigs around and be explicit about which one we're using.s
exec(`mv k3s.yml /home/gitpod/.kube/config`)

This prevent us from accessing core-dev later.

Proposed solution:

  • all invocations of kubectl should have an explicit --kubeconfig <kubectxfile> arg.
  • there should not be a default kubecontext so that invocations of kubectl without explicit --kubeconfig <kubectxfile> fail. This is for robustness: don't accidentally use the wrong context.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

2 participants