E0510 00:51:44.054825 3674560 memcache.go:287]

[quote=“GQH1993, post:1, topic:13513, full:true”]
Dear friends, I have a problem: how to get the metrics-serverresource size through Kubectl

When I get pods ,it shows like this:


test01@test01:~$ kubectl get pods --all-namespaces
E0510 00:48:22.684564 3505162 memcache.go:287] couldn’t get resource list for metrics.k8s.io/v1beta1: the server is currently unable to handle the request
E0510 00:48:22.697088 3505162 memcache.go:121] couldn’t get resource list for metrics.k8s.io/v1beta1: the server is currently unable to handle the request
E0510 00:48:22.699825 3505162 memcache.go:121] couldn’t get resource list for metrics.k8s.io/v1beta1: the server is currently unable to handle the request
E0510 00:48:22.702567 3505162 memcache.go:121] couldn’t get resource list for metrics.k8s.io/v1beta1: the server is currently unable to handle the request
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system coredns-6f5f9b5d74-bmkfk 0/1 CrashLoopBackOff 8 (95s ago) 7m22s
kube-system dashboard-metrics-scraper-7bc864c59-q9mhz 0/1 CrashLoopBackOff 6 (24s ago) 5m40s
kube-system kubernetes-dashboard-dc96f9fc-rtx4w 0/1 ContainerCreating 0 5m40s
kube-system metrics-server-6cd6d6ffb8-qlvnq 0/1 ContainerCreating 0 6m59s


the status is:

test01@test01:~$ microk8s status
microk8s is running
high-availability: no
addons:
enabled:
dashboard # (core) The Kubernetes dashboard
dns # (core) CoreDNS
helm # (core) Helm - the package manager for Kubernetes
helm3 # (core) Helm 3 - the package manager for Kubernetes
metrics-server # (core) K8s Metrics Server for API access to service metrics
disabled:
cert-manager # (core) Cloud native certificate management
community # (core) The community addons repository
ha-cluster # (core) Configure high availability on the current node
host-access # (core) Allow Pods connecting to Host services smoothly
hostpath-storage # (core) Storage class; allocates storage from host directory
ingress # (core) Ingress controller for external access
kube-ovn # (core) An advanced network fabric for Kubernetes
mayastor # (core) OpenEBS MayaStor
metallb # (core) Loadbalancer for your Kubernetes cluster
minio # (core) MinIO object storage
observability # (core) A lightweight observability stack for logs, traces and metrics
prometheus # (core) Prometheus operator for monitoring and logging
rbac # (core) Role-Based Access Control for authorisation
registry # (core) Private image registry exposed on localhost:32000
storage # (core) Alias to hostpath-storage add-on, deprecated


test01@test01:~$ kubectl get pods --all-namespaces
E0510 00:51:44.054825 3674560 memcache.go:287] couldn’t get resource list for metrics.k8s.io/v1beta1: the server is currently unable to handle the request
E0510 00:51:44.070355 3674560 memcache.go:121] couldn’t get resource list for metrics.k8s.io/v1beta1: the server is currently unable to handle the request
E0510 00:51:44.072676 3674560 memcache.go:121] couldn’t get resource list for metrics.k8s.io/v1beta1: the server is currently unable to handle the request
E0510 00:51:44.075545 3674560 memcache.go:121] couldn’t get resource list for metrics.k8s.io/v1beta1: the server is currently unable to handle the request
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system coredns-6f5f9b5d74-bmkfk 0/1 CrashLoopBackOff 8 (4m57s ago) 10m
kube-system dashboard-metrics-scraper-7bc864c59-q9mhz 0/1 CrashLoopBackOff 6 (3m46s ago) 9m2s
kube-system kubernetes-dashboard-dc96f9fc-rtx4w 0/1 ContainerCreating 0 9m2s
kube-system metrics-server-6cd6d6ffb8-qlvnq 0/1 ContainerCreating 0 10m


test01@test01:~$ microk8s inspect pod metrics-server-6cd6d6ffb8-qlvnq
Inspecting system
Inspecting Certificates
Inspecting services
Service snap.microk8s.daemon-cluster-agent is running
Service snap.microk8s.daemon-containerd is running
Service snap.microk8s.daemon-kubelite is running
Service snap.microk8s.daemon-flanneld is running
Service snap.microk8s.daemon-etcd is running
Service snap.microk8s.daemon-apiserver-kicker is running
Copy service arguments to the final report tarball
Inspecting AppArmor configuration
Gathering system information
Copy processes list to the final report tarball
Copy disk usage information to the final report tarball
Copy memory usage information to the final report tarball
Copy server uptime to the final report tarball
Copy openSSL information to the final report tarball
Copy snap list to the final report tarball
Copy VM name (or none) to the final report tarball
Copy current linux distribution to the final report tarball
Copy network configuration to the final report tarball
Inspecting kubernetes cluster
Inspect kubernetes cluster

Building the report tarball
Report tarball is at /var/snap/microk8s/5128/inspection-report-20230510_005224.tar.gz


test01@test01:~$ kubectl describe pod metrics-server-6cd6d6ffb8-qlvnq -n kube-system
E0510 00:55:53.242816 3883965 memcache.go:287] couldn’t get resource list for metrics.k8s.io/v1beta1: the server is currently unable to handle the request
E0510 00:55:53.260892 3883965 memcache.go:121] couldn’t get resource list for metrics.k8s.io/v1beta1: the server is currently unable to handle the request
E0510 00:55:53.266273 3883965 memcache.go:121] couldn’t get resource list for metrics.k8s.io/v1beta1: the server is currently unable to handle the request
E0510 00:55:53.268863 3883965 memcache.go:121] couldn’t get resource list for metrics.k8s.io/v1beta1: the server is currently unable to handle the request
Name: metrics-server-6cd6d6ffb8-qlvnq
Namespace: kube-system
Priority: 2000000000
Priority Class Name: system-cluster-critical
Service Account: metrics-server
Node: test03/172.17.23.18
Start Time: Wed, 10 May 2023 00:41:23 +0000
Labels: k8s-app=metrics-server
pod-template-hash=6cd6d6ffb8
Annotations:
Status: Pending
IP:
IPs:
Controlled By: ReplicaSet/metrics-server-6cd6d6ffb8
Containers:
metrics-server:
Container ID:
Image: registry.k8s.io/metrics-server/metrics-server:v0.5.2
Image ID:
Port: 4443/TCP
Host Port: 0/TCP
Args:
–cert-dir=/tmp
–secure-port=4443
–kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname
–kubelet-use-node-status-port
–metric-resolution=15s
–kubelet-insecure-tls
State: Waiting
Reason: ContainerCreating
Ready: False
Restart Count: 0
Requests:
cpu: 100m
memory: 200Mi
Liveness: http-get https://:https/livez delay=0s timeout=1s period=10s #success=1 #failure=3
Readiness: http-get https://:https/readyz delay=20s timeout=1s period=10s #success=1 #failure=3
Environment:
Mounts:
/tmp from tmp-dir (rw)
/var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-vj44r (ro)
Conditions:
Type Status
Initialized True
Ready False
ContainersReady False
PodScheduled True
Volumes:
tmp-dir:
Type: EmptyDir (a temporary directory that shares a pod’s lifetime)
Medium:
SizeLimit:
kube-api-access-vj44r:
Type: Projected (a volume that contains injected data from multiple sources)
TokenExpirationSeconds: 3607
ConfigMapName: kube-root-ca.crt
ConfigMapOptional:
DownwardAPI: true
QoS Class: Burstable
Node-Selectors: kubernetes.io/arch=arm64
kubernetes.io/os=linux
Tolerations: node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
Type Reason Age From Message


Warning MissingClusterDNS 4m16s (x15 over 14m) kubelet pod: “metrics-server-6cd6d6ffb8-qlvnq_kube-system(235c3e7c-54e8-49fd-bccb-2b5994f99178)”. kubelet does not have ClusterDNS IP configured and cannot create Pod using “ClusterFirst” policy. Falling back to “Default” policy.

what is the problem ? by the way ,I am from China, does the net not work?

PLEASE HELP THE KID FROM the Mysterious East?