Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Daemonset => Gateway Setup #4376

Merged
merged 11 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 17 additions & 22 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ build-ci-image:
- TAG=ci-image-2
- docker build --file ci/Dockerfile.gitlab --tag $BUILD_DD_REGISTRY:$TAG .
- docker push $BUILD_DD_REGISTRY:$TAG
staging-deploy-gateway-eks:
.staging-deploy: &staging-deploy
stage: staging-deploy
tags: ["runner:docker", "size:large"]
image: $CI_IMAGE
Expand All @@ -79,28 +79,23 @@ staging-deploy-gateway-eks:
- export AWS_SECRET_ACCESS_KEY=$TEMP_AWS_SECRET_ACCESS_KEY
# # For debugging
# - aws sts get-caller-identity
- bash ./ci/scripts/ci-deploy-gateway.sh

- bash $SCRIPT $NAMESPACE $VALUES
staging-deploy-demo-eks:
stage: staging-deploy
tags: ["runner:docker", "size:large"]
image: $CI_IMAGE
dependencies:
- push-image-staging
rules:
- if: '$CI_COMMIT_REF_NAME =~ /-staging$/'
script:
# # For debugging
#- aws sts get-caller-identity
- >-
TEMP_AWS_ACCESS_KEY_ID=$(aws ssm get-parameter --region us-east-1 --name ci.opentelemetry-collector-contrib.sand-eks-deploy-api-key --with-decryption --query Parameter.Value --out text)
- >-
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
# # For debugging
# - aws sts get-caller-identity
- bash ./ci/scripts/ci-deploy-staging.sh
!!merge <<: *staging-deploy
variables:
SCRIPT: ./ci/scripts/ci-deploy-staging.sh
NAMESPACE: otel-staging
VALUES: ./ci/values-staging.yaml
staging-deploy-gateway-eks:
!!merge <<: *staging-deploy
variables:
SCRIPT: ./ci/scripts/ci-deploy-staging.sh
NAMESPACE: otel-gateway
VALUES: ./ci/values-gateway.yaml
staging-deploy-ds-gateway-eks:
!!merge <<: *staging-deploy
variables:
SCRIPT: ./ci/scripts/ci-deploy-ds-gateway.sh
prod-deploy-demo-eks:
stage: prod-deploy
tags: ["runner:docker", "size:large"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,24 @@ set -x
install_collector() {
# Set the namespace and release name
release_name="opentelemetry-collector"
namespace="otel-gateway"
release_name_gateway="opentelemetry-collector-gateway"
namespace="otel-ds-gateway"

# 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.
# gateway with DD exporter
helm --debug upgrade "${release_name_gateway}" -n "${namespace}" open-telemetry/opentelemetry-collector --install \
-f ./ci/values.yaml \
-f ./ci/values-ds-gateway.yaml \
--set-string image.tag="otelcolcontrib-v$CI_COMMIT_SHORT_SHA" \
--set-string image.repository="601427279990.dkr.ecr.us-east-1.amazonaws.com/otel-collector-contrib"

# daemonset with otlp exporter
helm --debug upgrade "${release_name}" -n "${namespace}" open-telemetry/opentelemetry-collector --install \
-f ./ci/values.yaml \
-f ./ci/values-gateway.yaml \
-f ./ci/values-otlp-col.yaml \
--set-string image.tag="otelcolcontrib-v$CI_COMMIT_SHORT_SHA" \
--set-string image.repository="601427279990.dkr.ecr.us-east-1.amazonaws.com/otel-collector-contrib"

Expand Down
6 changes: 3 additions & 3 deletions ci/scripts/ci-deploy-staging.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@
set -euo pipefail
IFS=$'\n\t'
set -x
namespace=$NAMESPACE
values=$VALUES

install_collector() {
# Set the namespace and release name
release_name="opentelemetry-collector"
namespace="otel-staging"

# 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 \
-f ./ci/values-staging.yaml \
-f "${values}" \
--set-string image.tag="otelcolcontrib-v$CI_COMMIT_SHORT_SHA" \
--set-string image.repository="601427279990.dkr.ecr.us-east-1.amazonaws.com/otel-collector-contrib"

Expand Down
11 changes: 11 additions & 0 deletions ci/values-ds-gateway.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
mode: deployment
replicaCount: 3
nodeSelector:
alpha.eksctl.io/nodegroup-name: ng-6
clusterRole:
name: "opentelemetry-collector-ds-gateway"
clusterRoleBinding:
name: opentelemetry-collector-ds-gateway
presets:
logsCollection:
enabled: false
1 change: 1 addition & 0 deletions ci/values-gateway.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
mode: deployment
replicaCount: 3
nodeSelector:
alpha.eksctl.io/nodegroup-name: ng-5
clusterRole:
Expand Down
25 changes: 25 additions & 0 deletions ci/values-otlp-col.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
nodeSelector:
alpha.eksctl.io/nodegroup-name: ng-6
clusterRole:
name: "opentelemetry-collector-ds"
clusterRoleBinding:
name: opentelemetry-collector-ds
config:
exporters:
otlp:
endpoint: opentelemetry-collector-gateway:4317
tls:
insecure: true
service:
pipelines:
metrics:
exporters: [otlp]
traces:
exporters: [otlp]
logs:
exporters: [otlp]
resources:
limits:
# necessary to decrease memory from 2 to 1 Gi in order to
# have sufficient memory to schedule all pods on Nodes.
memory: 1Gi
3 changes: 3 additions & 0 deletions ci/values-staging.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
nodeSelector:
alpha.eksctl.io/nodegroup-name: ng-3
presets:
logsCollection:
enabled: false
2 changes: 1 addition & 1 deletion ci/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ securityContext:
runAsGroup: 0
resources:
limits:
cpu: 256m
cpu: 512m
memory: 2Gi
presets:
logsCollection:
Expand Down
Loading