Skip to content

fix(backend/kubernetes): use default KUBECONFIG resolution#2672

Merged
tedim52 merged 4 commits intokurtosis-tech:mainfrom
edobry:kubeconfig
Mar 21, 2025
Merged

fix(backend/kubernetes): use default KUBECONFIG resolution#2672
tedim52 merged 4 commits intokurtosis-tech:mainfrom
edobry:kubeconfig

Conversation

@edobry
Copy link
Copy Markdown
Contributor

@edobry edobry commented Mar 10, 2025

Description

This PR modifies the Kubernetes backend and the CLI to use the K8s SDK's default resolution strategy, allowing them to read the user's K8s configuration from the KUBECONFIG environment variable, rather than being hardcoded to only read from $HOME/.kube/config. This enables compatibility with a wider variety of local K8s configuration strategies by leveraging standard K8s practices.

This change was primarily motivated by difficulties using Kurtosis with my own setup, wherein I have some scripting which dynamically constructs a KUBECONFIG envvar in order to work with multiple K8s clusters. It should not cause any issues, as the SDK's default resolution strategy ultimately falls back to reading from $HOME/.kube/config.

There is some duplication in this PR as I couldn't figure out how to re-use the kubernetesConfig/kubernetesManager created in the K8s backend in the gateway module. Happy to take guidance on how to improve this if necessary.

I've tested this PR locally and was successfully able to run successfully.

Is this change user facing?

YES

@tedim52 (pls LMK if there's a better person to tag)

@edobry edobry force-pushed the kubeconfig branch 2 times, most recently from 5c5cbce to 1117a1b Compare March 10, 2025 20:31
@tedim52
Copy link
Copy Markdown
Collaborator

tedim52 commented Mar 10, 2025

this is a great change, will take a look

@tedim52
Copy link
Copy Markdown
Collaborator

tedim52 commented Mar 10, 2025

Addresses: #2623

Comment thread cli/cli/commands/gateway/gateway.go
@tedim52
Copy link
Copy Markdown
Collaborator

tedim52 commented Mar 13, 2025

tested on my end, works nicely! i think the duplication at the gateway level is okay

@tedim52 tedim52 added this pull request to the merge queue Mar 21, 2025
Merged via the queue into kurtosis-tech:main with commit 379e49b Mar 21, 2025
49 checks passed
github-merge-queue Bot pushed a commit that referenced this pull request Apr 18, 2025
🤖 I have created a release *beep* *boop*
---


##
[1.7.0](1.6.0...1.7.0)
(2025-04-17)


### Features

* add grafloki to kurtosis config
([#2707](#2707))
([b6794e1](b6794e1))
* export service logs (Kubenertes)
([#2693](#2693))
([c00f357](c00f357))
* grafloki start/stop
([#2696](#2696))
([53d823a](53d823a))
* service update
([#2689](#2689))
([4cda391](4cda391))


### Bug Fixes

* **backend/kubernetes:** use default KUBECONFIG resolution
([#2672](#2672))
([379e49b](379e49b))
* docker auth wasn't being used by engine and API
([#2699](#2699))
([4eea787](4eea787))
* give grafana root access
([#2706](#2706))
([b8e2fab](b8e2fab))
* remove k8s ingress on stop user services
([#2715](#2715))
([e31c0d4](e31c0d4))
* return empty deployment if not found
([#2716](#2716))
([451c70e](451c70e))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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