carlosedp / cluster-monitoring

Cluster monitoring stack for clusters based on Prometheus Operator
MIT License
740 stars 200 forks source link

Script error #51

Closed Staroush closed 4 years ago

Staroush commented 4 years ago

Hi, Can you help me solve an issue that i got when following your guide? I´ve set up the vars master ip and suffix with my node1 IP. How should I approach this with multiple nodes in cluster? I have set k3s enabled and armExporter and Traefik to true. Should I run all the commands with sudo?

When I do I get

kubectl apply -f ./manifests/setup/
The connection to the server localhost:8080 was refused - did you specify the right host or port?
make: *** [Makefile:34: deploy] Error 1

Without sudo I get

kubectl apply -f manifests/setup/
namespace/monitoring unchanged
clusterrole.rbac.authorization.k8s.io/prometheus-operator unchanged
clusterrolebinding.rbac.authorization.k8s.io/prometheus-operator unchanged
[unable to recognize "manifests/setup/prometheus-operator-0alertmanagerCustomResourceDefinition.yaml": no matches for kind "CustomResourceDefinition" in version "apiextensions.k8s.io/v1", unable to recognize "manifests/setup/prometheus-operator-0podmonitorCustomResourceDefinition.yaml": no matches for kind "CustomResourceDefinition" in version "apiextensions.k8s.io/v1", unable to recognize "manifests/setup/prometheus-operator-0prometheusCustomResourceDefinition.yaml": no matches for kind "CustomResourceDefinition" in version "apiextensions.k8s.io/v1", unable to recognize "manifests/setup/prometheus-operator-0prometheusruleCustomResourceDefinition.yaml": no matches for kind "CustomResourceDefinition" in version "apiextensions.k8s.io/v1", unable to recognize "manifests/setup/prometheus-operator-0servicemonitorCustomResourceDefinition.yaml": no matches for kind "CustomResourceDefinition" in version "apiextensions.k8s.io/v1", unable to recognize "manifests/setup/prometheus-operator-0thanosrulerCustomResourceDefinition.yaml": no matches for kind "CustomResourceDefinition" in version "apiextensions.k8s.io/v1"]

What am I doing wrong?

Thanks :)

carlosedp commented 4 years ago

Apparently you don't have access to your cluster (the connection refused error). Kubectl needs access to deploy the manifests. Check your node IPs and ports and correct the kubeconfig to point to the cluster.

You don't need to worry about the other nodes or sudo, it just needs the master IP to set the correct API endpoints.

Tip. Wrap your code in code blocks (backticks), makes easier to read.

carlosedp commented 4 years ago

Closing as got no feedback. Reopen if an error is found.