Skip to content

Commit

Permalink
Add performance overlay and sync deployment to odh-manifest
Browse files Browse the repository at this point in the history
  • Loading branch information
lucferbux committed Aug 1, 2023
1 parent 3216f87 commit 21a3d26
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 13 deletions.
1 change: 1 addition & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ DOC_LINK ='https://opendatahub.io/docs.html'
COMMUNITY_LINK ='https://opendatahub.io/community.html'
ENABLED_APPS_CM = 'odh-enabled-applications-config'
KUSTOMIZE_MANIFEST_DIR=manifests
KUSTOMIZE_DEFAULT_OVERLAY=/overlays/dev
DASHBOARD_CONFIG = 'odh-dashboard-config'
8 changes: 4 additions & 4 deletions install/deploy.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
printf "\n\n######## deploy ########\n"
printf "\n\n######## deploy overlay ${KUSTOMIZE_DEFAULT_OVERLAY} ########\n"

KUSTOMIZE_MANIFEST_DIR_OVERLAY_DEV="${KUSTOMIZE_MANIFEST_DIR}/overlays/dev"
KUSTOMIZE_MANIFEST_DIR_OVERLAY="${KUSTOMIZE_MANIFEST_DIR}${KUSTOMIZE_DEFAULT_OVERLAY}"

if [[ -z "${OC_PROJECT}" ]]; then
echo "ERROR: No value defined for OC_PROJECT env var"
Expand All @@ -19,7 +19,7 @@ oc config set-context --current --namespace=${OC_PROJECT}
oc label namespace ${OC_PROJECT} openshift.io/cluster-monitoring='true' --overwrite

# Deploy dashboard manifests using kustomize
pushd ${KUSTOMIZE_MANIFEST_DIR_OVERLAY_DEV}
pushd ${KUSTOMIZE_MANIFEST_DIR_OVERLAY}
kustomize edit set namespace ${OC_PROJECT}
kustomize edit set image quay.io/opendatahub/odh-dashboard=${IMAGE_REPOSITORY}
if [[ ! -z "${OAUTH_IMAGE_REPOSITORY}" ]]; then
Expand All @@ -28,4 +28,4 @@ fi
popd

# Use kustomize to build the yaml objects so we get full support for all the kustomize standards
kustomize build ${KUSTOMIZE_MANIFEST_DIR_OVERLAY_DEV} | oc apply -f -
kustomize build ${KUSTOMIZE_MANIFEST_DIR_OVERLAY} | oc apply -f -
8 changes: 4 additions & 4 deletions install/undeploy.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
printf "\n\n######## undeploy ########\n"
printf "\n\n######## undeploy overlay ${KUSTOMIZE_DEFAULT_OVERLAY} ########\n"

KUSTOMIZE_MANIFEST_DIR_OVERLAY_DEV="${KUSTOMIZE_MANIFEST_DIR}/overlays/dev"
KUSTOMIZE_MANIFEST_DIR_OVERLAY="${KUSTOMIZE_MANIFEST_DIR}${KUSTOMIZE_DEFAULT_OVERLAY}"

if [[ -z "${OC_PROJECT}" ]]; then
echo "ERROR: No value defined for OC_PROJECT env var"
Expand All @@ -19,9 +19,9 @@ oc config set-context --current --namespace=${OC_PROJECT}
oc label namespace ${OC_PROJECT} openshift.io/cluster-monitoring-

# Uninstall dashboard using kustomize
pushd ${KUSTOMIZE_MANIFEST_DIR_OVERLAY_DEV}
pushd ${KUSTOMIZE_MANIFEST_DIR_OVERLAY}
kustomize edit set namespace ${OC_PROJECT}
popd

# Use kustomize to build the yaml objects so we get full support for all the kustomize standards
kustomize build ${KUSTOMIZE_MANIFEST_DIR_OVERLAY_DEV} | oc delete --ignore-not-found=true -f -
kustomize build ${KUSTOMIZE_MANIFEST_DIR_OVERLAY} | oc delete --ignore-not-found=true -f -
2 changes: 1 addition & 1 deletion manifests/base/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Deployment
metadata:
name: odh-dashboard
spec:
replicas: 5
replicas: 2
selector:
matchLabels:
deployment: odh-dashboard
Expand Down
6 changes: 2 additions & 4 deletions manifests/kfdef/odh-dashboard-kfnbc-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,8 @@ spec:
name: odh-notebook-controller
- kustomizeConfig:
overlays:
# Uncomment the odhdashboard overlay below to have the operator deploy the configs
# This should be removed from the deployed kfdef immediately after the operator deploys the configs
# This will prevent the operator from reconciling the configs when they have been modified externally
#- odhdashboardconfig
# Uncomment the performance overlay below to have the operator deploy more dashboard replicas
#- performance
repoRef:
name: manifests-dashboard # Use the odh-dashboard repo as the source for this kustomize manifest
path: manifests
Expand Down
3 changes: 3 additions & 0 deletions manifests/overlays/performance/deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- op: replace
path: /spec/replicas
value: 5
11 changes: 11 additions & 0 deletions manifests/overlays/performance/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
bases:
- ../../base
patchesJson6902:
- path: deployment.yaml
target:
group: apps
version: v1
kind: Deployment
name: odh-dashboard

0 comments on commit 21a3d26

Please sign in to comment.