The following error is reported
This is an error when I execute the pod copy of the deployment controller. The meaning of the error is:
deployment verification error. The selector parameter must be specified in the deployment spec module.
Original yaml file
In Deployment.spec In the module, only the number of replicas is specified, and the replica label needs to be specified to match the deployment controller
apiVersion: apps/v1 #Api interface version
kind: Deployment #define controller
metadata:
name: nginx-deployment #deployment name
spec:
replicas: 3 #Under the specific parameter information spec, only the number of replicas is specified, you also need to specify the replica tag to match the Deployment controller
template:
metadata:
labels:
app: nginx-deployment
spec:
containers:
- name: nginx-deployment
image: nginx:1.7.9
ports:
- containerPort: 80
Solution: modify yaml file
As shown in the figure above, write the selector tag parameters of the full spec according to the tags on the picture, matching with pod and deployment
Execute yaml script
kubectl apply -f deployment.yaml --record
Read More:
- error: error validating “ingress-tomcat6.yaml“: error validating data: [ValidationError(Ingress.spec
- K8s ❉ Error: cannot be handled as a** [How to Solve]
- [Solved] fastapi error: {“detail”:[{“loc”:[“body”],”msg”:”field required”,”type”:”value_error.missing”}]}
- k8s kubernetes ingress error: endpoints “default-http-backend“ not found
- [Solved] k8s error retrieving resource lock default/fuseim.pri-ifs: Unauthorized
- [Solved] k8s Error: Back-off restarting failed container
- Kubernetes reported an error: matchexpressions: [] v1. Labelselector requirement (NIL)}: field is immutable
- K8s initializing the master & worker node error [How to Solve]
- K8s cluster initialization error: Port 6443 is in use [Solved]
- [Solved] RuntimeError: Error(s) in loading state_dict for FasterRCNN: Missing key(s) in state_dict:……
- Fuel9.0 deployment openstack error: Deployment has failed,All nodes are finishedFailed task:Task[netconfig/1]
- How to Solve kubelet starts error (k8s Cluster Restarted)
- [Solved] k8s kubeadmin init Error: http://localhost:10248/healthz‘ failed
- K8s Install Error: Error: unknown flag: –experimental-upload-certs
- [Solved] RuntimeError: Error(s) in loading state_dict for Model: Missing key(s) in state_dict
- [Solved] Ubuntu 20.04 LTS Install k8s Error: The connection to the server localhost:8080 was refused
- K8S Master Initialize Error: [ERROR CRI]: container runtime is not running: output: E0812
- [Solved] Upstream connect error or disconnect occurs after the k8s istio virtual machine is restarted
- [Solved] MindSpore Error: “TypeError: parse() missing 1 required positional.”
- [Solved] K8s Initialize Error: failed with error: Get “http://localhost:10248/healthz“