by Yusuke Ando 氏
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[40m [0m[40m [0m[40m [0m[40m [0m [40m [0m[40m [0m[40m [0m[40m [0m[40m [0m[40m [0m[40m [0m[40m [0m[40m [0m[40m [0m | |
[40m [0m[40m [0m[43m [0m[43m [0m[43m [0m[43m [0m[40m [0m[40m [0m[43m [0m[43m [0m[43m [0m[43m [0m[43m [0m[43m [0m[43m [0m[43m [0m[43m [0m[43m [0m[40m [0m[40m [0m[40m [0m[40m [0m | |
[40m [0m[40m [0m[43m [0m[43m [0m[40m [0m[40m [0m[43m [0m[43m [0m[43m [0m[43m [0m[43m [0m[43m [0m[43m [0m[43m [0m[43m [0m[43m [0m[43m [0m[43m [0m[43m [0m[43m [0m[43m [0m[43m [0m[43m [0m[43m [0m[40m [0m[40m [0m | |
[40m [0m[40m [0m[40m [0m[40m [0m[43m [0m[43m [0m[43m [0m[43m [0m[43m [0m[43m [0m[43m [0m[43m [0m[40m [0m[40m [0m[43m [0m[43m [0m[43m [0m[43m [0m[43m [0m[43m [0m[43m [0m[43m [0m[43m [0m[43m [0m[43m [0m[43m [0m[40m [0m[40m [0m | |
[40m [0m[40m [0m[43m [0m[43m [0m[40m [0m[40m [0m[43m [0m[43m [0m[43m [0m[43m [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[40m [0m[40m [0m[40m [0m[40m [0m[40m [0m[40m [0m[40m [0m[40m [0m[40m [0m[40m [0m | |
[40m [0m[40m [0m[46m [0m[46m [0m[46m [0m[46m [0m[46m [0m[46m [0m[40m [0m[40m [0m | |
[40m [0m[40m [0m[46m [0m[40m [0m[46m [0m[46m [0m[40m [0m[46m [0m[40m [0m[40m [0m | |
[40m [0m[40m [0m[46m [0m[46m [0m[46m [0m[46m [0m[46m [0m[46m [0m[40m [0m[40m [0m | |
[40m [0m[40m [0m[40m [0m[40m [0m[40m [0m[40m [0m[40m [0m[40m [0m[40m [0m[40m [0m[40m [0m[40m [0m[40m [0m[40m [0m[40m [0m[40m [0m[40m [0m[40m [0m[40m [0m[40m [0m[40m [0m[40m |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47m [0m[47 |
$ kubectl apply --validate --dry-run -f invalid-deployment.yaml
error: error validating "invalid-deployment.yaml": error validating data: [ValidationError(Deployment.spec.replicas): invalid type for io.k8s.api.apps.v1.DeploymentSpec.replicas: got "string", expected "integer", ValidationError(Deployment.spec.template.spec.containers[0]): unknown field "port" in io.k8s.api.core.v1.Container]; if you choose to ignore these errors, turn validation off with --validate=false
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: invalid-deployment | |
spec: | |
replicas: "1" | |
selector: | |
matchLabels: | |
app: example | |
template: |
$ kubeval invalid-deployment.yaml
WARN - invalid-deployment.yaml contains an invalid Deployment - spec.replicas: Invalid type. Expected: [integer,null], given: string
WARN - invalid-deployment.yaml contains an invalid Deployment - port: Additional property port is not allowed
$ echo $?
1
$ kubeval valid-deployment.yaml
PASS - valid-deployment.yaml contains a valid Deployment
$ echo $?
0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: apps/v1 | |
kind: Deployment | |
metadata: | |
name: invalid-deployment | |
spec: | |
replicas: 1 | |
selector: | |
matchLabels: | |
app: example | |
template: |
OlderNewer