Reputation: 17
i am trying to deploy an image and associated with a service (NodePort), i just create the image and try to use a specific port 2020 like it say here:
but i still having problem , did any one can explain to me haw to do it ? i use Kubernetes metrics server and it's running BTW. here the repository am using so you could understand the big picture
so GET/WATCHER don't return any think wen i run it in my terminal
and i create the image and then run the pod and it's working but the logs show this error :
time="2022-09-18T15:44:09Z" level=error msg="received error while fetching metrics: Get \"https://10.96.0.1:443/apis/metrics.k8s.io/v1beta1/nodes\": dial tcp 10.96.0.1:443: connect: no route to host" func="github.com/paypal/load-watcher/pkg/watcher.(*Watcher).StartWatching.func1" file="/go/src/github.com/paypal/load-watcher/pkg/watcher/watcher.go:131"
so to sum up i would like to deploy the load-watcher as a service and see the result on the port 2020 like he say or any other port. thanks again.
Upvotes: -1
Views: 108
Reputation: 3786
The GET /watcher is empty, It might be due to two possibilities:
Please try to trouble shoot this by changing the network plugin from calico to canal or try as mentioned this Gitlink.
Another Possibility is :
Metrics server may fail to authenticate if kubelet is running with --anonymous-auth=false
flag.
Passing --authentication-token-webhook=true
and --authorization-mode=Webhook
flags to kubelet can fix this.
kops config for kubelet:
kubelet:
anonymousAuth: false
authenticationTokenWebhook: true
authorizationMode: Webhook
This might break authorization for kubelet-api user if ClusterRoleBinding
is not created with system:kubelet-api-admin
. Which can be fixed by creating the ClusterRoleBinding:
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: kubelet-api-admin
subjects:
- kind: User
name: kubelet-api
apiGroup: rbac.authorization.k8s.io
roleRef:
kind: ClusterRole
name: system:kubelet-api-admin
apiGroup: rbac.authorization.k8s.io
Upvotes: 0