@@ -158,13 +158,33 @@ setup-kubernetes-job: k8s_fake_cluster generate_deployments_for_service
158
158
export PAASTA_TEST_CLUSTER=kind-${USER} -k8s-test; \
159
159
.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
160
160
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
+
161
168
.PHONY : paasta-secrets-sync
162
169
paasta-secrets-sync : setup-kubernetes-job .vault-token
163
170
export KUBECONFIG=./k8s_itests/kubeconfig; \
164
171
export PAASTA_SYSTEM_CONFIG_DIR=./etc_paasta_playground/; \
165
172
export PAASTA_TEST_CLUSTER=kind-${USER} -k8s-test; \
166
173
{ .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
167
174
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
+
168
188
.vault-token :
169
189
export VAULT_ADDR=https://vault-devc.yelpcorp.com:8200 ; \
170
190
export VAULT_SKIP_VERIFY=true ; \
0 commit comments