Created
April 16, 2021 22:28
-
-
Save joejulian/03bb3411701de4ad0c8e40b963bddc19 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
set -euo pipefail | |
EXPIRATION="${1:-8h}" | |
TEMPFILE=$(mktemp) | |
yq -Y '. | ( | |
select(.kind == "ClusterProvisioner") | | |
.spec.aws.tags.expiration = "'"${EXPIRATION}"'"),( | |
select(.kind != "ClusterProvisioner") | | |
.spec.addons[].addonsList |= | |
map( | |
if .name=="traefik" then .values = | |
({"service": {"annotations": { "service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags" : "owner=ksphere-daily,expiration=24h"}}} | tojson) | |
else . | |
end | |
) | |
) | |
' cluster.yaml > "${TEMPFILE}" | |
mv "${TEMPFILE}" cluster.yaml |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment