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: