From f1cf6827c7adda5f28ebdb68fdb38377a23ff91f Mon Sep 17 00:00:00 2001 From: chainchad <96362174+chainchad@users.noreply.github.com> Date: Wed, 28 Feb 2024 17:40:43 -0500 Subject: [PATCH] Use kyverno label to set TTL for devspace initiated CRIB resources (#12209) --- charts/chainlink-cluster/devspace.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/charts/chainlink-cluster/devspace.yaml b/charts/chainlink-cluster/devspace.yaml index 338147675c5..54ee97db4da 100644 --- a/charts/chainlink-cluster/devspace.yaml +++ b/charts/chainlink-cluster/devspace.yaml @@ -37,7 +37,7 @@ pipelines: run_dependencies --all ensure_pull_secrets --all build_images ---var DOCKER_DEFAULT_PLATFORM=linux/amd64 --all -t $(git rev-parse --short HEAD) - kubectl annotate namespace ${DEVSPACE_NAMESPACE} janitor/ttl=${NS_TTL} || true + kubectl label namespace ${DEVSPACE_NAMESPACE} cleanup.kyverno.io/ttl=${NS_TTL} || true kubectl label namespace/${DEVSPACE_NAMESPACE} network=crib || true if [ -n "$1" ]; then echo "Deploying tag $1" @@ -71,7 +71,9 @@ pipelines: --set=helm.values.chainlink.nodes[3].image=$image \ --set=helm.values.chainlink.nodes[4].image=$image \ --set=helm.values.chainlink.nodes[5].image=$image + echo echo "Namespace ${DEVSPACE_NAMESPACE} will be deleted in ${NS_TTL}" + echo "To extend the TTL for e.g. 72 hours, run: devspace ttl ${DEVSPACE_NAMESPACE} 72h" echo echo "############################################" @@ -90,7 +92,7 @@ commands: connect: |- sudo kubefwd svc -n $1 ttl: |- - kubectl annotate namespace $1 janitor/ttl=$2 --overwrite + kubectl label namespace $1 cleanup.kyverno.io/ttl=$2 --overwrite images: app: