Skip to content

Commit fead601

Browse files
authored
Change kubectl user from cluster-admin to system:admin
Updated kubectl command to use 'system:admin' instead of 'cluster-admin'.
1 parent e7ef765 commit fead601

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/modules/ROOT/pages/framework/backfill_billing.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ In accordance to the https://git.vshn.net/aline.abler/scriptofdoom[scriptofdoom.
1313
while read -r cronjob rest
1414
do
1515
echo $cronjob
16-
kubectl --as cluster-admin -n syn-appcat create job --from cronjob/$cronjob $cronjob --dry-run -oyaml | yq e '.spec.template.spec.containers[0].args[0] = "appuio-reporting report --timerange 1h --begin=$(date -d \"now -12 hours\" -u +\"%Y-%m-%dT%H:00:00Z\") --repeat-until=$(date -u +\"%Y-%m-%dT%H:00:00Z\")"' | kubectl --as cluster-admin apply -f -
17-
done <<< "$(kubectl --as cluster-admin -n syn-appcat get cronjobs.batch --no-headers)"
16+
kubectl --as=system:admin -n syn-appcat create job --from cronjob/$cronjob $cronjob --dry-run -oyaml | yq e '.spec.template.spec.containers[0].args[0] = "appuio-reporting report --timerange 1h --begin=$(date -d \"now -12 hours\" -u +\"%Y-%m-%dT%H:00:00Z\") --repeat-until=$(date -u +\"%Y-%m-%dT%H:00:00Z\")"' | kubectl --as=system:admin apply -f -
17+
done <<< "$(kubectl --as=system:admin -n syn-appcat get cronjobs.batch --no-headers)"
1818
----
1919

2020
This will loop over all the billing cronjobs in the `syn-appcat`, create a new job from them and replace the args with whatever we want.

0 commit comments

Comments
 (0)