Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Summary of Kubernetes errors (continuously updated)

2025-02-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Question 1. Unable to fetch the kubeadm-config ConfigMap: failed to get config map: Unauthorized

[root@k8s-store01] # kubeadm join 10.0.0.31 token 1euadv.48cjve19biy33b9m-- discovery-token-ca-cert-hash sha256:295acb22b65296410968d040cfbb326642d2e3b177ccbc3626765a0ada6fa9ff [preflight] Running pre-flight checks [WARNING SystemVerification]: this Docker version is not on the list of validated versions: 19.03.5. Latest validated version: 18.09 [preflight] Reading configuration from the cluster... [preflight] FYI: You can look at this config file with 'kubectl-n kube-system get cm kubeadm-config-oyaml'error execution phase preflight: unable to fetch the kubeadm-config ConfigMap: failed to get config map: Unauthorized

The solution is: token has expired, and the token is effective within 24 hours by default, so you need to regenerate the token in the master node.

[root@k8s-master01 ~] # kubeadm token createottwfk.al3ksj32yeqogk9y [root@k8s-master01 ~] # kubeadm token listTOKEN TTL EXPIRES USAGES DESCRIPTION EXTRA GROUPS1euadv.48cjve19biy33b9m 2019-12-08T16:17:03+08:00 authentication,signing system:bootstrappers:kubeadm:default-node-tokenottwfk.al3ksj32yeqogk9y 23h 2019-12-10T13:20:57+08:00 authentication Signing system:bootstrappers:kubeadm:default-node-token

Question 2: repository does not exist or may require 'docker login': denied: requested access to the resource is denied

[root@k8s-master01] # kubectl describe pod nginx-demo Normal Scheduled 15m default-scheduler Successfully assigned default/nginx-demo to k8s-node03 Normal BackOff 14m (x6 over 15m) kubelet, k8s-node03 Back-off pulling image "10.0.0.33/base_images/nginx:1.13" Normal Pulling 13m (x4 over 15m) kubelet K8s-node03 Pulling image "10.0.0.33/base_images/nginx:1.13" Warning Failed 13m (x4 over 15m) kubelet, k8s-node03 Failed to pull image "10.0.0.33/base_images/nginx:1.13": rpc error: code = Unknown desc = Error response from daemon: pull access denied for 10.0.0.33/base_images/nginx, repository does not exist or may require 'docker login': denied: requested access to the resource is denied Warning Failed 13m (x4 over 15m) kubelet K8s-node03 Error: ErrImagePull Warning Failed 4m56s (x43 over 15m) kubelet, k8s-node03 Error: ImagePullBackOff

The solution is: the node node does not have the permission to pull the image from the harbor, so it needs to be authorized in the master node.

[root@k8s-master01 ~] # kubectl create secret docker-registry harbor-secret-- namespace=default-- docker-server=10.0.0.33-- docker-username=admin-- docker-password=Harbor12345// add license [root@k8s-master01 ~] # cat web-demo.yamlapiVersion: v1kind: Podmetadata: name: nginx-demo labels: env: testspec: containers:-name: nginx image: 10.0.0.33/base_images/nginx:1.13 imagePullPolicy: Always imagePullSecrets:- Name: harbor-secret nodeSelector: app: k8s-node03

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report