instrumenta / instrumenta/kubeval
Invalid `successThrehold` value in `livenessProbe` not caught
- Dominant language
- Go
- Stars
- 3.2k
- Forks
- 227
- PR merge metrics
- No merged PRs in 30d
Description
I'm not sure whether this can be fixed, as context is likely not something easily captured in the underlying JSON schemas… but apparently the `successThreshold` value must be set to `1`, if used within a `livenessProbe` (as opposed to a `readinessProbe`, for example):
https://v1-11.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.11/#probe-v1-core
This isn't currently caught by the latest versions of kubeval and the 1.11 schema:
```
$ cat unhappy_deployment.yml
---
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: foo
spec:
template:
metadata:
labels:
service: foo
spec:
containers:
- name: foo
image: 'whatever'
livenessProbe:
successThreshold: 2
httpGet:
path: /health
port: 80
$ docker run --rm -t -w `pwd` -v `pwd`:`pwd`:ro garethr/kubeval:0.14.0 \
--strict -v 1.11.9 unhappy_deployment.yml
PASS - unhappy_deployment.yml contains a valid Deployment
$ kubectl apply -f unhappy_deployment.yml
The Deployment "foo" is invalid: spec.template.spec.containers[0].livenessProbe.successThreshold: Invalid value: 2: must be 1
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the kubeval validation path and the Kubernetes 1.11 schema handling, using unhappy_deployment.yml to reproduce the reported PASS for livenessProbe.successThreshold: 2. Compare this with the kubectl rule that requires the value to be 1. Done means kubeval rejects the manifest with the invalid livenessProbe value while preserving valid readinessProbe behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, kubernetes
- Domain
- devtools, testing-qa
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100