Skip to content

Commit

Permalink
Change apps/v1beta1; Add field "selector"; to make it run on kubernet…
Browse files Browse the repository at this point in the history
…es 1.18.3

There will be errors if we don't make a change:

 [root@master1 Chapter10]# kubectl apply -f kubia-statefulset.yaml
error: unable to recognize "kubia-statefulset.yaml": no matches for kind "StatefulSet" in version "apps/v1beta1"
[root@master1 Chapter10]#

[root@master1 Chapter10]# kubectl apply -f kubia-statefulset.yaml
error: error validating "kubia-statefulset.yaml": error validating data: ValidationError(StatefulSet.spec): missing required field "selector" in io.k8s.api.apps.v1.StatefulSetSpec; if you choose to ign
ore these errors, turn validation off with --validate=false
[root@master1 Chapter10]#
  • Loading branch information
lixianfa authored and luksa committed Jul 16, 2020
1 parent 9277450 commit d15844a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Chapter10/kubia-statefulset.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
apiVersion: apps/v1beta1
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: kubia
spec:
serviceName: kubia
replicas: 2
selector:
matchLabels:
app: kubia # has to match .spec.template.metadata.labels
template:
metadata:
labels:
Expand Down

0 comments on commit d15844a

Please sign in to comment.