Created
November 25, 2021 18:38
-
-
Save darcwader/fc617b021f03e2d0a63e3d65f063a82c to your computer and use it in GitHub Desktop.
migration job makefile
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
K:=kubectl | |
NS:=default | |
.PHONY: migrate | |
migrate: | |
$(K) apply -f migration/migration-job.yaml -n $(NS) | |
$(K) wait --for=condition=complete --timeout=300s jobs/mlserver-migration -n $(NS) | |
$(K) get job mlserver-migration -o "jsonpath={.metadata.labels.controller-uid}" -n $(NS) \ | |
| xargs -I {} $(K) get po -l controller-uid={} -o "jsonpath={.items[0].metadata.name}" -n $(NS) \ | |
| xargs -I {} $(K) logs {} -n $(NS) -c mlserver-django \ | |
| tee migration.log | |
$(K) delete -f migration/migration-job.yaml -n $(NS) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment