Skip to content

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

Closed
@meysholdt

Description

@meysholdt

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions