portainer / k2d

Kubernetes to Docker translator
Other
133 stars 10 forks source link

Support for metrics server for things like kubectl top #89

Open rothgar opened 4 weeks ago

rothgar commented 4 weeks ago

This probably would be too much to implement with the official metrics server but it might be possible to implement something that satisfies the kubectl top APIs without deploying the full metrics server.

When I try to deploy the metrics server it errors on various RBAC and CRD resources that are not supported

kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
service/metrics-server created                                                                                                                                                deployment.apps/metrics-server created
resource mapping not found for name: "metrics-server" namespace: "kube-system" from "https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml": no matches for kind "ServiceAccount" in version "v1"
ensure CRDs are installed first                                                                                                                                               resource mapping not found for name: "system:aggregated-metrics-reader" namespace: "" from "https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml": no matches for kind "ClusterRole" in version "rbac.authorization.k8s.io/v1"                                                                                        ensure CRDs are installed first
resource mapping not found for name: "system:metrics-server" namespace: "" from "https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml": no matches for kind "ClusterRole" in version "rbac.authorization.k8s.io/v1"
ensure CRDs are installed first                                                                                                                                               resource mapping not found for name: "metrics-server-auth-reader" namespace: "kube-system" from "https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml": no matches for kind "RoleBinding" in version "rbac.authorization.k8s.io/v1"                                                                                   ensure CRDs are installed first
resource mapping not found for name: "metrics-server:system:auth-delegator" namespace: "" from "https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml": no matches for kind "ClusterRoleBinding" in version "rbac.authorization.k8s.io/v1"                                                                             ensure CRDs are installed first
resource mapping not found for name: "system:metrics-server" namespace: "" from "https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml": no matches for kind "ClusterRoleBinding" in version "rbac.authorization.k8s.io/v1"
ensure CRDs are installed first
resource mapping not found for name: "v1beta1.metrics.k8s.io" namespace: "" from "https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml": no matches for kind "APIService" in version "apiregistration.k8s.io/v1"
ensure CRDs are installed first
deviantony commented 3 days ago

It might be possible to hook into the Docker top/stats API instead, I'll have a look.