Skip to content
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

"unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined" #178

Closed
yogeek opened this issue Feb 22, 2024 · 1 comment

Comments

@yogeek
Copy link

yogeek commented Feb 22, 2024

The tool does not seem to understand the information from the KUBECONFIG

docker run --rm -it --net=host \
  -v $HOME/.kube:/root/.kube \
  -e KUBECONFIG=/root/.kube/kubeconfig.conf \
  -v $HOME/cluster-capacity/pod.yaml:/root/pod.yaml \
  -v $HOME/.asdf/installs/kubectl/1.27.3/bin/kubectl:/usr/local/bin/kubectl \
  docker.io/gofed/cluster-capacity \
  bash

$ cluster-capacity --kubeconfig $KUBECONFIG --default-config /config/default-scheduler.yaml  --podspec /root/pod.yaml
unable to load in-cluster configuration, KUBERNETES_SERVICE_HOST and KUBERNETES_SERVICE_PORT must be defined

$ kubectl cluster-info
Kubernetes control plane is running at https://xxxxxx:6443
CoreDNS is running at https://xxxxxx:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
KubeDNSUpstream is running at https://xxxxxx:6443/api/v1/namespaces/kube-system/services/kube-dns-upstream:dns/proxy

if I add --master option (still in the docker container)

$ cluster-capacity --master https://xxxxxx:6443 --kubeconfig $KUBECONFIG --podspec /root/pod.yaml  --default-config /config/default-scheduler.yaml 
Failed to list objects: the server could not find the requested resource (get replicasets.extensions)
@yogeek
Copy link
Author

yogeek commented Feb 28, 2024

In fact I saw that the docker image pointed in the documentation has not been updated for 4 years apparently... https://hub.docker.com/r/gofed/cluster-capacity

So I am closing this ticket in favor to a new one to ask maintainers to publish docker image automatically in the CI pipeline : #181

@yogeek yogeek closed this as completed Feb 28, 2024
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

No branches or pull requests

1 participant