▲ Click on the "DevOps and k8s full-stack technology" above to follow the official account
Question 1: Failed to access Kubernetes cluster services?
Cause Analysis: The certificate cannot be recognized, the reasons are: custom certificate, expired, etc.
Solution: Just update the certificate.
Question 2: Failed to access Kubernetes cluster services?
curl: (7) Failed connect to 10.103.22.158:3000; Connection refused
Cause Analysis: The port mapping is wrong, and the service works normally, but the service cannot be provided.
Solution: delete the SVC and remap the port.
kubectl delete svc nginx-deployment
Question 3: Does Kubernetes cluster service exposure fail?
Error from server (AlreadyExists): services "nginx-deployment" already exists
Cause Analysis: The container has exposed services.
Solution: delete the SVC and remap the port.
Question 4: The external network cannot access the services provided by the Kubernetes cluster?
Cause analysis: The type of the Kubernetes cluster is ClusterIP, and the service is not exposed to the external network.
Solution: Just change the type of the Kubernetes cluster to NodePort, so the service can be accessed through all Kubernetes cluster nodes.
kubectl edit svc nginx-deployment
Question 4: Pod status is ErrImagePull?
readiness-httpget-pod 0/1 ErrImagePull 0 10s
Cause analysis: The image cannot be pulled.
Solution: Just replace the mirror image.
Question 5: After creating the init C container, its state is not normal?
NAME READY STATUS RESTARTS AGE
myapp-pod 0/1 Init:0/2 0 20s
Cause analysis: Check the logs and find that the Pod is always being initialized; then check the details of the Pod to locate the reason for the Pod creation failure: the initialization of the container has not completed.
Error from server (BadRequest): container "myapp-container" in pod "myapp-pod" is waiting to start: PodInitializing
Solution: Just replace the mirror image.
Question 6: After creating the init C container, its state is not normal?
NAME READY STATUS RESTARTS AGE
myapp-pod 0/1 Init:0/2 0 20s
Cause analysis: Check the logs and find that the Pod is always being initialized; then check the details of the Pod to locate the reason for the Pod creation failure: the initialization of the container has not completed.
Error from server (BadRequest): container "myapp-container" in pod "myapp-pod" is waiting to start: PodInitializing
waiting for myservice
Server: 10.96.0.10
Address: 10.96.0.10:53
** server can't find myservice.default.svc.cluster.local: NXDOMAIN
*** Can't find myservice.svc.cluster.local: No answer
*** Can't find myservice.cluster.local: No answer
*** Can't find myservice.default.svc.cluster.local: No answer
*** Can't find myservice.svc.cluster.local: No answer
*** Can't find myservice.cluster.local: No answer
Solution: Create a related Service and write the name of the SVC into the CoreDNS server of the Kubernetes cluster, so that CoreDNS can resolve the domain name during the execution of the Pod's init C container.
kubectl apply -f myservice.yaml
Question 7: Is the state of the surviving Pod detected as CrashLoopBackOff?
Cause analysis: The mirroring problem caused the container to fail to restart.
Solution: Just replace the mirror image.
Question 8: Pod creation failed?
readiness-httpget-pod 0/1 Pending 0 0s
readiness-httpget-pod 0/1 Pending 0 0s
readiness-httpget-pod 0/1 ContainerCreating 0 0s
readiness-httpget-pod 0/1 Error 0 2s
readiness-httpget-pod 0/1 Error 1 3s
readiness-httpget-pod 0/1 CrashLoopBackOff 1 4s
readiness-httpget-pod 0/1 Error 2 15s
readiness-httpget-pod 0/1 CrashLoopBackOff 2 26s
readiness-httpget-pod 0/1 Error 3 37s
readiness-httpget-pod 0/1 CrashLoopBackOff 3 52s
readiness-httpget-pod 0/1 Error 4 82s
Cause analysis: The container cannot be started due to mirroring problems.
Solution: replace the mirror image.
Question 9: The ready state of the Pod is not entered?
readiness-httpget-pod 0/1 Running 0 116s
Cause analysis: Pod failed to execute the command and could not obtain resources.
Solution: enter the container and create resources defined by yaml. ,
Question 10: Pod creation failed?
Cause Analysis: The content of the yml file is wrong——using Chinese characters.
Solution: modify the content of myregistrykey.
Wonderful article recommendation
It's the end of the year, sum up this year, full of harvest
Check out these 11 stats for kubernetes in 2022
GitOps Best Practices on Kuberentes
WeChat public account
Light up the collection, the server will not be down for 10 years