Skip to content

Instantly share code, notes, and snippets.

@darcwader
Created November 25, 2021 18:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darcwader/fc617b021f03e2d0a63e3d65f063a82c to your computer and use it in GitHub Desktop.
Save darcwader/fc617b021f03e2d0a63e3d65f063a82c to your computer and use it in GitHub Desktop.
migration job makefile
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