Skip to content

Commit b42b80d

Browse files
committed
fix
1 parent 2da8460 commit b42b80d

File tree

2 files changed

+35
-24
lines changed

2 files changed

+35
-24
lines changed

.gitlab-ci.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ staging-deploy-otel-demo-eks:
229229
NAMESPACE: otel-staging
230230
VALUES:
231231
NODE_GROUP: ng-3
232-
SCRIPT: ./ci/scripts/ci-deploy-demo-staging.sh
232+
SCRIPT: ./ci/scripts/ci-deploy-demo.sh
233233
CLUSTER_NAME: dd-otel
234234
CLUSTER_ARN: "arn:aws:eks:us-east-1:601427279990:cluster/dd-otel"
235235
REGION: us-east-1
@@ -244,7 +244,7 @@ staging-deploy-otel-ingest-demo-eks:
244244
NAMESPACE: otel-ingest-staging
245245
VALUES:
246246
NODE_GROUP: ng-4
247-
SCRIPT: ./ci/scripts/ci-deploy-demo-staging.sh
247+
SCRIPT: ./ci/scripts/ci-deploy-demo.sh
248248
CLUSTER_NAME: dd-otel
249249
CLUSTER_ARN: "arn:aws:eks:us-east-1:601427279990:cluster/dd-otel"
250250
REGION: us-east-1
@@ -259,7 +259,7 @@ staging-deploy-gateway-demo-eks:
259259
NAMESPACE: otel-gateway
260260
VALUES: ./ci/values-gateway.yaml
261261
NODE_GROUP: ng-5
262-
SCRIPT: ./ci/scripts/ci-deploy-demo-staging.sh
262+
SCRIPT: ./ci/scripts/ci-deploy-demo.sh
263263
CLUSTER_NAME: dd-otel
264264
CLUSTER_ARN: "arn:aws:eks:us-east-1:601427279990:cluster/dd-otel"
265265
REGION: us-east-1
@@ -274,7 +274,7 @@ staging-deploy-ds-gateway-demo-eks:
274274
NAMESPACE: otel-ds-gateway
275275
VALUES:
276276
NODE_GROUP: ng-6
277-
SCRIPT: ./ci/scripts/ci-deploy-demo-staging.sh
277+
SCRIPT: ./ci/scripts/ci-deploy-demo.sh
278278
CLUSTER_NAME: dd-otel
279279
CLUSTER_ARN: "arn:aws:eks:us-east-1:601427279990:cluster/dd-otel"
280280
REGION: us-east-1
@@ -289,7 +289,7 @@ staging-deploy-dd-ingest-demo-eks:
289289
NAMESPACE: dd-ingest-staging
290290
VALUES:
291291
NODE_GROUP: ng-7
292-
SCRIPT: ./ci/scripts/ci-deploy-demo-staging.sh
292+
SCRIPT: ./ci/scripts/ci-deploy-demo.sh
293293
CLUSTER_NAME: dd-otel
294294
CLUSTER_ARN: "arn:aws:eks:us-east-1:601427279990:cluster/dd-otel"
295295
REGION: us-east-1

ci/scripts/ci-deploy-demo.sh

+30-19
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,45 @@ set -euo pipefail
99
IFS=$'\n\t'
1010
set -x
1111

12-
clusterName=$1
13-
clusterArn=$2
14-
region=$3
15-
namespace=$4
12+
clusterName=$CLUSTER_NAME
13+
clusterArn=$CLUSTER_ARN
14+
region=$REGION
15+
namespace=$NAMESPACE
16+
nodeGroup=$NODE_GROUP
17+
values=$VALUES
18+
zookeeper_deployment=$ZOOKEEPER_DEPLOYMENT
19+
orderproducer_deployment=$ORDERPRODUCER_DEPLOYMENT
20+
registry=$REGISTRY
1621

1722
install_demo() {
18-
# Set the namespace and release name
1923
release_name="opentelemetry-demo"
2024

21-
# Deploy zookeeper which is not a default component.
22-
kubectl apply -f ./src/zookeeperservice/deployment.yaml -n "${namespace}"
23-
24-
# if repo already exists, helm 3+ will skip
25-
helm --debug repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts
26-
27-
# --install will run `helm install` if not already present.
28-
helm --debug upgrade "${release_name}" -n "${namespace}" open-telemetry/opentelemetry-demo --install \
25+
# HELM COMMAND
26+
helm_cmd="helm --debug upgrade ${release_name} -n ${namespace} open-telemetry/opentelemetry-demo --install \
2927
-f ./ci/values.yaml \
30-
--set-string default.image.tag="v$CI_COMMIT_SHORT_SHA"
31-
32-
# Deploy java order producer which is not a default component.
33-
sed -i "s/PLACEHOLDER_COMMIT_SHA/v$CI_COMMIT_SHORT_SHA/g" ./src/orderproducerservice/deployment.yaml
34-
kubectl apply -f ./src/orderproducerservice/deployment.yaml -n "${namespace}"
28+
--set-string default.image.tag="v$CI_COMMIT_SHORT_SHA" \
29+
--set-string default.image.repository=${REGISTRY}"
30+
31+
# REPLACEMENTS
32+
if [ -n "$nodeGroup" ]; then
33+
# sed -i "s/PLACEHOLDER_NODE_GROUP/$nodeGroup/g" ./src/zookeeperservice/${zookeeper_deployment}
34+
# sed -i "s/PLACEHOLDER_NODE_GROUP/$nodeGroup/g" ./src/orderproducerservice/${orderproducer_deployment}
35+
helm_cmd+=" --set default.schedulingRules.nodeSelector.\"alpha\\.eksctl\\.io/nodegroup-name\"=${nodeGroup}"
36+
fi
37+
if [ -n "$values" ]; then
38+
helm_cmd+=" -f $values"
39+
fi
40+
41+
# COMMANDS
42+
kubectl apply -f ./src/zookeeperservice/${zookeeper_deployment} -n "${namespace}"
43+
helm --debug repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts
44+
eval $helm_cmd
45+
kubectl apply -f ./src/orderproducerservice/${orderproducer_deployment} -n "${namespace}"
3546
}
3647

3748
###########################################################################################################
3849

3950
aws eks --region "${region}" update-kubeconfig --name "${clusterName}"
4051
kubectl config use-context "${clusterArn}"
4152

42-
install_demo
53+
install_demo

0 commit comments

Comments
 (0)