From 9571433073f49d6e0ffe83d78e319fbf034b1e60 Mon Sep 17 00:00:00 2001 From: Matheus Nogueira Date: Fri, 23 Aug 2024 10:17:34 -0300 Subject: [PATCH] fix: agent k8s deployment (#3983) --- k8s/agent/deploy-agent.sh | 10 ++++++++++ k8s/agent/deploy-agent.yaml | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/k8s/agent/deploy-agent.sh b/k8s/agent/deploy-agent.sh index daf1a8060c..8aa679856b 100755 --- a/k8s/agent/deploy-agent.sh +++ b/k8s/agent/deploy-agent.sh @@ -27,6 +27,7 @@ API_KEY="" AGENT_VERSION="latest" SKIP_VERIFY=false SERVER_URL="" +ENVIRONMENT="" POSITIONAL_ARGS=() @@ -41,6 +42,11 @@ while [[ $# -gt 0 ]]; do shift shift ;; + --environment) + ENVIRONMENT="$2" + shift + shift + ;; -h|--help) showUsageAndExit ;; @@ -83,6 +89,10 @@ if [ -n "$SERVER_URL" ]; then extraCmd+=("--server-url" "$SERVER_URL") fi +if [ -n "$ENVIRONMENT" ]; then + extraCmd+=("--environment" "$ENVIRONMENT") +fi + kubectl create -n $NAMESPACE secret generic tracetest-agent-secret --from-literal=api-key=$API_KEY curl $FILE_PATH \ diff --git a/k8s/agent/deploy-agent.yaml b/k8s/agent/deploy-agent.yaml index 13537db4c7..2e207e91f0 100644 --- a/k8s/agent/deploy-agent.yaml +++ b/k8s/agent/deploy-agent.yaml @@ -17,7 +17,7 @@ spec: containers: - name: tracetest-agent image: kubeshop/tracetest-agent:TAG - command: [EXTRA_CMD] + args: [EXTRA_CMD] env: - name: TRACETEST_API_KEY valueFrom: