Skip to content

Commit

Permalink
Use kyverno label to set TTL for devspace initiated CRIB resources (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
chainchad authored Feb 28, 2024
1 parent dcbf564 commit f1cf682
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions charts/chainlink-cluster/devspace.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 "############################################"
Expand All @@ -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:
Expand Down

0 comments on commit f1cf682

Please sign in to comment.