diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0151af5d2d52..02c9ef62e273 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,6 +8,8 @@ variables: DEMO_CLUSTER_NAME: prod-eks-otel-a-us-east-1 SANDBOX_CLUSTER_ARN: "arn:aws:eks:us-east-1:601427279990:cluster/dd-otel" DEMO_CLUSTER_ARN: "arn:aws:eks:us-east-1:172597598159:cluster/prod-eks-otel-a-us-east-1" + DEPLOY_SCRIPT: "./ci/scripts/ci-deploy.sh" + # BUILD STAGES stages: @@ -79,14 +81,13 @@ push-collector-image-staging: TEMP_AWS_SECRET_ACCESS_KEY=$(aws ssm get-parameter --region us-east-1 --name ci.opentelemetry-collector-contrib.sand-eks-deploy-access-key --with-decryption --query Parameter.Value --out text) - export AWS_ACCESS_KEY_ID=$TEMP_AWS_ACCESS_KEY_ID - export AWS_SECRET_ACCESS_KEY=$TEMP_AWS_SECRET_ACCESS_KEY - - bash $SCRIPT + - bash $DEPLOY_SCRIPT #env:otel-staging staging-deploy: !!merge <<: *staging-deploy variables: CLUSTER_NAME: $SANDBOX_CLUSTER_NAME CLUSTER_ARN: $SANDBOX_CLUSTER_ARN - SCRIPT: ./ci/scripts/ci-deploy-staging.sh NAMESPACE: otel-staging NODE_GROUP: ng-3 MODE: daemonset @@ -98,7 +99,6 @@ staging-deploy-gateway: variables: CLUSTER_NAME: $SANDBOX_CLUSTER_NAME CLUSTER_ARN: $SANDBOX_CLUSTER_ARN - SCRIPT: ./ci/scripts/ci-deploy-staging.sh NAMESPACE: otel-gateway NODE_GROUP: ng-5 MODE: deployment @@ -110,7 +110,6 @@ staging-deploy-ds-gateway: variables: CLUSTER_NAME: $SANDBOX_CLUSTER_NAME CLUSTER_ARN: $SANDBOX_CLUSTER_ARN - SCRIPT: ./ci/scripts/ci-deploy-staging.sh NAMESPACE: otel-ds-gateway NODE_GROUP: ng-6 MODE: deployment @@ -135,14 +134,13 @@ staging-deploy-ds-gateway: TEMP_AWS_SECRET_ACCESS_KEY=$(aws ssm get-parameter --region us-east-1 --name ci.opentelemetry-collector-contrib.eks_secret_access_key --with-decryption --query Parameter.Value --out text) - export AWS_ACCESS_KEY_ID=$TEMP_AWS_ACCESS_KEY_ID - export AWS_SECRET_ACCESS_KEY=$TEMP_AWS_SECRET_ACCESS_KEY - - bash $SCRIPT + - bash $DEPLOY_SCRIPT #env:otel prod-deploy: !!merge <<: *prod-deploy-demo-eks variables: CLUSTER_NAME: $DEMO_CLUSTER_NAME CLUSTER_ARN: $DEMO_CLUSTER_ARN - SCRIPT: ./ci/scripts/ci-deploy-staging.sh NAMESPACE: otel NODE_GROUP: MODE: daemonset diff --git a/ci/scripts/ci-deploy-demo.sh b/ci/scripts/ci-deploy-demo.sh deleted file mode 100644 index 934ab9b30591..000000000000 --- a/ci/scripts/ci-deploy-demo.sh +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/env bash - -# Copyright The OpenTelemetry Authors -# SPDX-License-Identifier: Apache-2.0 - -# This script is used to deploy collector on demo account cluster - -set -euo pipefail -IFS=$'\n\t' -set -x - -install_collector() { - # Set the namespace and release name - release_name="opentelemetry-collector" - namespace="otel" - - # if repo already exists, helm 3+ will skip - helm --debug repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts - - # --install will run `helm install` if not already present. - helm --debug upgrade "${release_name}" -n "${namespace}" open-telemetry/opentelemetry-collector --install \ - -f ./ci/values.yaml \ - --set-string image.tag="otelcolcontrib-v$CI_COMMIT_SHORT_SHA" -} - -########################################################################################################### -clusterName="prod-eks-otel-a-us-east-1" -clusterArn="arn:aws:eks:us-east-1:172597598159:cluster/${clusterName}" - -aws eks --region us-east-1 update-kubeconfig --name "${clusterName}" -kubectl config use-context "${clusterArn}" - -install_collector diff --git a/ci/scripts/ci-deploy-staging.sh b/ci/scripts/ci-deploy.sh similarity index 95% rename from ci/scripts/ci-deploy-staging.sh rename to ci/scripts/ci-deploy.sh index 4b86724a2290..65c286bac947 100644 --- a/ci/scripts/ci-deploy-staging.sh +++ b/ci/scripts/ci-deploy.sh @@ -33,7 +33,7 @@ install_collector() { --set replicaCount=${replicaCount}" if [ -n "$nodegroup" ]; then - helm_cmd+=" --set nodeSelector.alpha\\.eksctl\\.io/nodegroup-name=${nodegroup}" + helm_cmd+=" --set nodeSelector.\"alpha\\.eksctl\\.io/nodegroup-name\"=${nodegroup}" fi eval $helm_cmd