sixeyed / kiamol

Learn Kubernetes in a Month of Lunches
Creative Commons Attribution Share Alike 4.0 International
304 stars 224 forks source link

Chapter 14: First kubectl command fails #65

Open rpjeff opened 1 year ago

rpjeff commented 1 year ago

The very first command after cd fails!

# kubectl apply -f prometheus/
namespace/kiamol-ch14-monitoring created
configmap/prometheus-config created
service/prometheus created
deployment.apps/prometheus created
serviceaccount/prometheus created
resource mapping not found for name: "prometheus" namespace: "" from "prometheus/prometheus.yaml": no matches for kind "ClusterRole" in version "rbac.authorization.k8s.io/v1beta1"
ensure CRDs are installed first
resource mapping not found for name: "prometheus" namespace: "" from "prometheus/prometheus.yaml": no matches for kind "ClusterRoleBinding" in version "rbac.authorization.k8s.io/v1beta1"
ensure CRDs are installed first

The kubernetes cluster is a simple single node k3s vanilla setup. kubectl is an alias for k3s kubectl

# k3s --version
k3s version v1.26.3+k3s1 (01ea3ff2)
go version go1.19.7

Possibly a change in the RBAC API?

rpjeff commented 1 year ago

Dropping the "beta1" off the end of "rbac.authorization.k8s.io/v1beta1" appears to work,

# kubectl apply -f prometheus/
namespace/kiamol-ch14-monitoring unchanged
configmap/prometheus-config unchanged
service/prometheus unchanged
deployment.apps/prometheus unchanged
serviceaccount/prometheus unchanged
clusterrole.rbac.authorization.k8s.io/prometheus created
clusterrolebinding.rbac.authorization.k8s.io/prometheus created