I want to create a ReplicaSet with separate pods.
Pods
apiVersion: v1
kind: Pod
metadata:
name: user-pod
labels:
app: user-pod
spec:
containers:
- name: user-container
image: kia9372/store-user
Replicaset
apiVersion: apps/v1
kind: ReplicaSet
metadata:
name: user-replicaset
labels:
app: user-replicaset
spec:
replicas: 3
selector:
matchLabels:
app: user-pod
but when i execute the following command, it throws the foloowing error:
kubectl create -f user-replicaset.yml
>error: error validating "user-replicaset.yml":
error validating data: ValidationError(ReplicaSet.spec.selector):
unknown field "app" in io.k8s.apimachinery.pkg.apis.meta.v1.LabelSelector;
if you choose to ignore these errors, turn validation off with --validate=false
What's the problem? how can I solve this?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…