Skip to content

Commit b5b9a7b

Browse files
juliusvonkohouttzstoyanovAnna
authored
Rootless Kubeflow (#2455)
* Proof of concept * remove legacy stuff * Update README.md * Upgrade istio to 1.18.1 The istio package is upgraded to the latest stable version, 1.18.1. This upgrade is needed for running Kubeflow with rootless containers, as there are a lot of improvements in the latest istio version for that. Signed-off-by: Tzvetomir Stoyanov (VMware) <[email protected]> * Remove legacy stuff in 1.18 * Update istio 1.17.3 documentation and enable patches * restore 1.6 and add knative-local-gateway comment * Update kustomization.yaml * Update disable-debugging.yaml * Update kustomization.yaml * update to istio 1.17.5 * fix patches * kustomize is unhappy... * one patch per file * Update istio-ingressgateway-remove-pdb.yaml * Update kustomization.yaml * Add istio 1.17.5 CNI installation A new installation option is added, which installs istio 1.17.5 in CNI mode. Signed-off-by: Tzvetomir Stoyanov (VMware) <[email protected]> * delete istio-cni-1-16 * Update disable-debugging.yaml * add --set components.cni.enabled=true --set components.cni.namespace=kube-system to readme commandline * add tests for istio-cni * move PSP and PSS to /contrib * Use default CPU resources When installing istio in CNI mode, do not force custom CPU resources for: values.global.proxy.resources.requests.cpu Signed-off-by: Tzvetomir Stoyanov (VMware) <[email protected]> * Update README.md * Do not install istio in one namespace There is a namespace kustomization of istio core installation, which overwrites the namespace of all istio base components to istio-system. However, depending on the use case not all of those components must be in the same namespace. That's why the namespace kustomization is removed. Signed-off-by: Tzvetomir Stoyanov (VMware) <[email protected]> * Add github action for Istio CNI testing The new action should be triggered manually. Signed-off-by: Tzvetomir Stoyanov (VMware) <[email protected]> * readd istiod-remove-pdb * we will do /contrib changes in a new PR with capital one * Trigger Istio CNI github action on PR The Istio CNI functionality is still experimental, that's why the github action is triggered manually for now. Added an automatic trigger as well - on every PR that uses ISTIO CNI code. Signed-off-by: Tzvetomir Stoyanov (VMware) <[email protected]> * Update tests/gh-actions/install_knative-cni.sh Co-authored-by: Anna <[email protected]> * Change the trigger for the Istio CNI github action Trigger the test on every PR which changes istio-cni code only. Signed-off-by: Tzvetomir Stoyanov (VMware) <[email protected]> * Update README.md rename to istio-cni --------- Signed-off-by: Tzvetomir Stoyanov (VMware) <[email protected]> Co-authored-by: Tzvetomir Stoyanov (VMware) <[email protected]> Co-authored-by: Tzvetomir Stoyanov (VMware) <[email protected]> Co-authored-by: Anna <[email protected]>
1 parent c43feba commit b5b9a7b

40 files changed

+14141
-1902
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Build & Apply KServe manifests in KinD, using istio CNI
2+
on:
3+
pull_request:
4+
paths:
5+
- common/istio-cni-1-17/**
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v3
13+
14+
- name: Install KinD
15+
run: ./tests/gh-actions/install_kind.sh
16+
17+
- name: Create KinD Cluster
18+
run: kind create cluster --config tests/gh-actions/kind-cluster.yaml
19+
20+
- name: Install kustomize
21+
run: ./tests/gh-actions/install_kustomize.sh
22+
23+
- name: Create kubeflow namespace
24+
run: kustomize build common/kubeflow-namespace/base | kubectl apply -f -
25+
26+
- name: Install Istio CNI
27+
run: ./tests/gh-actions/install_istio-cni.sh
28+
29+
- name: Install cert-manager
30+
run: ./tests/gh-actions/install_cert_manager.sh
31+
32+
- name: Install knative CNI
33+
run: ./tests/gh-actions/install_knative-cni.sh
34+
35+
- name: Build & Apply manifests
36+
run: ./tests/gh-actions/install_kserve.sh
37+
38+
- name: Create test namespace
39+
run: kubectl create ns kserve-test
40+
41+
- name: Setup python 3.9
42+
uses: actions/setup-python@v4
43+
with:
44+
python-version: 3.9
45+
46+
- name: Install test dependencies
47+
run: pip install -r ./contrib/kserve/tests/requirements.txt
48+
49+
- name: Port forward
50+
run: |
51+
INGRESS_GATEWAY_SERVICE=$(kubectl get svc --namespace istio-system --selector="app=istio-ingressgateway" --output jsonpath='{.items[0].metadata.name}')
52+
nohup kubectl port-forward --namespace istio-system svc/${INGRESS_GATEWAY_SERVICE} 8080:80 &
53+
54+
- name: Run kserve tests
55+
run: |
56+
export KSERVE_INGRESS_HOST_PORT=localhost:8080
57+
cd ./contrib/kserve/tests && pytest .
58+
59+
- name: Run kserve models webapp test
60+
run: |
61+
kubectl wait --for=condition=Available --timeout=300s -n kubeflow deployment/kserve-models-web-app

common/istio-1-16/istio-install/base/kustomization.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,4 @@ patchesStrategicMerge:
1616
- patches/disable-debugging.yaml
1717
# Disable this patch until we upgrade to kustomize to v4+
1818
# see https://github.com/kubeflow/manifests/issues/2325#issuecomment-1323909056
19-
# - patches/remove-pdb.yaml
20-
19+
# - patches/remove-pdb.yaml

common/istio-1-17/README.md

+10-37
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,22 @@ In this section, we explain how to upgrade our istio kustomize packages
88
by leveraging `istioctl`. Assuming the new version is `X.Y.Z` and the
99
old version is `X1.Y1.Z1`:
1010

11-
1. Make a copy of the old istio manifests tree, which will become the
11+
1. Make a copy of the old istio manifests tree, which will become the
1212
kustomization for the new Istio version:
1313

1414
$ export MANIFESTS_SRC=<path/to/manifests/repo>
1515
$ export ISTIO_OLD=$MANIFESTS_SRC/common/istio-X1-Y1
1616
$ export ISTIO_NEW=$MANIFESTS_SRC/common/istio-X-Y
1717
$ cp -a $ISTIO_OLD $ISTIO_NEW
1818

19-
2. Download `istioctl` for version `X.Y.Z`:
19+
2. Download `istioctl` for version `X.Y.Z`:
2020

2121
$ ISTIO_VERSION="X.Y.Z"
2222
$ wget "https://github.com/istio/istio/releases/download/${ISTIO_VERSION}/istio-${ISTIO_VERSION}-linux-amd64.tar.gz"
2323
$ tar xvfz istio-${ISTIO_VERSION}-linux-amd64.tar.gz
2424
# sudo mv istio-${ISTIO_VERSION}/bin/istioctl /usr/local/bin/istioctl
2525

26-
3. Use `istioctl` to generate an `IstioOperator` resource, the
26+
3. Use `istioctl` to generate an `IstioOperator` resource, the
2727
CustomResource used to describe the Istio Control Plane:
2828

2929
$ cd $ISTIO_NEW
@@ -32,13 +32,12 @@ old version is `X1.Y1.Z1`:
3232
---
3333
**NOTE**
3434

35-
`istioctl` comes with a bunch of [predefined
36-
profiles](https://istio.io/v1.9/docs/setup/additional-setup/config-profiles/)
35+
`istioctl` comes with a bunch of [predefined profiles](https://istio.io/latest/docs/setup/additional-setup/config-profiles/)
3736
(`default`, `demo`, `minimal`, etc.). The `default` profile is installed by default.
3837

3938
---
4039

41-
4. Generate manifests and add them to their respective packages. We
40+
4. Generate manifests and add them to their respective packages. We
4241
will generate manifests using `istioctl`, the
4342
`profile.yaml` file from upstream and the
4443
`profile-overlay.yaml` file that contains our desired
@@ -51,6 +50,7 @@ old version is `X1.Y1.Z1`:
5150
$ mv $ISTIO_NEW/crd.yaml $ISTIO_NEW/istio-crds/base
5251
$ mv $ISTIO_NEW/install.yaml $ISTIO_NEW/istio-install/base
5352
$ mv $ISTIO_NEW/cluster-local-gateway.yaml $ISTIO_NEW/cluster-local-gateway/base
53+
$ rm dump.yaml
5454

5555
---
5656
**NOTE**
@@ -62,45 +62,17 @@ old version is `X1.Y1.Z1`:
6262
detect default settings. Ensure you have a target cluster ready before running the above commands.
6363
We set this flag because `istioctl manifest generate` generates manifest files with resources that are no
6464
longer supported in Kubernetes 1.25 (`policy/v1beta1`). See: https://github.com/istio/istio/issues/41220
65-
65+
6666
---
6767

68-
5. Remove PodDisruptionBudget from `istio-install` and `cluster-local-gateway` kustomizations.
69-
See https://github.com/istio/istio/issues/12602 and https://github.com/istio/istio/issues/24000
70-
71-
Until now we have used two patches:
72-
- `common/istio-1-17/istio-install/base/patches/remove-pdb.yaml`
73-
- `common/istio-1-17/cluster-local-gateway/base/patches/remove-pdb.yaml`
74-
75-
The above patches do not work with kustomize v3.2.0 as it doesn't have the appropriate
76-
openapi schemas for the policy/v1 API version resources. This is fixed in kustomize v4+.
77-
See https://github.com/kubernetes-sigs/kustomize/issues/3694#issuecomment-799700607 and
78-
https://github.com/kubernetes-sigs/kustomize/issues/4495
79-
80-
A temporary workaround is to use the following instructions to manually delete the PodDisruptionBudget resources with `yq`:
81-
82-
$ yq eval -i 'select((.kind == "PodDisruptionBudget" and .metadata.name == "cluster-local-gateway") | not)' common/istio-1-17/cluster-local-gateway/base/cluster-local-gateway.yaml
83-
$ yq eval -i 'select((.kind == "PodDisruptionBudget" and .metadata.name == "istio-ingressgateway") | not)' common/istio-1-17/istio-install/base/install.yaml
84-
$ yq eval -i 'select((.kind == "PodDisruptionBudget" and .metadata.name == "istiod") | not)' common/istio-1-17/istio-install/base/install.yaml
85-
86-
---
87-
**NOTE**
88-
89-
NOTE: Make sure to remove a redundant {} at the end of the `common/istio-1-17/istio-install/base/install.yaml` and `common/istio-1-17/cluster-local-gateway/base/cluster-local-gateway.yaml` files.
90-
91-
---
92-
93-
6. Remove `dump.yaml`
94-
9568
## Changes to Istio's upstream manifests
9669

9770
### Changes to the upstream IstioOperator profile
9871

9972
Changes to Istio's upstream profile `default` are the following:
10073

101-
- Add a `cluster-local-gateway` component for KFServing.
102-
- Disable the EgressGateway component. We don't use it and it adds
103-
unnecessary complexity.
74+
- Add a `cluster-local-gateway` component for Kserve. Knative-local-gateway is now obsolete https://github.com/kubeflow/manifests/pull/2355/commits/adc00b804404ea08685a044ae595be0bed9adb59.
75+
- Disable the EgressGateway component. We do not use it and it adds unnecessary complexity.
10476

10577
Those changes are captured in the [profile-overlay.yaml](profile-overlay.yaml)
10678
file.
@@ -120,3 +92,4 @@ The Istio kustomizations make the following changes:
12092
- Configure TCP KeepAlives.
12193
- Disable tracing as it causes DNS breakdown. See:
12294
https://github.com/istio/istio/issues/29898
95+
- Set ENABLE_DEBUG_ON_HTTP=false according to https://istio.io/latest/docs/ops/best-practices/security/#control-plane

0 commit comments

Comments
 (0)