Skip to content

Commit bbd937f

Browse files
committed
added paasta-crons make target
1 parent d4be194 commit bbd937f

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ general_itests/fake_etc_paasta/clusters.json
5050
pip-wheel-metadata
5151
debian/debhelper-build-stamp
5252
unique-run
53+
.vault-token
5354

5455
# Coverage artifacts
5556
.coverage

Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,33 @@ setup-kubernetes-job: k8s_fake_cluster generate_deployments_for_service
158158
export PAASTA_TEST_CLUSTER=kind-${USER}-k8s-test;\
159159
.tox/py38-linux/bin/python -m paasta_tools.list_kubernetes_service_instances -d ./soa_config_playground --shuffle --group-lines 1 | xargs --no-run-if-empty .tox/py38-linux/bin/python -m paasta_tools.setup_kubernetes_job -d ./soa_config_playground -c kind-${USER}-k8s-test
160160

161+
.PHONY: cleanup-kubernetes-jobs
162+
cleanup-kubernetes-jobs:
163+
export KUBECONFIG=./k8s_itests/kubeconfig;\
164+
export PAASTA_SYSTEM_CONFIG_DIR=./etc_paasta_playground/;\
165+
export PAASTA_TEST_CLUSTER=kind-${USER}-k8s-test;\
166+
.tox/py38-linux/bin/python -m paasta_tools.cleanup_kubernetes_jobs -d ./soa_config_playground -c kind-${USER}-k8s-test --force
167+
161168
.PHONY: paasta-secrets-sync
162169
paasta-secrets-sync: setup-kubernetes-job .vault-token
163170
export KUBECONFIG=./k8s_itests/kubeconfig;\
164171
export PAASTA_SYSTEM_CONFIG_DIR=./etc_paasta_playground/;\
165172
export PAASTA_TEST_CLUSTER=kind-${USER}-k8s-test;\
166173
{ .tox/py38-linux/bin/python -m paasta_tools.list_kubernetes_service_instances -d ./soa_config_playground ; echo -n \ _shared; } | cut -f1 -d"." | uniq | shuf | xargs .tox/py38-linux/bin/python -m paasta_tools.kubernetes.bin.paasta_secrets_sync -v -d ./soa_config_playground -t ./.vault-token
167174

175+
define ANNOUNCE_CRONS_BODY
176+
The following PaaSTA cron jobs will run on an infinite loop using the PaaSTA Playground k8s cluster:
177+
- setup-kubernetes-job
178+
- cleanup-kubernetes-job
179+
- paasta-secrets-sync
180+
- generate_deployments_for_service
181+
endef
182+
export ANNOUNCE_CRONS_BODY
183+
.PHONY: paasta-crons
184+
make paasta-cronjobs:
185+
@echo "$$ANNOUNCE_CRONS_BODY"
186+
while true; do make paasta-secrets-sync && make cleanup-kubernetes-jobs; sleep 5; done
187+
168188
.vault-token:
169189
export VAULT_ADDR=https://vault-devc.yelpcorp.com:8200 ;\
170190
export VAULT_SKIP_VERIFY=true ;\

0 commit comments

Comments
 (0)