Created
April 16, 2021 22:28
-
-
Save joejulian/c970b9b92546b26b6c287fde7d3ebdbc to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
# ' 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