Use kubectl apply workload yaml failed.
Created by: weili520
General remarks
Describe the bug
-
If we use
kubectl apply -f 1.yaml
, it will field with an error thatunknown field "gpu" in io.k8s.core.v1.ResourceRequirements; if you choose to ignore these errors, turn validation off with --validate=false
. -
the
1.yaml
config iscopied from
the console workload YAML
- copied from here
Versions used(KubeSphere/Kubernetes)
KubeSphere: v3.2.1
Environment
It's not important.
To Reproduce
- create a workload, and switch to edit yaml mode, then you will get the workload object config.
- Use the kubectl toolbox in the lower right corner, and touch a file names 1. yaml.
- copy the workload yaml config into the 1.yaml and save
- use
kubectl apply -f 1.yaml
, you will get an error:unknown field "gpu" in io.k8s.core.v1.ResourceRequirements; if you choose to ignore these errors, turn validation off with --validate=false
Expected behavior
create a workload successfully