Skip to content

Commit

Permalink
Update kustomization to use params env and yml on notebook-controller…
Browse files Browse the repository at this point in the history
… and odh-notebook-controller (#364)

* Update kustomization to use params env and yml on kfnc and odh-kfnc

* Apply change requests from pr review

* Adapt ci to take account the new parametrized changes from the kustomization files

* Add missing param.yml file on manager/kustomization.yaml file

* Remove comments on ci workflow
  • Loading branch information
atheo89 committed Jul 23, 2024
1 parent ee922b9 commit b8f58cc
Show file tree
Hide file tree
Showing 10 changed files with 43 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,10 @@ jobs:
run: |
set -x
cd components/odh-notebook-controller/config/default
cd components/odh-notebook-controller/config/base
kubectl create ns opendatahub
export CURRENT_NOTEBOOK_IMG=quay.io/opendatahub/odh-notebook-controller:latest
export PR_NOTEBOOK_IMG=localhost/${{env.IMG}}:${{env.TAG}}
kustomize edit set image ${CURRENT_NOTEBOOK_IMG}=${PR_NOTEBOOK_IMG}
echo "odh-notebook-controller-image=localhost/${{env.IMG}}:${{env.TAG}}" > params.env
cat <<EOF | oc apply -f -
---
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,27 @@ commonLabels:
app.kubernetes.io/part-of: odh-notebook-controller
component.opendatahub.io/name: kf-notebook-controller
opendatahub.io/component: "true"
images:
- name: docker.io/kubeflownotebookswg/notebook-controller
newName: quay.io/opendatahub/kubeflow-notebook-controller
newTag: 1.7-9f0db5d
configurations:
- params.yaml
configMapGenerator:
- name: kf-notebook-controller-image-parameters
env: params.env
- name: config
behavior: merge
literals:
- USE_ISTIO=false
- ADD_FSGROUP=false
generatorOptions:
disableNameSuffixHash: true
patchesStrategicMerge:
- remove_namespace_patch.yaml
- manager_openshift_patch.yaml
- manager_service_openshift_patch.yaml
vars:
- name: odh-kf-notebook-controller-image
objref:
kind: ConfigMap
name: kf-notebook-controller-image-parameters
apiVersion: v1
fieldref:
fieldpath: data.odh-kf-notebook-controller-image
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ spec:
name: notebook-controller-culler-config
key: IDLENESS_CHECK_PERIOD
optional: true
image: $(odh-kf-notebook-controller-image)
resources:
limits:
cpu: 500m
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
odh-kf-notebook-controller-image=quay.io/opendatahub/kubeflow-notebook-controller:1.7-35b81f5
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
varReference:
- path: spec/template/spec/containers/image
kind: Deployment
19 changes: 15 additions & 4 deletions components/odh-notebook-controller/config/base/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,18 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../default
images:
- name: quay.io/opendatahub/odh-notebook-controller
newName: quay.io/opendatahub/odh-notebook-controller
newTag: 1.7-9f0db5d

configMapGenerator:
- name: odh-notebook-controller-image-parameters
env: params.env
generatorOptions:
disableNameSuffixHash: true

vars:
- name: odh-notebook-controller-image
objref:
kind: ConfigMap
name: odh-notebook-controller-image-parameters
apiVersion: v1
fieldref:
fieldpath: data.odh-notebook-controller-image
1 change: 1 addition & 0 deletions components/odh-notebook-controller/config/base/params.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
odh-notebook-controller-image=quay.io/opendatahub/odh-notebook-controller:1.7-35b81f5
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ kind: Kustomization
resources:
- manager.yaml
- service.yaml
configurations:
- params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spec:
runAsNonRoot: true
containers:
- name: manager
image: quay.io/opendatahub/odh-notebook-controller:latest
image: $(odh-notebook-controller-image)
imagePullPolicy: Always
command:
- /manager
Expand Down
3 changes: 3 additions & 0 deletions components/odh-notebook-controller/config/manager/params.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
varReference:
- path: spec/template/spec/containers/image
kind: Deployment

0 comments on commit b8f58cc

Please sign in to comment.