From 55226ef3eb5ba25d9da6ea4e27cf55c2e4621538 Mon Sep 17 00:00:00 2001 From: Frank Ang Date: Wed, 29 Nov 2023 16:34:59 +0800 Subject: [PATCH] eks-fargate-otel deploy to fargate in mixed ec2+fargate cluster --- .../cx-eks-fargate-otel-self-monitoring.yaml | 5 ++++- otel-eks-fargate/cx-eks-fargate-otel.yaml | 12 ++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/otel-eks-fargate/cx-eks-fargate-otel-self-monitoring.yaml b/otel-eks-fargate/cx-eks-fargate-otel-self-monitoring.yaml index fb20902c..8f0b9242 100644 --- a/otel-eks-fargate/cx-eks-fargate-otel-self-monitoring.yaml +++ b/otel-eks-fargate/cx-eks-fargate-otel-self-monitoring.yaml @@ -147,4 +147,7 @@ spec: items: - key: cx-otel-collector-monitor-config path: cx-otel-collector-monitor-config.yaml - name: cx-otel-collector-monitor-config-volume \ No newline at end of file + name: cx-otel-collector-monitor-config-volume + nodeSelector: + eks.amazonaws.com/compute-type: fargate + kubernetes.io/os: linux diff --git a/otel-eks-fargate/cx-eks-fargate-otel.yaml b/otel-eks-fargate/cx-eks-fargate-otel.yaml index 21d7f18c..98c1ecf5 100644 --- a/otel-eks-fargate/cx-eks-fargate-otel.yaml +++ b/otel-eks-fargate/cx-eks-fargate-otel.yaml @@ -53,15 +53,16 @@ metadata: data: label-node-script: | #!/bin/bash - + set +x # Download kubectl # If the latest stable version is not compatible with your cluster, adjust accordingly. - curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" + curl -LOs "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" # Give execute permissions to kubectl chmod +x kubectl - # Run the command to label nodes + # Label only the current node as the OTEL-collector-node + ./kubectl label nodes --all OTEL-collector-node- ./kubectl label nodes $K8S_NODE_NAME OTEL-collector-node=true --- # ConfigMap for OTEL collector instance @@ -279,4 +280,7 @@ spec: items: - key: label-node-script path: label_node.sh - mode: 0555 \ No newline at end of file + mode: 0555 + nodeSelector: + eks.amazonaws.com/compute-type: fargate + kubernetes.io/os: linux