Closed gerodriguez-fan closed 7 months ago
@gerodriguez-fan Thank you for reporting this. Could you please add an example yaml (you can use our test yaml`s as a base) just to make sure we are talking about same thing.
From the description the problem could be the replicas we are using. So we are comparing replicas not minReplicas
in PDB.
@gerodriguez-fan Would you like to work on this issue?
I'm having a similar issue even when I use a percentage value on minAvailable
. My deployment spec doesn't have .spec.replicas
declared as I use the HPA min/max parameters and any value I put on the pdb ends up with an error.
my pdb spec:
spec:
minAvailable: 75%
selector:
matchLabels:
app: example
my deployment spec (to show it doesn't have replicas
):
spec:
revisionHistoryLimit: 3
progressDeadlineSeconds: 600
strategy:
rollingUpdate:
maxSurge: 10%
maxUnavailable: 0
type: RollingUpdate
selector:
matchLabels:
app: example
template: [...]
What I've noticed:
I'm using KubeLinter 0.6.4 both on Mac (local) and Linux (pipeline)
@gerodriguez-fan Thank you for reporting this. Could you please add an example yaml (you can use our test yaml`s as a base) just to make sure we are talking about same thing.
From the description the problem could be the replicas we are using. So we are comparing replicas not
minReplicas
in PDB.@gerodriguez-fan Would you like to work on this issue?
I can give it a try,
Closed with #688
System info:
Describe the bug When linting a deployment that contains a PodDisruptionBudget with
maxUnavailable: 1
and an HPA withminReplicas: 4
the tool reports:It request to update the
minAvailable
field on the PDB which cannot be set if themaxUnavailable
field is used. This is a common scenario, we want an HPA to start with a certain number of replicas and we do not want it to be disrupted more than 1 pod at the time.To Reproduce run kube-linter on any deployment with a PodDisruptionBudget with maxUnavailable of 1 and and HPA with minReplicas:4
Sample YAML input
Expected behavior The linter should not trigger a failure as this is a common scenario.