Skip to content

Commit e524931

Browse files
committed
fix: proxy-webhook selector matches operator pods
Both the `tekton-operator` and `tekton-operator-proxy-webhook` Deployments label their Pods with `name: tekton-operator`. The `tekton-operator-proxy-webhook` Service uses this same label as its only selector, so it inadvertently load-balances traffic across both Deployments. Because `tekton-operator` pods do not serve on port 8443, ~50% of admission webhook requests fail: failed calling webhook "proxy.operator.tekton.dev": Post ".../tekton-operator-proxy-webhook.../defaulting": dial tcp <ClusterIP>:443: connect: connection refused Because MutatingWebhookConfiguration has `failurePolicy: Fail`, each such failure immediately rejects TaskRun Pod creation. Rename the proxy-webhook Deployment's selector matchLabels and pod template label from `name: tekton-operator` to `name: tekton-operator-proxy-webhook`, and update the Service selector to match. The `app: tekton-operator` label is left unchanged. Applies to both Kubernetes and OpenShift manifests. Adding a set-based (NotIn) expression to the Service selector instead was not viable as Kubernetes Services only support equality-based (matchLabels) selectors.
1 parent 0f90822 commit e524931

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

cmd/kubernetes/operator/kodata/webhook/webhook.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,11 @@ spec:
9292
replicas: 1
9393
selector:
9494
matchLabels:
95-
name: tekton-operator
95+
name: tekton-operator-proxy-webhook
9696
template:
9797
metadata:
9898
labels:
99-
name: tekton-operator
99+
name: tekton-operator-proxy-webhook
100100
app: tekton-operator
101101
spec:
102102
serviceAccountName: tekton-operators-proxy-webhook
@@ -152,7 +152,7 @@ spec:
152152
port: 443
153153
targetPort: 8443
154154
selector:
155-
name: tekton-operator
155+
name: tekton-operator-proxy-webhook
156156

157157
---
158158

cmd/openshift/operator/kodata/webhook/webhook.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,11 @@ spec:
9999
replicas: 1
100100
selector:
101101
matchLabels:
102-
name: tekton-operator
102+
name: tekton-operator-proxy-webhook
103103
template:
104104
metadata:
105105
labels:
106-
name: tekton-operator
106+
name: tekton-operator-proxy-webhook
107107
app: tekton-operator
108108
spec:
109109
securityContext:
@@ -160,7 +160,7 @@ spec:
160160
port: 443
161161
targetPort: 8443
162162
selector:
163-
name: tekton-operator
163+
name: tekton-operator-proxy-webhook
164164

165165
---
166166

0 commit comments

Comments
 (0)