From d32f472208dba62722806009a7b6ea417aa04161 Mon Sep 17 00:00:00 2001 From: Ljubisa Gacevic Date: Tue, 14 Oct 2025 15:25:27 +0200 Subject: [PATCH 1/2] chore: add traefik-config.yaml --- beelocal.sh | 41 +++++++++++++++++++++++++++++++++++++- config/k3d.yaml | 2 +- config/traefik-config.yaml | 14 +++++++++++++ 3 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 config/traefik-config.yaml diff --git a/beelocal.sh b/beelocal.sh index d34bed0..00ef1de 100755 --- a/beelocal.sh +++ b/beelocal.sh @@ -111,6 +111,7 @@ config() { trap 'rm -rf ${BEE_TEMP}' EXIT curl -sSL https://raw.githubusercontent.com/ethersphere/beelocal/"${BEELOCAL_BRANCH}"/config/k3d.yaml -o "${BEE_TEMP}"/k3d.yaml curl -sSL https://raw.githubusercontent.com/ethersphere/beelocal/"${BEELOCAL_BRANCH}"/config/geth-swap.yaml -o "${BEE_TEMP}"/geth-swap.yaml + curl -sSL https://raw.githubusercontent.com/ethersphere/beelocal/"${BEELOCAL_BRANCH}"/config/traefik-config.yaml -o "${BEE_TEMP}"/traefik-config.yaml if [[ -n $CI ]]; then curl -sSL https://raw.githubusercontent.com/ethersphere/beelocal/"${BEELOCAL_BRANCH}"/hack/registries.yaml -o "${BEE_TEMP}"/registries.yaml sudo cp "${BEE_TEMP}"/registries.yaml /etc/rancher/k3s/registries.yaml @@ -189,6 +190,7 @@ k8s-local() { until kubectl get svc traefik -n kube-system &> /dev/null; do sleep 1; done # Wait for geth wait + configure-traefik echo "cluster running..." } @@ -257,6 +259,43 @@ geth() { fi } +configure-traefik() { + if [[ -z $BEE_CONFIG ]]; then + config + fi + echo "configuring Traefik with custom timeouts..." + + # Check for valid config files in order of preference + local config_file="" + + # First try local config file + if [[ -f "./config/traefik-config.yaml" ]] && grep -q "apiVersion:" "./config/traefik-config.yaml"; then + config_file="./config/traefik-config.yaml" + echo "Using local traefik-config.yaml" + # Then try temp config file if it's valid + elif [[ -f "${BEE_CONFIG}/traefik-config.yaml" ]] && grep -q "apiVersion:" "${BEE_CONFIG}/traefik-config.yaml"; then + config_file="${BEE_CONFIG}/traefik-config.yaml" + echo "Using downloaded traefik-config.yaml" + fi + + if [[ -n "$config_file" ]]; then + kubectl apply -f "$config_file" || echo "Warning: Failed to apply Traefik config" + echo "waiting for Traefik to restart with new configuration..." + kubectl rollout restart deployment/traefik -n kube-system || echo "Warning: Failed to restart Traefik" + kubectl rollout status deployment/traefik -n kube-system --timeout=120s || echo "Warning: Traefik rollout status check failed" + echo "Traefik configuration applied successfully" + echo "Current Traefik timeout settings:" + kubectl describe deployment traefik -n kube-system | grep -E "entryPoints.*timeout" || echo "No timeout settings found in deployment description" + else + echo "Info: No valid Traefik config file found, using default timeouts" + echo "Looked for valid configs in: ${BEE_CONFIG}/traefik-config.yaml and ./config/traefik-config.yaml" + # Don't exit with error when called from k8s-local, just use defaults + if [[ "${FUNCNAME[1]}" != "k8s-local" ]]; then + exit 1 + fi + fi +} + stop() { if [[ -n $CI ]]; then echo "action not supported for CI" @@ -338,7 +377,7 @@ for OPT in $OPTS; do fi done -ACTIONS=(build check destroy geth install k8s-local uninstall start stop run prepare add-hosts del-hosts) +ACTIONS=(build check destroy geth install k8s-local uninstall start stop run prepare add-hosts del-hosts configure-traefik) if [[ " ${ACTIONS[*]} " == *"$ACTION"* ]]; then if [[ $ACTION == "run" ]]; then check diff --git a/config/k3d.yaml b/config/k3d.yaml index aa6f4a5..3b01e44 100644 --- a/config/k3d.yaml +++ b/config/k3d.yaml @@ -1,4 +1,4 @@ -apiVersion: k3d.io/v1alpha4 +apiVersion: k3d.io/v1alpha5 kind: Simple metadata: name: bee diff --git a/config/traefik-config.yaml b/config/traefik-config.yaml new file mode 100644 index 0000000..9912867 --- /dev/null +++ b/config/traefik-config.yaml @@ -0,0 +1,14 @@ +apiVersion: helm.cattle.io/v1 +kind: HelmChartConfig +metadata: + name: traefik + namespace: kube-system +spec: + valuesContent: |- + additionalArguments: + - "--entryPoints.web.transport.respondingTimeouts.readTimeout=300s" + - "--entryPoints.web.transport.respondingTimeouts.writeTimeout=300s" + - "--entryPoints.web.transport.respondingTimeouts.idleTimeout=300s" + - "--entryPoints.websecure.transport.respondingTimeouts.readTimeout=300s" + - "--entryPoints.websecure.transport.respondingTimeouts.writeTimeout=300s" + - "--entryPoints.websecure.transport.respondingTimeouts.idleTimeout=300s" From 5229572521a6ca477f5238197bc4bb035ea9ea4d Mon Sep 17 00:00:00 2001 From: Ljubisa Gacevic Date: Tue, 14 Oct 2025 15:32:27 +0200 Subject: [PATCH 2/2] chore: modify script --- beelocal.sh | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/beelocal.sh b/beelocal.sh index 00ef1de..61e5d8f 100755 --- a/beelocal.sh +++ b/beelocal.sh @@ -265,14 +265,11 @@ configure-traefik() { fi echo "configuring Traefik with custom timeouts..." - # Check for valid config files in order of preference local config_file="" - # First try local config file if [[ -f "./config/traefik-config.yaml" ]] && grep -q "apiVersion:" "./config/traefik-config.yaml"; then config_file="./config/traefik-config.yaml" echo "Using local traefik-config.yaml" - # Then try temp config file if it's valid elif [[ -f "${BEE_CONFIG}/traefik-config.yaml" ]] && grep -q "apiVersion:" "${BEE_CONFIG}/traefik-config.yaml"; then config_file="${BEE_CONFIG}/traefik-config.yaml" echo "Using downloaded traefik-config.yaml" @@ -285,11 +282,10 @@ configure-traefik() { kubectl rollout status deployment/traefik -n kube-system --timeout=120s || echo "Warning: Traefik rollout status check failed" echo "Traefik configuration applied successfully" echo "Current Traefik timeout settings:" - kubectl describe deployment traefik -n kube-system | grep -E "entryPoints.*timeout" || echo "No timeout settings found in deployment description" + kubectl describe deployment traefik -n kube-system | grep -E "entryPoints.*Timeout" || echo "No timeout settings found in deployment description" else echo "Info: No valid Traefik config file found, using default timeouts" echo "Looked for valid configs in: ${BEE_CONFIG}/traefik-config.yaml and ./config/traefik-config.yaml" - # Don't exit with error when called from k8s-local, just use defaults if [[ "${FUNCNAME[1]}" != "k8s-local" ]]; then exit 1 fi