Welcome to the Linux Foundation Forum!

LAB 11.2 - issues with the taint.yaml file

sdalziel
sdalziel Posts: 17
edited May 2018 in LFS258 Class Forum

Hi all,

I'm working through chapter 11 exercise 11.2 "Using Taints to Control Pod Deployment" and received the following error when I ran the command. 


$ kubectl apply -f ./taint.yaml
error: error validating "./taint.yaml": error validating data: ValidationError(Deployment.spec): unknown field "spec" in io.k8s.api.apps.v1beta1.DeploymentSpec; if you choose to ignore these errors, turn validation off with --validate=false

I included my "taint.yaml" file for help troubleshooting.


apiVersion: apps/v1beta1
kind: Deployment
metadata:
  name: taint-deployment
spec:
  replicas: 8
  template:
    metadata:
      labels:
        app: nginx
  spec:
    containers:
    - name: nginx
      image: nginx:1.7.9
      ports:
      - containerPort: 80

 

Any help would be appreciated.

Cheers,

Sean

 

Comments

  • chrispokorni
    chrispokorni Posts: 2,605
    edited May 2018

    Hi Sean, 

    When I receive an error like the one you posted, I know it is whitespace related. 

    What @serewicz suggested to align metadata and spec, I started using as a rule of thumb in yaml files. Of course it becomes tricky in nested files, but it still helps to get the indentation right on some lines, and use it as base for the rest of the necessary adjustments. 

    Regards, 

    -Chris

  • sdalziel
    sdalziel Posts: 17

    Thanks all for the replies. I deleted and wrote the taint.yaml file again. The load worked as expected.

    Cheers!

    Sean

Categories

Upcoming Training