-
Notifications
You must be signed in to change notification settings - Fork 0
feat: try loading k8s from outside cluster #28
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
base: main
Are you sure you want to change the base?
Conversation
| except FileNotFoundError: | ||
| raise RuntimeError("Namespace file not found. Are you running in a Kubernetes cluster?") | ||
| try: | ||
| contexts, active_context = cluster_config.list_kube_config_contexts() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what do you think about loading from env var, with fall back to default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if im getting you right. that might cause problems, if a mistake was entered in the env var and is different then the "/var/run/secrets/kubernetes.io/serviceaccount/namespace". i think default should be the 'incluster' namespace file, then fallback to other methods
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using kubeconfig context namespace used only for development purposes..
if the pod in cluster, the namespace file will exists and all will be just fine.
the only reason to provide namespace will be for development reasons..
I would even delete the fallback to default, and will try to use env var, it not exists, exit the program..
using kubeconfig namespace just too implicit
| except FileNotFoundError: | ||
| raise RuntimeError("Namespace file not found. Are you running in a Kubernetes cluster?") | ||
| try: | ||
| contexts, active_context = cluster_config.list_kube_config_contexts() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using kubeconfig context namespace used only for development purposes..
if the pod in cluster, the namespace file will exists and all will be just fine.
the only reason to provide namespace will be for development reasons..
I would even delete the fallback to default, and will try to use env var, it not exists, exit the program..
using kubeconfig namespace just too implicit
No description provided.