Skip to content

Commit cf8449c

Browse files
committed
Use kustomize to patch deployments before deploy
1 parent 4ccb047 commit cf8449c

File tree

3 files changed

+37
-13
lines changed

3 files changed

+37
-13
lines changed

scripts/deploy/github/deploy-kfp.sh

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ then
3232
exit $EXIT_CODE
3333
fi
3434

35-
PLATFORM_AGNOSTIC_MANIFESTS="manifests/kustomize/env/platform-agnostic"
35+
PLATFORM_AGNOSTIC_MANIFESTS="scripts/deploy/github/manifests/test"
3636

3737
kubectl apply -k "${PLATFORM_AGNOSTIC_MANIFESTS}" || EXIT_CODE=$?
3838
if [[ $EXIT_CODE -ne 0 ]]
@@ -41,18 +41,6 @@ then
4141
exit 1
4242
fi
4343

44-
echo "Patching deployments to use built docker images..."
45-
# Patch API server
46-
kubectl patch deployment ml-pipeline -p '{"spec": {"template": {"spec": {"containers": [{"name": "ml-pipeline-api-server", "image": "kind-registry:5000/apiserver"}]}}}}' -n kubeflow
47-
# Patch persistence agent
48-
kubectl patch deployment.apps/ml-pipeline-persistenceagent -p '{"spec": {"template": {"spec": {"containers": [{"name": "ml-pipeline-persistenceagent", "image": "kind-registry:5000/persistenceagent"}]}}}}' -n kubeflow
49-
# Patch scheduled workflow
50-
kubectl patch deployment.apps/ml-pipeline-scheduledworkflow -p '{"spec": {"template": {"spec": {"containers": [{"name": "ml-pipeline-scheduledworkflow", "image": "kind-registry:5000/scheduledworkflow"}]}}}}' -n kubeflow
51-
52-
# Update environment variables to override driver / launcher
53-
kubectl set env deployments/ml-pipeline V2_DRIVER_IMAGE=kind-registry:5000/driver -n kubeflow
54-
kubectl set env deployments/ml-pipeline V2_LAUNCHER_IMAGE=kind-registry:5000/launcher -n kubeflow
55-
5644
# Check if all pods are running - (10 minutes)
5745
wait_for_pods || EXIT_CODE=$?
5846
if [[ $EXIT_CODE -ne 0 ]]
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
apiVersion: kustomize.config.k8s.io/v1beta1
2+
kind: Kustomization
3+
4+
resources:
5+
- ../../../../../manifests/kustomize/env/platform-agnostic
6+
7+
images:
8+
- name: gcr.io/ml-pipeline/api-server
9+
newName: kind-registry:5000/apiserver
10+
newTag: latest
11+
- name: gcr.io/ml-pipeline/persistenceagent
12+
newName: kind-registry:5000/persistenceagent
13+
newTag: latest
14+
- name: gcr.io/ml-pipeline/scheduledworkflow
15+
newName: kind-registry:5000/scheduledworkflow
16+
newTag: latest
17+
18+
patchesStrategicMerge:
19+
- overlays/apiserver-env.yaml
20+
21+
# This in ~/manifests?
22+
# Other file?
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: ml-pipeline
5+
spec:
6+
template:
7+
spec:
8+
containers:
9+
- name: ml-pipeline-api-server
10+
env:
11+
- name: V2_DRIVER_IMAGE
12+
value: kind-registry:5000/driver
13+
- name: V2_LAUNCHER_IMAGE
14+
value: kind-registry:5000/launcher

0 commit comments

Comments
 (0)