Skip to content

fix for redhat-ods-applications network policy in RHOAI 2.19 #182

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion samples/job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ spec:
command: ["sh", "-c", "sleep 5"]
resources:
requests:
cpu: 1
cpu: 100m
2 changes: 1 addition & 1 deletion samples/pod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ spec:
command: ["sh", "-c", "sleep 5"]
resources:
requests:
cpu: 1
cpu: 100m
4 changes: 2 additions & 2 deletions samples/pytorchjob-in-appwrapper.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:
- "--epochs=1"
resources:
requests:
cpu: 1
cpu: 100m
Worker:
replicas: 1
restartPolicy: OnFailure
Expand All @@ -41,4 +41,4 @@ spec:
- "--epochs=1"
resources:
requests:
cpu: 1
cpu: 100m
4 changes: 2 additions & 2 deletions samples/pytorchjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ spec:
- "--epochs=1"
resources:
requests:
cpu: 1
cpu: 100m
Worker:
replicas: 1
restartPolicy: OnFailure
Expand All @@ -35,4 +35,4 @@ spec:
- "--epochs=1"
resources:
requests:
cpu: 1
cpu: 100m
2 changes: 1 addition & 1 deletion setup.RHOAI-v2.16/CLUSTER-SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ oc patch deployment -n scheduler-plugins --type=json --patch-file setup.RHOAI-v2
Create the Red Hat OpenShift AI subscription:
```sh
oc apply -f setup.RHOAI-v2.16/mlbatch-subscription.yaml
````
```
Identify install plan:
```sh
oc get ip -n redhat-ods-operator
Expand Down
6 changes: 5 additions & 1 deletion setup.RHOAI-v2.19/CLUSTER-SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ oc patch deployment -n scheduler-plugins --type=json --patch-file setup.RHOAI-v2
Create the Red Hat OpenShift AI subscription:
```sh
oc apply -f setup.RHOAI-v2.19/mlbatch-subscription.yaml
````
```
Create the mlbatch NetworkPolicy in the redhat-ods-applications namespace.
```sh
oc apply -f setup.RHOAI-v2.19/mlbatch-network-policy.yaml
```
Identify install plan:
```sh
oc get ip -n redhat-ods-operator
Expand Down
3 changes: 3 additions & 0 deletions setup.RHOAI-v2.19/UPGRADE-FAST.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@ kubectl delete crd multikueueconfigs.kueue.x-k8s.io

Next, update the MLBatch modifications to the default RHOAI configuration maps and subscription.
```sh
oc delete cm mlbatch-kuberay -n redhat-ods-operator
oc delete cm mlbatch-codeflare -n redhat-ods-operator
oc apply -f setup.RHOAI-v2.19/mlbatch-upgrade-configmaps.yaml
oc apply -f setup.RHOAI-v2.19/mlbatch-upgrade-fast-subscription.yaml
oc apply -f setup.RHOAI-v2.19/mlbatch-network-policy.yaml
```

Finally, you can approve the install plan replacing the example plan name below
Expand Down
3 changes: 3 additions & 0 deletions setup.RHOAI-v2.19/UPGRADE-STABLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@ kubectl delete crd multikueueconfigs.kueue.x-k8s.io

Next, update the MLBatch modifications to the default RHOAI configuration maps and subscription.
```sh
oc delete cm mlbatch-kuberay -n redhat-ods-operator
oc delete cm mlbatch-codeflare -n redhat-ods-operator
oc apply -f setup.RHOAI-v2.19/mlbatch-upgrade-configmaps.yaml
oc apply -f setup.RHOAI-v2.19/mlbatch-upgrade-stable-subscription.yaml
oc apply -f setup.RHOAI-v2.19/mlbatch-network-policy.yaml
```

Finally, you can approve the install plan replacing the example plan name below
Expand Down
25 changes: 25 additions & 0 deletions setup.RHOAI-v2.19/mlbatch-network-policy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
name: mlbatch-ods-applications
namespace: redhat-ods-applications
spec:
podSelector: {}
ingress:
- ports:
- protocol: TCP
port: 8443
- protocol: TCP
port: 8080
- protocol: TCP
port: 8081
- protocol: TCP
port: 5432
- protocol: TCP
port: 8082
- protocol: TCP
port: 8099
- protocol: TCP
port: 8181
- protocol: TCP
port: 9443 # default webhook of components
6 changes: 0 additions & 6 deletions setup.RHOAI-v2.19/mlbatch-subscription.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -175,19 +175,13 @@ spec:
env:
- name: "DISABLE_DSC_CONFIG"
volumeMounts:
- name: mlbatch-codeflare
mountPath: /opt/manifests/codeflare/manager/manager.yaml
subPath: manager.yaml
- name: mlbatch-kueue
mountPath: /opt/manifests/kueue/components/manager/controller_manager_config.yaml
subPath: controller_manager_config.yaml
- name: mlbatch-training-operator
mountPath: /opt/manifests/trainingoperator/rhoai/manager_config_patch.yaml
subPath: manager_config_patch.yaml
volumes:
- name: mlbatch-codeflare
configMap:
name: mlbatch-codeflare
- name: mlbatch-kueue
configMap:
name: mlbatch-kueue
Expand Down
6 changes: 0 additions & 6 deletions setup.RHOAI-v2.19/mlbatch-upgrade-fast-subscription.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,13 @@ spec:
env:
- name: "DISABLE_DSC_CONFIG"
volumeMounts:
- name: mlbatch-codeflare
mountPath: /opt/manifests/codeflare/manager/manager.yaml
subPath: manager.yaml
- name: mlbatch-kueue
mountPath: /opt/manifests/kueue/components/manager/controller_manager_config.yaml
subPath: controller_manager_config.yaml
- name: mlbatch-training-operator
mountPath: /opt/manifests/trainingoperator/rhoai/manager_config_patch.yaml
subPath: manager_config_patch.yaml
volumes:
- name: mlbatch-codeflare
configMap:
name: mlbatch-codeflare
- name: mlbatch-kueue
configMap:
name: mlbatch-kueue
Expand Down
6 changes: 0 additions & 6 deletions setup.RHOAI-v2.19/mlbatch-upgrade-stable-subscription.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,13 @@ spec:
env:
- name: "DISABLE_DSC_CONFIG"
volumeMounts:
- name: mlbatch-codeflare
mountPath: /opt/manifests/codeflare/manager/manager.yaml
subPath: manager.yaml
- name: mlbatch-kueue
mountPath: /opt/manifests/kueue/components/manager/controller_manager_config.yaml
subPath: controller_manager_config.yaml
- name: mlbatch-training-operator
mountPath: /opt/manifests/trainingoperator/rhoai/manager_config_patch.yaml
subPath: manager_config_patch.yaml
volumes:
- name: mlbatch-codeflare
configMap:
name: mlbatch-codeflare
- name: mlbatch-kueue
configMap:
name: mlbatch-kueue
Expand Down
8 changes: 7 additions & 1 deletion setup.tmpl/CLUSTER-SETUP.md.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,13 @@ Optionally, create a config map capturing your cluster's topology as described i
Create the Red Hat OpenShift AI subscription:
```sh
{{ .KUBECTL }} apply -f setup.{{ .VERSION }}/mlbatch-subscription.yaml
````
```
{{- if not (eq .VERSION "RHOAI-v2.16") }}
Create the mlbatch NetworkPolicy in the redhat-ods-applications namespace.
```sh
{{ .KUBECTL }} apply -f setup.{{ .VERSION }}/mlbatch-network-policy.yaml
```
{{- end }}
Identify install plan:
```sh
{{ .KUBECTL }} get ip -n redhat-ods-operator
Expand Down
9 changes: 9 additions & 0 deletions setup.tmpl/StepsToUpgrade.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Things to remember/do when updating RHOAI versions.

1. Clone setup directory from previous RHOAI release.
2. Inspect all files we are overlaying in mlbatch-subscription's
overlay of ODH and merge any upstream changes.
3. Replicate all subscription deltas in upgrade files and note in
UPGRADE steps.
4. Be sure to verify ready status of RHOAI operator, DSC and DSCI
in console to make sure the overlays were successfully applied.