Created
January 14, 2026 13:58
-
-
Save jkremser/472e546e5452b97f6daad162f65319cf 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
| #!/usr/bin/env bash | |
| set -euo pipefail | |
| #AGENT_VERSION=pr-347 | |
| #AGENT_IMAGE=ghcr.io/kedify/agent-test | |
| #AGENT_IMAGE=docker.io/jkremser/agent | |
| AGENT_IMAGE=ghcr.io/kedify/agent | |
| # AGENT_VERSION=v0.2.22 | |
| AGENT_VERSION="" | |
| #AGENT_CHART=oci://ghcr.io/kedify/charts/kedify-agent | |
| AGENT_CHART=kedifykeda/kedify-agent | |
| AGENT_CHART_VERSION=v0.2.22 | |
| # KEDA_VERSION=v2.18.0-0 | |
| KEDA_VERSION="" | |
| # HTTP_ADDON_VERSION=v0.11.0-1 | |
| HTTP_ADDON_VERSION="" | |
| DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" | |
| [ -z ${AGENT_VERSION} ] && { | |
| AGENT_VERSION=$(crane ls ghcr.io/kedify/agent | grep -Eo '.*\.\d+$' | fzf --tac --header "Agent version") | |
| AGENT_CHART_VERSION=${AGENT_VERSION} | |
| } | |
| [ -z ${KEDA_VERSION} ] && { | |
| KEDA_VERSION=$(crane ls ghcr.io/kedify/keda-operator | grep -Eo '.*\.\d+-\d+$' | fzf --tac --header "KEDA version") | |
| } | |
| [ -z ${HTTP_ADDON_VERSION} ] && { | |
| HTTP_ADDON_VERSION=$(crane ls ghcr.io/kedify/http-add-on-operator | grep -Eo '.*\.\d+-\d+$' | fzf --tac --header "HTTP addon version") | |
| } | |
| _server=$(echo -e "dev\nlocal\nprod" | fzf) | |
| [ "${_server}" = "local" ] && { | |
| KEDIFY_SERVER="192.168.84.6:50051" | |
| ORG="**" | |
| API_KEY="kfy_**" | |
| } | |
| [ "${_server}" = "dev" ] && { | |
| KEDIFY_SERVER="kedify-proxy.api.dev.kedify.io:443" | |
| ORG="**" | |
| API_KEY="kfy_**" | |
| } | |
| [ "${_server}" = "prod" ] && { | |
| KEDIFY_SERVER="service.kedify.io:443" | |
| ORG="**" | |
| API_KEY="kfy_**" | |
| } | |
| _scale_agent_to_zero=$(echo -e "no\nyes" | fzf --header "Scale agent to 0?") | |
| _use_local_helm_chart=$(echo -e "no\nyes" | fzf --header "Use local helmchart?") | |
| [ "${_use_local_helm_chart}" = "yes" ] && AGENT_CHART="$WORKSPACE/kedify/charts-fork/kedify-agent" | |
| echo "Local k3d deployment using ${_server} Kedify Server (api-svcs)" | lolcat | |
| echo -e "--\nStarting k3d..\n--" | lolcat | |
| k3d cluster delete || true 2> /dev/null | |
| sleep .5 | |
| k3d cluster create | |
| echo -e "--\nImporting images..\n--" | lolcat | |
| for i in ghcr.io/kedify/keda-operator:${KEDA_VERSION} \ | |
| ghcr.io/kedify/http-add-on-scaler:${HTTP_ADDON_VERSION} \ | |
| ghcr.io/kedify/http-add-on-interceptor:${HTTP_ADDON_VERSION} \ | |
| ghcr.io/kedify/keda-admission-webhooks:${KEDA_VERSION} \ | |
| ghcr.io/kedify/keda-operator:${KEDA_VERSION} \ | |
| ghcr.io/kedify/keda-metrics-apiserver:${KEDA_VERSION} \ | |
| ${AGENT_IMAGE}:${AGENT_VERSION} \ | |
| ; do | |
| echo Pulling image: $i | |
| docker pull $i | |
| echo Importing image: $i | |
| # k3d image import $i | |
| done | |
| echo -e "--\nImages imported\n--" | lolcat | |
| # CRDs | |
| # kubectl apply -f https://raw.githubusercontent.com/kedacore/keda/refs/heads/main/config/crd/bases/keda.sh_scaledobjects.yaml | |
| # kubectl apply -f https://raw.githubusercontent.com/kedacore/keda/refs/heads/main/config/crd/bases/keda.sh_scaledjobs.yaml --server-side | |
| # kubectl apply -f https://raw.githubusercontent.com/kedacore/keda/refs/heads/main/config/crd/bases/keda.sh_clustertriggerauthentications.yaml | |
| # kubectl apply -f https://raw.githubusercontent.com/kedacore/keda/refs/heads/main/config/crd/bases/keda.sh_riggerauthentications.yaml | |
| # kubectl apply -f https://raw.githubusercontent.com/kedacore/http-add-on/refs/heads/main/config/crd/bases/http.keda.sh_httpscaledobjects.yaml | |
| helm repo update kedifykeda | |
| echo -e "--\nHelminstalling KEDA..\n--" | lolcat -S 32 -p 1.5 | |
| helm upgrade --install keda kedifykeda/keda --namespace keda --create-namespace --version ${KEDA_VERSION} --values "$DIR"/values_keda.yaml | |
| echo -e "--\nKEDA installed\n--" | lolcat -S 32 -p 1.5 | |
| echo -e "--\nHelminstalling HTTP ADDON..\n--" | lolcat -S 32 -p 1.5 | |
| helm upgrade --install keda-add-ons-http kedifykeda/keda-add-ons-http --namespace keda --create-namespace --version ${HTTP_ADDON_VERSION} --values "$DIR"/values_addon.yaml | |
| echo -e "--\nHTTP ADDON installed\n--" | lolcat -S 32 -p 1.5 | |
| echo -e "--\nHelminstalling Kedify Agent..\n--" | lolcat -S 32 -p 1.5 | |
| # PROD | |
| #helm upgrade --install kedify-agent kedifykeda/kedify-agent --namespace keda --values "$DIR"/values_agent.yaml --version v0.0.11 --set clusterName=test-helm-$(head /dev/urandom | sha1sum | cut -c1-8) | |
| #exit | |
| # DEV | |
| set -x | |
| helm upgrade -i kedify-agent ${AGENT_CHART} --version=${AGENT_CHART_VERSION} -nkeda --create-namespace --set clusterName=test-helm-$(head /dev/urandom | shasum | cut -c1-8) \ | |
| --set agent.orgId=${ORG} \ | |
| --set agent.apiKey=${API_KEY} \ | |
| --set agent.kedifyServer=${KEDIFY_SERVER} \ | |
| --set agent.logging.level=10 \ | |
| --set agent.image.repository=${AGENT_IMAGE} \ | |
| --set agent.image.tag=${AGENT_VERSION} | |
| set +x | |
| echo -e "--\nAgent installed\n--" | lolcat -S 32 -p 1.5 | |
| [ "${_scale_agent_to_zero}" = "yes" ] && kubectl scale deployment -n keda kedify-agent --replicas 0 | |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://asciinema.org/a/767924