Skip to content

Instantly share code, notes, and snippets.

@joejulian
Created April 16, 2021 22:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joejulian/c970b9b92546b26b6c287fde7d3ebdbc to your computer and use it in GitHub Desktop.
Save joejulian/c970b9b92546b26b6c287fde7d3ebdbc to your computer and use it in GitHub Desktop.
#!/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