Skip to content

Commit 8baaefe

Browse files
authored
fix: disable istio inject on controller deployment for webhook (#652)
While working on the [deployment wiki](https://github.com/andyatmiami/kubeflow-notebooks/wiki/Deploying-Kubeflow-Notebooks-2.0-%5BDEVELOPMENT-ONLY%5D) - I ended up stumbling upon an issue whereby if an istio sidecar is injected on the deployment - webhooks traffic starts failing with the following: ``` 2025-10-14T14:41:24Z ERROR Reconciler error {"controller": "workspacekind", "controllerGroup": "kubeflow.org", "controllerKind": "WorkspaceKind", "WorkspaceKind": {"name":"jupyterlab"}, "namespace": "", "name": "jupyterlab", "reconcileID": "23977643-4d6a-4c03-93c0-a64fc0002ab2", "error": "Internal error occurred: failed calling webhook \"vworkspacekind.kb.io\": failed to call webhook: Post \"https://webhook-service.kubeflow-workspaces.svc:443/validate-kubeflow-org-v1beta1-workspacekind?timeout=10s\": EOF"} ``` The reason it has not been detected until now is due to the following: 1. istio installed 2. controller gets installed with "vanilla" namespace - no istio-inject label 3. backend/frontend update namespace with istio-inject label 4. controller redeployed - deployment now gets injected 5. webhooks calls fail i.e. given the order of our component manifests getting deployed - its not until **after** `controller` is deployed once `backend` and/or `frontend` applied that this issue manifests. For now, as a quick fix - this commit simply adds a `patch.yaml` file to decorate the `workspaces-controller` `Deployment` with the `sidecar.istio.io/inject: "false"`. - we will want to (eventually) restructure the `controller` `manifests` with `kustomize` to better align with `frontend` + `backend` (with `overlays` that specifically handle the `istio` case) - we will want to (probably) support the `istio` sidecar on `controller` - but configured in such a way to allow webhooks traffic to be allowed to pass For consistency with `frontend` and `backend` components - this patch also defines the `istio-injection: enabled` label on the `Namespace` manifest of the `controller`. Signed-off-by: Andy Stoneberg <astonebe@redhat.com>
1 parent b535f1c commit 8baaefe

File tree

3 files changed

+34
-7
lines changed

3 files changed

+34
-7
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: kustomize.config.k8s.io/v1alpha1
2+
kind: Component
3+
4+
labels:
5+
- includeSelectors: true
6+
pairs:
7+
app.kubernetes.io/managed-by: kustomize
8+
app.kubernetes.io/name: workspaces-controller
9+
app.kubernetes.io/part-of: kubeflow-workspaces
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
apiVersion: v1
2+
kind: Namespace
3+
metadata:
4+
name: kubeflow-workspaces
5+
labels:
6+
istio-injection: enabled
7+
app.kubernetes.io/component: null
8+
app.kubernetes.io/name: null
9+
---
10+
apiVersion: apps/v1
11+
kind: Deployment
12+
metadata:
13+
name: workspaces-controller
14+
spec:
15+
template:
16+
metadata:
17+
annotations:
18+
sidecar.istio.io/inject: "false"

workspaces/controller/config/default/kustomization.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,6 @@
11
# Adds namespace to all resources.
22
namespace: kubeflow-workspaces
33

4-
labels:
5-
- includeSelectors: true
6-
pairs:
7-
app.kubernetes.io/managed-by: kustomize
8-
app.kubernetes.io/name: workspaces-controller
9-
app.kubernetes.io/part-of: kubeflow-workspaces
10-
114
resources:
125
- ../crd
136
- ../rbac
@@ -20,6 +13,9 @@ resources:
2013
# [PROMETHEUS] To enable prometheus monitor, uncomment all sections with 'PROMETHEUS'.
2114
#- ../prometheus
2215

16+
components:
17+
- components/common
18+
2319
patches:
2420
# [METRICS] The following patch will enable the metrics endpoint. Ensure that you also protect this endpoint.
2521
# More info: https://book.kubebuilder.io/reference/metrics
@@ -35,6 +31,10 @@ patches:
3531
# 'CERTMANAGER' needs to be enabled to use ca injection
3632
- path: webhookcainjection_patch.yaml
3733

34+
# [ISTIO] Enable Istion injection on the kubeflow-workspaces namespace but disable it for the controller deployment
35+
# to prevent webhook issues
36+
- path: istio_inject_patch.yaml
37+
3838
# [CERTMANAGER] To enable cert-manager, uncomment all sections with 'CERTMANAGER' prefix.
3939
# Uncomment the following replacements to add the cert-manager CA injection annotations
4040
replacements:

0 commit comments

Comments
 (0)