Comments (9)
Hey, @marafa-sugarcrm
Could you please explain a little bit more about why -c
setting do not work for you?
I think the error means that the cluster name that you provided does not exist in ~/.kube/config
. Could it be the typo in your command?
from krr.
this is the error i get. even with just a simple -h
❯ python krr.py -h
Traceback (most recent call last):
File "$HOME/git/krr/robusta_krr/core/models/config.py", line 11, in <module>
config.load_incluster_config()
File "$HOME/.local/share/virtualenvs/krr-D82Oduqg/lib/python3.11/site-packages/kubernetes/config/incluster_config.py", line 121, in load_incluster_config
try_refresh_token=try_refresh_token).load_and_set(client_configuration)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "$HOME/.local/share/virtualenvs/krr-D82Oduqg/lib/python3.11/site-packages/kubernetes/config/incluster_config.py", line 54, in load_and_set
self._load_config()
File "$HOME/.local/share/virtualenvs/krr-D82Oduqg/lib/python3.11/site-packages/kubernetes/config/incluster_config.py", line 62, in _load_config
raise ConfigException("Service host/port is not set.")
kubernetes.config.config_exception.ConfigException: Service host/port is not set.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "$HOME/git/krr/krr.py", line 1, in <module>
from robusta_krr import run
File "$HOME/git/krr/robusta_krr/__init__.py", line 1, in <module>
from .main import run
File "$HOME/git/krr/robusta_krr/main.py", line 14, in <module>
from robusta_krr.core.models.config import Config
File "$HOME/git/krr/robusta_krr/core/models/config.py", line 14, in <module>
config.load_kube_config()
File "$HOME/.local/share/virtualenvs/krr-D82Oduqg/lib/python3.11/site-packages/kubernetes/config/kube_config.py", line 813, in load_kube_config
loader = _get_kube_config_loader(
^^^^^^^^^^^^^^^^^^^^^^^^
File "$HOME/.local/share/virtualenvs/krr-D82Oduqg/lib/python3.11/site-packages/kubernetes/config/kube_config.py", line 773, in _get_kube_config_loader
return KubeConfigLoader(
^^^^^^^^^^^^^^^^^
File "$HOME/.local/share/virtualenvs/krr-D82Oduqg/lib/python3.11/site-packages/kubernetes/config/kube_config.py", line 206, in __init__
self.set_active_context(active_context)
File "$HOME/.local/share/virtualenvs/krr-D82Oduqg/lib/python3.11/site-packages/kubernetes/config/kube_config.py", line 259, in set_active_context
self._current_context = self._config['contexts'].get_with_name(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "$HOME/.local/share/virtualenvs/krr-D82Oduqg/lib/python3.11/site-packages/kubernetes/config/kube_config.py", line 660, in get_with_name
raise ConfigException(
kubernetes.config.config_exception.ConfigException: Invalid kube-config file. Expected object with name in $HOME/.kube/config/contexts list
from krr.
I think the issue might be related to kubectx, as you mentioned that you are using it.
In any case this is a bug and I will fix it in a future.
from krr.
@LeaveMyYard Does it not make more sense to first parse the parameters and then search for a kubeconfig?
I don't think krr should look for a kubeconfig if someone is only using the help flag
from krr.
@yonahd you are correct, and I think I fixed it a few days ago. Currently error with kubeconfig will only be shown in a runtime.
from krr.
Hey, @marafa-sugarcrm
Can you try the same with the latest version? The issue with an error on plain -h is fixed, but I think your exception was caused by python kubernetes-client not being able to parse your config for some reason. Can you confirm that this config works with kubectl?
Expected object with name in $HOME/.kube/config/contexts list
I think that the issue is that you have current-context:
(an empty name) in your config, so it tries to search for that name (an empty string) in contexts
and fails, but it could be something else also.
Once again, can you confirm that this exact configuration fails only in krr and not in other tools?
from krr.
I managed to reproduce your issue with empty current-context
and added a fix for that. Please confirm that.
from krr.
Feel free to reopen if the fix did not help
from krr.
i do not set current context. that is correct . i always use --context
to avoid barfing the wrong cluster
from krr.
Related Issues (20)
- Prometheus detection: krr not detecting kube-prometheus-stack HOT 7
- Prometheus returned no PercentileCPULoader metrics with the simple strategy HOT 3
- v1.9.0 not released to brew due to failed github action HOT 3
- Binaries missing for 1.9.0 HOT 3
- Add support for Windows Containers HOT 1
- CSV export format improvement HOT 1
- Add flags for controlling the memory buffer applied over the maximum value recorded HOT 4
- Algorithm CPU percentil in documentation correct? HOT 1
- Version check is broken on dev versions
- Automatic connection to Prometheus doesn't work on k3s from outside the cluster
- KRR computes recommendation for lots of Kubernetes objects, but if just one errors out no results are printed HOT 5
- Custom selector for prometheus service auto discovery HOT 3
- All pods are reported as `"deleted": true` even if still running HOT 1
- Support for oom_memory_buffer_percentage=0 HOT 1
- Unable to get history range from VictoriaMetrics HOT 3
- --resource flag broken in 1.11.0 HOT 1
- Remote end closed connection without response
- [v1.12.0-main] - ERROR - CERTIFICATE_VERIFY_FAILED certificate trying Recommendations HOT 4
- History duration flag is not working in version v1.11.0-3-g2e8278c-main-dirty
- About memory requests and limits calculation HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from krr.