Open
Description
I guess this has been seen before, but I couldn't find any related issue. I'm not sure this is actually a bug, or more a "wrong" log level for this kind of message.
How to reproduce
- Create a deployment with number of replicas > 1
- Wait until the PDB gets created through the pdb-controller
- Scale down the deployment to replicas=1
- The pdb-controller logs an error as show below
- The PDB for the deployment gets deleted as expected
The log entries for the pdb-controller in that case logs following error (on GKE 1.27.11 and Docker Desktop Kubernetes 1.28.2):
pdb-controller-7bb68c7cc7-xqg2l pdb-controller time="2024-04-19T13:01:13Z" level=info action=added namespace=web pdb=nginx-deployment-pdb-controller selector="&LabelSelector{MatchLabels:map[string]string{app: nginx-test,},MatchExpressions:[]LabelSelectorRequirement{},}"
pdb-controller-7bb68c7cc7-xqg2l pdb-controller time="2024-04-19T13:02:13Z" level=info action=removed namespace=web pdb=nginx-deployment-pdb-controller selector="&LabelSelector{MatchLabels:map[string]string{app: nginx-test,},MatchExpressions:[]LabelSelectorRequirement{},}"
pdb-controller-7bb68c7cc7-xqg2l pdb-controller time="2024-04-19T13:02:13Z" level=error msg="Failed to update PDB: Operation cannot be fulfilled
Sample deployment:
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-deployment
spec:
replicas: 3
selector:
matchLabels:
app: nginx-test
template:
metadata:
labels:
app: nginx-test
spec:
containers:
- name: nginx-container
image: nginx:latest
ports:
- containerPort: 80