Created
January 6, 2023 02:33
-
-
Save wpcarro/408bf92b19e08e99ddbda17500c8ed3f to your computer and use it in GitHub Desktop.
Dispatch command to k8s
This file contains 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
apiVersion: batch/v1 | |
kind: Job | |
metadata: | |
name: foo-command | |
spec: | |
ttlSecondsAfterFinished: 60 | |
template: | |
spec: | |
containers: | |
- name: foo-command | |
image: production_command | |
imagePullPolicy: "Never" | |
command: "$COMMAND" | |
restartPolicy: Never |
This file contains 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
#!/usr/bin/env bash | |
# Install this somewhere on PATH as runcmd, and invoke like so: | |
# USAGE: runcmd foo --flag=true --force path/to/file | |
COMMAND="$@" envsubst -no-unset -no-empty <command.yaml.tmpl | kubectl apply -f - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment