From c8b9f79a59874418deb167ab62a86fd8e1816368 Mon Sep 17 00:00:00 2001 From: siprmp Date: Tue, 5 Mar 2024 12:10:41 -0500 Subject: [PATCH 01/47] adding python and java simultaneous instrumentation --- .../workflows/operator-integration-test.yml | 32 ++++++++++++++++--- ...trumentation_pythonjava_env_variables.json | 17 ++++++++++ .../sample-deployment-pythonjava.yaml | 21 ++++++++++++ 3 files changed, 65 insertions(+), 5 deletions(-) create mode 100644 integration-tests/pythonjava/default_instrumentation_pythonjava_env_variables.json create mode 100644 integration-tests/pythonjava/sample-deployment-pythonjava.yaml diff --git a/.github/workflows/operator-integration-test.yml b/.github/workflows/operator-integration-test.yml index 03a89341a..a79e51f75 100644 --- a/.github/workflows/operator-integration-test.yml +++ b/.github/workflows/operator-integration-test.yml @@ -39,10 +39,10 @@ jobs: run: kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.12.0/cert-manager.yaml -# - name: Verify minikube and cert-manager -# run: | -# sleep 10 -# kubectl get pods -A + # - name: Verify minikube and cert-manager + # run: | + # sleep 10 + # kubectl get pods -A - name: Build image run: | @@ -51,7 +51,7 @@ jobs: docker images - name: Deploy operator to minikube - run: | + run: | make deploy - name: Test case for AmazonCloudWatchAgent pod creation @@ -110,3 +110,25 @@ jobs: cd integration-tests/manifests/cmd go run validate_instrumentation_vars.go default ns_instrumentation_env_variables.json kubectl delete instrumentation sample-instrumentation + - name: Test for default instrumentation resources for python and java + run: | + kubectl apply -f integration-tests/pythonjava/sample-deployment-pythonjava.yaml + sleep 5 + kubectl rollout restart deployment nginx + sleep 5 + kubectl get pods -A + kubectl describe pods -n default + go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/pythonjava/default_instrumentation_pythonjava_env_variables.json + + + - name: Test for defined instrumentation resources for python and java + run: | + kubectl apply -f integration-tests/manifests/sample-instrumentation.yaml + sleep 5 + kubectl rollout restart deployment nginx + sleep 5 + kubectl get pods -A + kubectl describe pods -n default + cd integration-tests/manifests/cmd + go run validate_instrumentation_vars.go default ns_instrumentation_env_variables.json + kubectl delete instrumentation sample-instrumentation \ No newline at end of file diff --git a/integration-tests/pythonjava/default_instrumentation_pythonjava_env_variables.json b/integration-tests/pythonjava/default_instrumentation_pythonjava_env_variables.json new file mode 100644 index 000000000..24451a5e6 --- /dev/null +++ b/integration-tests/pythonjava/default_instrumentation_pythonjava_env_variables.json @@ -0,0 +1,17 @@ + +{ + "PYTHONPATH": "/otel-auto-instrumentation-python/opentelemetry/instrumentation/auto_instrumentation:/otel-auto-instrumentation-python", + "OTEL_AWS_APP_SIGNALS_ENABLED": "true", + "OTEL_TRACES_SAMPLER_ARG": "endpoint=http://cloudwatch-agent.amazon-cloudwatch:2000", + "OTEL_TRACES_SAMPLER": "xray", + "OTEL_EXPORTER_OTLP_PROTOCOL": "http/protobuf", + "OTEL_EXPORTER_OTLP_TRACES_ENDPOINT": "http://cloudwatch-agent.amazon-cloudwatch:4316/v1/traces", + "OTEL_AWS_APP_SIGNALS_EXPORTER_ENDPOINT": "http://cloudwatch-agent.amazon-cloudwatch:4315", + "OTEL_METRICS_EXPORTER": "none", + "OTEL_PYTHON_DISTRO": "aws_distro", + "OTEL_PYTHON_CONFIGURATOR": "aws_configurator", + "OTEL_SMP_ENABLED": "true", + "OTEL_AWS_SMP_EXPORTER_ENDPOINT": "http://cloudwatch-agent.amazon-cloudwatch:4315", + "JAVA_TOOL_OPTIONS": "-javaagent:/otel-auto-instrumentation-java/javaagent.jar" + +} \ No newline at end of file diff --git a/integration-tests/pythonjava/sample-deployment-pythonjava.yaml b/integration-tests/pythonjava/sample-deployment-pythonjava.yaml new file mode 100644 index 000000000..91d9c7a8c --- /dev/null +++ b/integration-tests/pythonjava/sample-deployment-pythonjava.yaml @@ -0,0 +1,21 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: nginx +spec: + selector: + matchLabels: + app: nginx + template: + metadata: + labels: + app: nginx + annotations: + instrumentation.opentelemetry.io/inject-python: "true" + instrumentation.opentelemetry.io/inject-java: "true" + spec: + containers: + - name: nginx + image: nginx:1.14.2 + restartPolicy: Always +status: {} \ No newline at end of file From 5e815493f801e4c2a00a22e4585115bbaa7674ca Mon Sep 17 00:00:00 2001 From: siprmp Date: Tue, 5 Mar 2024 13:14:31 -0500 Subject: [PATCH 02/47] removing wrong env var --- .../default_instrumentation_pythonjava_env_variables.json | 1 - 1 file changed, 1 deletion(-) diff --git a/integration-tests/pythonjava/default_instrumentation_pythonjava_env_variables.json b/integration-tests/pythonjava/default_instrumentation_pythonjava_env_variables.json index 24451a5e6..6e8917075 100644 --- a/integration-tests/pythonjava/default_instrumentation_pythonjava_env_variables.json +++ b/integration-tests/pythonjava/default_instrumentation_pythonjava_env_variables.json @@ -3,7 +3,6 @@ "PYTHONPATH": "/otel-auto-instrumentation-python/opentelemetry/instrumentation/auto_instrumentation:/otel-auto-instrumentation-python", "OTEL_AWS_APP_SIGNALS_ENABLED": "true", "OTEL_TRACES_SAMPLER_ARG": "endpoint=http://cloudwatch-agent.amazon-cloudwatch:2000", - "OTEL_TRACES_SAMPLER": "xray", "OTEL_EXPORTER_OTLP_PROTOCOL": "http/protobuf", "OTEL_EXPORTER_OTLP_TRACES_ENDPOINT": "http://cloudwatch-agent.amazon-cloudwatch:4316/v1/traces", "OTEL_AWS_APP_SIGNALS_EXPORTER_ENDPOINT": "http://cloudwatch-agent.amazon-cloudwatch:4315", From d1df896697adb0df2cbd2ecaf5dcd5a87a22e053 Mon Sep 17 00:00:00 2001 From: siprmp Date: Tue, 5 Mar 2024 13:35:48 -0500 Subject: [PATCH 03/47] removing more wrong env vars --- helm/values.yaml | 4 ++-- .../default_instrumentation_pythonjava_env_variables.json | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/helm/values.yaml b/helm/values.yaml index 1b4ecef8d..2d3935819 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -12,10 +12,10 @@ nameOverride: "" imagePullSecrets: [ ] ## Provide the ClusterName (optional parameter, if not provided, a generated name will be used) -clusterName: +clusterName: pythonandjavacluster ## Provide the Region (this is a required parameter) -region: +region: us-west-2 containerLogs: enabled: true diff --git a/integration-tests/pythonjava/default_instrumentation_pythonjava_env_variables.json b/integration-tests/pythonjava/default_instrumentation_pythonjava_env_variables.json index 6e8917075..4bc0ad655 100644 --- a/integration-tests/pythonjava/default_instrumentation_pythonjava_env_variables.json +++ b/integration-tests/pythonjava/default_instrumentation_pythonjava_env_variables.json @@ -2,9 +2,7 @@ { "PYTHONPATH": "/otel-auto-instrumentation-python/opentelemetry/instrumentation/auto_instrumentation:/otel-auto-instrumentation-python", "OTEL_AWS_APP_SIGNALS_ENABLED": "true", - "OTEL_TRACES_SAMPLER_ARG": "endpoint=http://cloudwatch-agent.amazon-cloudwatch:2000", "OTEL_EXPORTER_OTLP_PROTOCOL": "http/protobuf", - "OTEL_EXPORTER_OTLP_TRACES_ENDPOINT": "http://cloudwatch-agent.amazon-cloudwatch:4316/v1/traces", "OTEL_AWS_APP_SIGNALS_EXPORTER_ENDPOINT": "http://cloudwatch-agent.amazon-cloudwatch:4315", "OTEL_METRICS_EXPORTER": "none", "OTEL_PYTHON_DISTRO": "aws_distro", From 99cacf8ab4f931b4828860d4474261fb3883f62f Mon Sep 17 00:00:00 2001 From: siprmp Date: Tue, 5 Mar 2024 13:58:12 -0500 Subject: [PATCH 04/47] removing more wrong env vars --- .../default_instrumentation_pythonjava_env_variables.json | 1 - 1 file changed, 1 deletion(-) diff --git a/integration-tests/pythonjava/default_instrumentation_pythonjava_env_variables.json b/integration-tests/pythonjava/default_instrumentation_pythonjava_env_variables.json index 4bc0ad655..f81099253 100644 --- a/integration-tests/pythonjava/default_instrumentation_pythonjava_env_variables.json +++ b/integration-tests/pythonjava/default_instrumentation_pythonjava_env_variables.json @@ -1,6 +1,5 @@ { - "PYTHONPATH": "/otel-auto-instrumentation-python/opentelemetry/instrumentation/auto_instrumentation:/otel-auto-instrumentation-python", "OTEL_AWS_APP_SIGNALS_ENABLED": "true", "OTEL_EXPORTER_OTLP_PROTOCOL": "http/protobuf", "OTEL_AWS_APP_SIGNALS_EXPORTER_ENDPOINT": "http://cloudwatch-agent.amazon-cloudwatch:4315", From de3166774d660fa8a28dadd676590b1128230b7e Mon Sep 17 00:00:00 2001 From: siprmp Date: Tue, 5 Mar 2024 15:34:36 -0500 Subject: [PATCH 05/47] adding python and java instrumentation --- helm/values.yaml | 4 ++-- .../default_instrumentation_pythonjava_env_variables.json | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/helm/values.yaml b/helm/values.yaml index 2d3935819..1b4ecef8d 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -12,10 +12,10 @@ nameOverride: "" imagePullSecrets: [ ] ## Provide the ClusterName (optional parameter, if not provided, a generated name will be used) -clusterName: pythonandjavacluster +clusterName: ## Provide the Region (this is a required parameter) -region: us-west-2 +region: containerLogs: enabled: true diff --git a/integration-tests/pythonjava/default_instrumentation_pythonjava_env_variables.json b/integration-tests/pythonjava/default_instrumentation_pythonjava_env_variables.json index f81099253..24451a5e6 100644 --- a/integration-tests/pythonjava/default_instrumentation_pythonjava_env_variables.json +++ b/integration-tests/pythonjava/default_instrumentation_pythonjava_env_variables.json @@ -1,7 +1,11 @@ { + "PYTHONPATH": "/otel-auto-instrumentation-python/opentelemetry/instrumentation/auto_instrumentation:/otel-auto-instrumentation-python", "OTEL_AWS_APP_SIGNALS_ENABLED": "true", + "OTEL_TRACES_SAMPLER_ARG": "endpoint=http://cloudwatch-agent.amazon-cloudwatch:2000", + "OTEL_TRACES_SAMPLER": "xray", "OTEL_EXPORTER_OTLP_PROTOCOL": "http/protobuf", + "OTEL_EXPORTER_OTLP_TRACES_ENDPOINT": "http://cloudwatch-agent.amazon-cloudwatch:4316/v1/traces", "OTEL_AWS_APP_SIGNALS_EXPORTER_ENDPOINT": "http://cloudwatch-agent.amazon-cloudwatch:4315", "OTEL_METRICS_EXPORTER": "none", "OTEL_PYTHON_DISTRO": "aws_distro", From 6eb5353077cc0286aed98d8dda481d05103f7646 Mon Sep 17 00:00:00 2001 From: siprmp Date: Tue, 5 Mar 2024 15:47:16 -0500 Subject: [PATCH 06/47] adding python and java instrumentation --- helm/values.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/helm/values.yaml b/helm/values.yaml index 1b4ecef8d..20c960cad 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -21,10 +21,10 @@ containerLogs: enabled: true fluentBit: image: - repository: aws-for-fluent-bit - tag: 2.31.12.20230911 + repository: cwagent-operator-pre-release + tag: latest repositoryDomainMap: - public: public.ecr.aws/aws-observability + public: 506463145083.dkr.ecr.us-west-2.amazonaws.com cn-north-1: 128054284489.dkr.ecr.cn-north-1.amazonaws.com.cn cn-northwest-1: 128054284489.dkr.ecr.cn-northwest-1.amazonaws.com.cn us-gov-east-1: 161423150738.dkr.ecr.us-gov-east-1.amazonaws.com @@ -35,10 +35,10 @@ containerLogs: manager: name: image: - repository: cloudwatch-agent-operator - tag: 1.0.2 + repository: cwagent-operator-pre-release + tag: latest repositoryDomainMap: - public: public.ecr.aws/cloudwatch-agent + public: 506463145083.dkr.ecr.us-west-2.amazonaws.com cn-north-1: 934860584483.dkr.ecr.cn-north-1.amazonaws.com.cn cn-northwest-1: 934860584483.dkr.ecr.cn-northwest-1.amazonaws.com.cn us-gov-east-1: 743662458514.dkr.ecr.us-gov-east-1.amazonaws.com @@ -137,10 +137,10 @@ admissionWebhooks: agent: name: image: - repository: cloudwatch-agent - tag: 1.300031.1b317 + repository: cwagent-operator-pre-release + tag: latest repositoryDomainMap: - public: public.ecr.aws/cloudwatch-agent + public: 506463145083.dkr.ecr.us-west-2.amazonaws.com cn-north-1: 934860584483.dkr.ecr.cn-north-1.amazonaws.com.cn cn-northwest-1: 934860584483.dkr.ecr.cn-northwest-1.amazonaws.com.cn us-gov-east-1: 743662458514.dkr.ecr.us-gov-east-1.amazonaws.com From 2f27137cc8a291a1d13af2b38ac6aa13d51b3206 Mon Sep 17 00:00:00 2001 From: siprmp Date: Tue, 12 Mar 2024 16:39:08 -0400 Subject: [PATCH 07/47] adding integration test for new enablement experience --- .../workflows/operator-integration-test.yml | 4 +- .../eks/validateResources_test.go | 68 ++++++++++++++++++- .../java/sample-deployment-java.yaml | 2 - ...umentation_python-java_env_variables.json} | 0 .../sample-deployment-python-java.yaml} | 0 5 files changed, 69 insertions(+), 5 deletions(-) rename integration-tests/{pythonjava/default_instrumentation_pythonjava_env_variables.json => python-java/default_instrumentation_python-java_env_variables.json} (100%) rename integration-tests/{pythonjava/sample-deployment-pythonjava.yaml => python-java/sample-deployment-python-java.yaml} (100%) diff --git a/.github/workflows/operator-integration-test.yml b/.github/workflows/operator-integration-test.yml index a79e51f75..74f345131 100644 --- a/.github/workflows/operator-integration-test.yml +++ b/.github/workflows/operator-integration-test.yml @@ -112,13 +112,13 @@ jobs: kubectl delete instrumentation sample-instrumentation - name: Test for default instrumentation resources for python and java run: | - kubectl apply -f integration-tests/pythonjava/sample-deployment-pythonjava.yaml + kubectl apply -f integration-tests/python-java/sample-deployment-python-java.yaml sleep 5 kubectl rollout restart deployment nginx sleep 5 kubectl get pods -A kubectl describe pods -n default - go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/pythonjava/default_instrumentation_pythonjava_env_variables.json + go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/python-java/default_instrumentation_python-java_env_variables.json - name: Test for defined instrumentation resources for python and java diff --git a/integration-tests/eks/validateResources_test.go b/integration-tests/eks/validateResources_test.go index 53582d7f3..368aa56f9 100644 --- a/integration-tests/eks/validateResources_test.go +++ b/integration-tests/eks/validateResources_test.go @@ -5,10 +5,14 @@ package eks_addon import ( "context" + "encoding/json" "fmt" + "github.com/aws/amazon-cloudwatch-agent-operator/pkg/instrumentation/auto" + "k8s.io/apimachinery/pkg/labels" "os" "path/filepath" "regexp" + "strings" "testing" "github.com/stretchr/testify/assert" @@ -101,6 +105,61 @@ func TestOperatorOnEKs(t *testing.T) { } assert.Equal(t, appsV1.DeploymentAvailable, deployments.Items[0].Status.Conditions[0].Type) + //updating operator deployment + args := deployments.Items[0].Spec.Template.Spec.Containers[0].Args + + indexOfAutoAnnotationConfigString := findMatchingPrefix("--auto-annotation-config=", args) + + annotationConfig := auto.AnnotationConfig{ + Java: auto.AnnotationResources{ + Namespaces: []string{""}, + DaemonSets: []string{""}, + Deployments: []string{"default/nginx"}, + StatefulSets: []string{""}, + }, + } + jsonStr, err := json.Marshal(annotationConfig) + if err != nil { + fmt.Println("Error:", err) + return + } + + args[indexOfAutoAnnotationConfigString] = "--auto-annotation-config=" + string(jsonStr) + fmt.Println("AutoAnnotationConfiguration: " + args[indexOfAutoAnnotationConfigString]) + + // Update the Deployment + _, err = clientSet.AppsV1().Deployments("namespace").Update(context.TODO(), &deployments.Items[0], metav1.UpdateOptions{}) + if err != nil { + fmt.Printf("Error updating Deployment: %s\n", err) + os.Exit(1) + } + fmt.Println("Deployment updated successfully!") + + //check if deployement has annotations. + deployment, err := clientSet.AppsV1().Deployments("default").Get(context.TODO(), "nginx", metav1.GetOptions{}) + if err != nil { + t.Fatalf("Failed to get nginx deployment: %s", err.Error()) + } + + // List pods belonging to the nginx deployment + set := labels.Set(deployment.Spec.Selector.MatchLabels) + deploymentPods, err := clientSet.CoreV1().Pods(deployment.Namespace).List(context.TODO(), metav1.ListOptions{ + LabelSelector: set.AsSelector().String(), + }) + if err != nil { + t.Fatalf("Error listing pods for nginx deployment: %s", err.Error()) + } + + for _, pod := range deploymentPods.Items { + assert.Equal(t, "true", pod.Annotations["cloudwatch.aws.amazon.com/auto-annotate-java"], "Pod %s in namespace %s does not have cloudwatch annotation", pod.Name, pod.Namespace) + assert.Equal(t, "true", pod.Annotations["instrumentation.opentelemetry.io/inject-java"], "Pod %s in namespace %s does not have opentelemetry annotation", pod.Name, pod.Namespace) + } + + fmt.Printf("All nginx pods have the correct annotations\n") + if err != nil { + t.Fatalf("Error listing pods: %s", err.Error()) + } + //Validating the Daemon Sets daemonSets, err := ListDaemonSets(nameSpace, clientSet) assert.NoError(t, err) @@ -161,7 +220,14 @@ func TestOperatorOnEKs(t *testing.T) { // - amazon-cloudwatch-observability-validating-webhook-configuration assert.Equal(t, addOnName+"-validating-webhook-configuration", validatingWebhookConfigurations.Items[0].Name) } - +func findMatchingPrefix(str string, strs []string) int { + for i, s := range strs { + if strings.HasPrefix(s, str) { + return i + } + } + return -1 // Return -1 if no matching prefix is found +} func validateServiceAccount(serviceAccounts *v1.ServiceAccountList, serviceAccountName string) bool { for _, serviceAccount := range serviceAccounts.Items { if serviceAccount.Name == serviceAccountName { diff --git a/integration-tests/java/sample-deployment-java.yaml b/integration-tests/java/sample-deployment-java.yaml index 52998f98f..ad56f02c4 100644 --- a/integration-tests/java/sample-deployment-java.yaml +++ b/integration-tests/java/sample-deployment-java.yaml @@ -10,8 +10,6 @@ spec: metadata: labels: app: nginx - annotations: - instrumentation.opentelemetry.io/inject-java: "true" spec: containers: - name: nginx diff --git a/integration-tests/pythonjava/default_instrumentation_pythonjava_env_variables.json b/integration-tests/python-java/default_instrumentation_python-java_env_variables.json similarity index 100% rename from integration-tests/pythonjava/default_instrumentation_pythonjava_env_variables.json rename to integration-tests/python-java/default_instrumentation_python-java_env_variables.json diff --git a/integration-tests/pythonjava/sample-deployment-pythonjava.yaml b/integration-tests/python-java/sample-deployment-python-java.yaml similarity index 100% rename from integration-tests/pythonjava/sample-deployment-pythonjava.yaml rename to integration-tests/python-java/sample-deployment-python-java.yaml From d0a5e7e3256459c125fc3590b0bba094c0b8a9e4 Mon Sep 17 00:00:00 2001 From: siprmp Date: Mon, 18 Mar 2024 17:15:35 -0400 Subject: [PATCH 08/47] removing unecessary changes --- helm/values.yaml | 35 +++-- .../eks/validateResources_test.go | 141 ++++++++---------- 2 files changed, 87 insertions(+), 89 deletions(-) diff --git a/helm/values.yaml b/helm/values.yaml index 2d4718fac..e1af33343 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -19,16 +19,16 @@ region: gpuNodeLabelKey: node.kubernetes.io/instance-type ## NVIDIA GPU instance types -gpuInstances: [ g3s.xlarge, g3.4xlarge, g3.8xlarge, g3.16xlarge, g4dn.12xlarge, g4dn.xlarge, g4dn.2xlarge, g4dn.4xlarge, g4dn.8xlarge, g4dn.16xlarge, g4dn.metal, g5.xlarge, g5.2xlarge, g5.4xlarge, g5.8xlarge, g5.16xlarge, g5.24xlarge, g5.48xlarge, g5.8xlarge, g5g.xlarge, g5g.2xlarge, g5g.4xlarge, g5g.8xlarge, g5g.16xlarge, g5g.metal, p2.xlarge, p2.8xlarge, p2.16xlarg, p3.2xlarge, p3.8xlarge, p3.16xlarge, p3dn.24xlarge, p4d.24xlarge, p4de.24xlarge, p5.48xlarge ] +gpuInstances: [ p2.xlarge, p2.8xlarge, p2.16xlarge, p3.2xlarge, p3.8xlarge, p3.16xlarge, p3dn.24xlarge, p4d.24xlarge, p4de.24xlarge, p5.48xlarge, g3s.xlarge, g3.4xlarge, g3.8xlarge, g3.16xlarge, g4dn.xlarge, g4dn.2xlarge, g4dn.4xlarge, g4dn.8xlarge, g4dn.16xlarge, g4dn.12xlarge, g4dn.metal, g4ad.xlarge, g4ad.2xlarge, g4ad.4xlarge, g4ad.8xlarge, g4ad.16xlarge, g5.xlarge, g5.2xlarge, g5.4xlarge, g5.8xlarge, g5.16xlarge, g5.12xlarge, g5.24xlarge, g5.48xlarge, g5g.xlarge, g5g.2xlarge, g5g.4xlarge, g5g.8xlarge, g5g.16xlarge, g5g.metal ] containerLogs: enabled: true fluentBit: image: - repository: cwagent-operator-pre-release - tag: latest + repository: aws-for-fluent-bit + tag: 2.32.0.20240304 repositoryDomainMap: - public: 506463145083.dkr.ecr.us-west-2.amazonaws.com + public: public.ecr.aws/aws-observability cn-north-1: 128054284489.dkr.ecr.cn-north-1.amazonaws.com.cn cn-northwest-1: 128054284489.dkr.ecr.cn-northwest-1.amazonaws.com.cn us-gov-east-1: 161423150738.dkr.ecr.us-gov-east-1.amazonaws.com @@ -40,20 +40,22 @@ manager: name: image: repository: cloudwatch-agent-operator - tag: 1.0.4 + tag: 1.1.0 repositoryDomainMap: - public: 506463145083.dkr.ecr.us-west-2.amazonaws.com + public: public.ecr.aws/cloudwatch-agent cn-north-1: 934860584483.dkr.ecr.cn-north-1.amazonaws.com.cn cn-northwest-1: 934860584483.dkr.ecr.cn-northwest-1.amazonaws.com.cn us-gov-east-1: 743662458514.dkr.ecr.us-gov-east-1.amazonaws.com us-gov-west-1: 743662458514.dkr.ecr.us-gov-west-1.amazonaws.com autoInstrumentationImage: java: - repository: public.ecr.aws/aws-observability/adot-autoinstrumentation-java - tag: v1.31.1 + repositoryDomain: public.ecr.aws/aws-observability + repository: adot-autoinstrumentation-java + tag: v1.32.1 python: - repository: ghcr.io/open-telemetry/opentelemetry-operator/autoinstrumentation-python - tag: 0.43b0 + repositoryDomain: public.ecr.aws/aws-observability + repository: adot-autoinstrumentation-python + tag: v0.0.1 autoAnnotateAutoInstrumentation: java: namespaces: [ ] @@ -141,11 +143,10 @@ admissionWebhooks: agent: name: image: - repository: cloudwatch-agent tag: 1.300034.0b498 repositoryDomainMap: - public: 506463145083.dkr.ecr.us-west-2.amazonaws.com + public: public.ecr.aws/cloudwatch-agent cn-north-1: 934860584483.dkr.ecr.cn-north-1.amazonaws.com.cn cn-northwest-1: 934860584483.dkr.ecr.cn-northwest-1.amazonaws.com.cn us-gov-east-1: 743662458514.dkr.ecr.us-gov-east-1.amazonaws.com @@ -193,8 +194,14 @@ agent: dcgmExporter: name: image: - repository: nvcr.io/nvidia/k8s/dcgm-exporter + repository: dcgm-exporter tag: 3.3.3-3.3.1-ubuntu22.04 + repositoryDomainMap: + public: nvcr.io/nvidia/k8s + cn-north-1: 934860584483.dkr.ecr.cn-north-1.amazonaws.com.cn + cn-northwest-1: 934860584483.dkr.ecr.cn-northwest-1.amazonaws.com.cn + us-gov-east-1: 743662458514.dkr.ecr.us-gov-east-1.amazonaws.com + us-gov-west-1: 743662458514.dkr.ecr.us-gov-west-1.amazonaws.com configmap: dcgm-exporter-config-map arguments: ["--web-config-file=/etc/dcgm-exporter/web-config.yaml"] service: @@ -204,4 +211,4 @@ dcgmExporter: address: ":9400" kubeletPath: "/var/lib/kubelet/pod-resources" serviceAccount: - name: # override exporter service account name + name: # override exporter service account name \ No newline at end of file diff --git a/integration-tests/eks/validateResources_test.go b/integration-tests/eks/validateResources_test.go index 368aa56f9..8eb8251e4 100644 --- a/integration-tests/eks/validateResources_test.go +++ b/integration-tests/eks/validateResources_test.go @@ -5,14 +5,10 @@ package eks_addon import ( "context" - "encoding/json" "fmt" - "github.com/aws/amazon-cloudwatch-agent-operator/pkg/instrumentation/auto" - "k8s.io/apimachinery/pkg/labels" "os" "path/filepath" "regexp" - "strings" "testing" "github.com/stretchr/testify/assert" @@ -30,8 +26,11 @@ const ( nameSpace = "amazon-cloudwatch" addOnName = "amazon-cloudwatch-observability" agentName = "cloudwatch-agent" - podNameRegex = "(" + agentName + "|" + addOnName + "-controller-manager|fluent-bit)-*" - serviceNameRegex = agentName + "(-headless|-monitoring)?|" + addOnName + "-webhook-service" + operatorName = addOnName + "-controller-manager" + fluentBitName = "fluent-bit" + dcgmExporterName = "dcgm-exporter" + podNameRegex = "(" + agentName + "|" + operatorName + "|" + fluentBitName + ")-*" + serviceNameRegex = agentName + "(-headless|-monitoring)?|" + addOnName + "-webhook-service|" + dcgmExporterName + "-service" ) func TestOperatorOnEKs(t *testing.T) { @@ -64,7 +63,7 @@ func TestOperatorOnEKs(t *testing.T) { assert.Len(t, pods.Items, 3) for _, pod := range pods.Items { fmt.Println("pod name: " + pod.Name + " namespace:" + pod.Namespace) - assert.Equal(t, v1.PodRunning, pod.Status.Phase) + assert.Contains(t, []v1.PodPhase{v1.PodRunning, v1.PodPending}, pod.Status.Phase) // matches // - cloudwatch-agent-* // - amazon-cloudwatch-observability-controller-manager-* @@ -77,7 +76,7 @@ func TestOperatorOnEKs(t *testing.T) { //Validating the services services, err := ListServices(nameSpace, clientSet) assert.NoError(t, err) - assert.Len(t, services.Items, 4) + assert.Len(t, services.Items, 5) for _, service := range services.Items { fmt.Println("service name: " + service.Name + " namespace:" + service.Namespace) // matches @@ -85,6 +84,7 @@ func TestOperatorOnEKs(t *testing.T) { // - cloudwatch-agent // - cloudwatch-agent-headless // - cloudwatch-agent-monitoring + // - dcgm-exporter-service if match, _ := regexp.MatchString(serviceNameRegex, service.Name); !match { assert.Fail(t, "Cluster Service is not created correctly") } @@ -105,72 +105,18 @@ func TestOperatorOnEKs(t *testing.T) { } assert.Equal(t, appsV1.DeploymentAvailable, deployments.Items[0].Status.Conditions[0].Type) - //updating operator deployment - args := deployments.Items[0].Spec.Template.Spec.Containers[0].Args - - indexOfAutoAnnotationConfigString := findMatchingPrefix("--auto-annotation-config=", args) - - annotationConfig := auto.AnnotationConfig{ - Java: auto.AnnotationResources{ - Namespaces: []string{""}, - DaemonSets: []string{""}, - Deployments: []string{"default/nginx"}, - StatefulSets: []string{""}, - }, - } - jsonStr, err := json.Marshal(annotationConfig) - if err != nil { - fmt.Println("Error:", err) - return - } - - args[indexOfAutoAnnotationConfigString] = "--auto-annotation-config=" + string(jsonStr) - fmt.Println("AutoAnnotationConfiguration: " + args[indexOfAutoAnnotationConfigString]) - - // Update the Deployment - _, err = clientSet.AppsV1().Deployments("namespace").Update(context.TODO(), &deployments.Items[0], metav1.UpdateOptions{}) - if err != nil { - fmt.Printf("Error updating Deployment: %s\n", err) - os.Exit(1) - } - fmt.Println("Deployment updated successfully!") - - //check if deployement has annotations. - deployment, err := clientSet.AppsV1().Deployments("default").Get(context.TODO(), "nginx", metav1.GetOptions{}) - if err != nil { - t.Fatalf("Failed to get nginx deployment: %s", err.Error()) - } - - // List pods belonging to the nginx deployment - set := labels.Set(deployment.Spec.Selector.MatchLabels) - deploymentPods, err := clientSet.CoreV1().Pods(deployment.Namespace).List(context.TODO(), metav1.ListOptions{ - LabelSelector: set.AsSelector().String(), - }) - if err != nil { - t.Fatalf("Error listing pods for nginx deployment: %s", err.Error()) - } - - for _, pod := range deploymentPods.Items { - assert.Equal(t, "true", pod.Annotations["cloudwatch.aws.amazon.com/auto-annotate-java"], "Pod %s in namespace %s does not have cloudwatch annotation", pod.Name, pod.Namespace) - assert.Equal(t, "true", pod.Annotations["instrumentation.opentelemetry.io/inject-java"], "Pod %s in namespace %s does not have opentelemetry annotation", pod.Name, pod.Namespace) - } - - fmt.Printf("All nginx pods have the correct annotations\n") - if err != nil { - t.Fatalf("Error listing pods: %s", err.Error()) - } - //Validating the Daemon Sets daemonSets, err := ListDaemonSets(nameSpace, clientSet) assert.NoError(t, err) - assert.Len(t, daemonSets.Items, 2) + assert.Len(t, daemonSets.Items, 3) for _, daemonSet := range daemonSets.Items { fmt.Println("daemonSet name: " + daemonSet.Name + " namespace:" + daemonSet.Namespace) // matches // - cloudwatch-agent // - fluent-bit - if match, _ := regexp.MatchString(agentName+"|fluent-bit", daemonSet.Name); !match { - assert.Fail(t, "DaemonSet is created correctly") + // - dcgm-exporter (this can be removed in the future) + if match, _ := regexp.MatchString(agentName+"|fluent-bit|dcgm-exporter", daemonSet.Name); !match { + assert.Fail(t, "DaemonSet is not created correctly") } } @@ -183,8 +129,10 @@ func TestOperatorOnEKs(t *testing.T) { // searches // - amazon-cloudwatch-observability-controller-manager // - cloudwatch-agent + // - dcgm-exporter-service-acct assert.True(t, validateServiceAccount(serviceAccounts, addOnName+"-controller-manager")) assert.True(t, validateServiceAccount(serviceAccounts, agentName)) + assert.True(t, validateServiceAccount(serviceAccounts, dcgmExporterName+"-service-acct")) //Validating ClusterRoles clusterRoles, err := ListClusterRoles(clientSet) @@ -195,6 +143,13 @@ func TestOperatorOnEKs(t *testing.T) { assert.True(t, validateClusterRoles(clusterRoles, addOnName+"-manager-role")) assert.True(t, validateClusterRoles(clusterRoles, agentName+"-role")) + //Validating Roles + roles, err := ListRoles(nameSpace, clientSet) + assert.NoError(t, err) + // searches + // - dcgm-exporter-role + assert.True(t, validateRoles(roles, dcgmExporterName+"-role")) + //Validating ClusterRoleBinding clusterRoleBindings, err := ListClusterRoleBindings(clientSet) assert.NoError(t, err) @@ -204,10 +159,17 @@ func TestOperatorOnEKs(t *testing.T) { assert.True(t, validateClusterRoleBindings(clusterRoleBindings, addOnName+"-manager-rolebinding")) assert.True(t, validateClusterRoleBindings(clusterRoleBindings, agentName+"-role-binding")) + //Validating RoleBinding + roleBindings, err := ListRoleBindings(nameSpace, clientSet) + assert.NoError(t, err) + // searches + // - dcgm-exporter-role-binding + assert.True(t, validateRoleBindings(roleBindings, dcgmExporterName+"-role-binding")) + //Validating MutatingWebhookConfiguration mutatingWebhookConfigurations, err := ListMutatingWebhookConfigurations(clientSet) assert.NoError(t, err) - assert.Len(t, mutatingWebhookConfigurations.Items[0].Webhooks, 3) + assert.Len(t, mutatingWebhookConfigurations.Items[0].Webhooks, 5) // searches // - amazon-cloudwatch-observability-mutating-webhook-configuration assert.Equal(t, addOnName+"-mutating-webhook-configuration", mutatingWebhookConfigurations.Items[0].Name) @@ -220,14 +182,7 @@ func TestOperatorOnEKs(t *testing.T) { // - amazon-cloudwatch-observability-validating-webhook-configuration assert.Equal(t, addOnName+"-validating-webhook-configuration", validatingWebhookConfigurations.Items[0].Name) } -func findMatchingPrefix(str string, strs []string) int { - for i, s := range strs { - if strings.HasPrefix(s, str) { - return i - } - } - return -1 // Return -1 if no matching prefix is found -} + func validateServiceAccount(serviceAccounts *v1.ServiceAccountList, serviceAccountName string) bool { for _, serviceAccount := range serviceAccounts.Items { if serviceAccount.Name == serviceAccountName { @@ -246,6 +201,15 @@ func validateClusterRoles(clusterRoles *rbacV1.ClusterRoleList, clusterRoleName return false } +func validateRoles(roles *rbacV1.RoleList, roleName string) bool { + for _, role := range roles.Items { + if role.Name == roleName { + return true + } + } + return false +} + func validateClusterRoleBindings(clusterRoleBindings *rbacV1.ClusterRoleBindingList, clusterRoleBindingName string) bool { for _, clusterRoleBinding := range clusterRoleBindings.Items { if clusterRoleBinding.Name == clusterRoleBindingName { @@ -255,6 +219,15 @@ func validateClusterRoleBindings(clusterRoleBindings *rbacV1.ClusterRoleBindingL return false } +func validateRoleBindings(roleBindings *rbacV1.RoleBindingList, roleBindingName string) bool { + for _, roleBinding := range roleBindings.Items { + if roleBinding.Name == roleBindingName { + return true + } + } + return false +} + func ListPods(namespace string, client kubernetes.Interface) (*v1.PodList, error) { pods, err := client.CoreV1().Pods(namespace).List(context.Background(), metav1.ListOptions{}) if err != nil { @@ -318,6 +291,15 @@ func ListClusterRoles(client kubernetes.Interface) (*rbacV1.ClusterRoleList, err return clusterRoles, nil } +func ListRoles(namespace string, client kubernetes.Interface) (*rbacV1.RoleList, error) { + roles, err := client.RbacV1().Roles(namespace).List(context.Background(), metav1.ListOptions{}) + if err != nil { + err = fmt.Errorf("error getting Roles: %v\n", err) + return nil, err + } + return roles, nil +} + func ListClusterRoleBindings(client kubernetes.Interface) (*rbacV1.ClusterRoleBindingList, error) { clusterRoleBindings, err := client.RbacV1().ClusterRoleBindings().List(context.Background(), metav1.ListOptions{}) if err != nil { @@ -327,6 +309,15 @@ func ListClusterRoleBindings(client kubernetes.Interface) (*rbacV1.ClusterRoleBi return clusterRoleBindings, nil } +func ListRoleBindings(namespace string, client kubernetes.Interface) (*rbacV1.RoleBindingList, error) { + roleBindings, err := client.RbacV1().RoleBindings(namespace).List(context.Background(), metav1.ListOptions{}) + if err != nil { + err = fmt.Errorf("error getting RoleBindings: %v\n", err) + return nil, err + } + return roleBindings, nil +} + func ListMutatingWebhookConfigurations(client kubernetes.Interface) (*arv1.MutatingWebhookConfigurationList, error) { mutatingWebhookConfigurations, err := client.AdmissionregistrationV1().MutatingWebhookConfigurations().List(context.Background(), metav1.ListOptions{}) if err != nil { From 84c93167fdb64634ee12d60fbf4455d07201c514 Mon Sep 17 00:00:00 2001 From: siprmp Date: Mon, 18 Mar 2024 17:17:12 -0400 Subject: [PATCH 09/47] adding back annotations to sample app --- integration-tests/java/sample-deployment-java.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/integration-tests/java/sample-deployment-java.yaml b/integration-tests/java/sample-deployment-java.yaml index ad56f02c4..52998f98f 100644 --- a/integration-tests/java/sample-deployment-java.yaml +++ b/integration-tests/java/sample-deployment-java.yaml @@ -10,6 +10,8 @@ spec: metadata: labels: app: nginx + annotations: + instrumentation.opentelemetry.io/inject-java: "true" spec: containers: - name: nginx From 42262088726f6a36989efe0ca8b24653057b5106 Mon Sep 17 00:00:00 2001 From: siprmp Date: Mon, 18 Mar 2024 17:38:46 -0400 Subject: [PATCH 10/47] fixing no env vars when both python and java instrumented --- .github/workflows/operator-integration-test.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/operator-integration-test.yml b/.github/workflows/operator-integration-test.yml index 74f345131..552923abd 100644 --- a/.github/workflows/operator-integration-test.yml +++ b/.github/workflows/operator-integration-test.yml @@ -118,7 +118,10 @@ jobs: sleep 5 kubectl get pods -A kubectl describe pods -n default + kubectl describe pods -n amazon-cloudwatch go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/python-java/default_instrumentation_python-java_env_variables.json + kubectl describe pods -n default + kubectl describe pods -n amazon-cloudwatch - name: Test for defined instrumentation resources for python and java From 0ebb4917579700a497f0451528a1d8bd9bb339e0 Mon Sep 17 00:00:00 2001 From: siprmp Date: Mon, 18 Mar 2024 18:01:48 -0400 Subject: [PATCH 11/47] trying to deploy a different operator version --- .github/workflows/operator-integration-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/operator-integration-test.yml b/.github/workflows/operator-integration-test.yml index 552923abd..f5a3eaa68 100644 --- a/.github/workflows/operator-integration-test.yml +++ b/.github/workflows/operator-integration-test.yml @@ -52,7 +52,7 @@ jobs: - name: Deploy operator to minikube run: | - make deploy + helm template amazon-cloudwatch-observability ./helm --include-crds --namespace amazon-cloudwatch --set region="us-west-2"| kubectl apply --namespace amazon-cloudwatch --server-side -f - - name: Test case for AmazonCloudWatchAgent pod creation run: | From b981021071ef4ec5c3ea8584ed2bd2134eda4610 Mon Sep 17 00:00:00 2001 From: siprmp Date: Tue, 19 Mar 2024 10:48:33 -0400 Subject: [PATCH 12/47] make deploy --- .github/workflows/operator-integration-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/operator-integration-test.yml b/.github/workflows/operator-integration-test.yml index f5a3eaa68..552923abd 100644 --- a/.github/workflows/operator-integration-test.yml +++ b/.github/workflows/operator-integration-test.yml @@ -52,7 +52,7 @@ jobs: - name: Deploy operator to minikube run: | - helm template amazon-cloudwatch-observability ./helm --include-crds --namespace amazon-cloudwatch --set region="us-west-2"| kubectl apply --namespace amazon-cloudwatch --server-side -f - + make deploy - name: Test case for AmazonCloudWatchAgent pod creation run: | From 47510fc590e7bdb6cd00250ffa608fe6bc410803 Mon Sep 17 00:00:00 2001 From: siprmp Date: Tue, 19 Mar 2024 12:25:52 -0400 Subject: [PATCH 13/47] fixing some issues --- .../default_instrumentation_python-java_env_variables.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/integration-tests/python-java/default_instrumentation_python-java_env_variables.json b/integration-tests/python-java/default_instrumentation_python-java_env_variables.json index 24451a5e6..cb2f787e9 100644 --- a/integration-tests/python-java/default_instrumentation_python-java_env_variables.json +++ b/integration-tests/python-java/default_instrumentation_python-java_env_variables.json @@ -6,12 +6,12 @@ "OTEL_TRACES_SAMPLER": "xray", "OTEL_EXPORTER_OTLP_PROTOCOL": "http/protobuf", "OTEL_EXPORTER_OTLP_TRACES_ENDPOINT": "http://cloudwatch-agent.amazon-cloudwatch:4316/v1/traces", - "OTEL_AWS_APP_SIGNALS_EXPORTER_ENDPOINT": "http://cloudwatch-agent.amazon-cloudwatch:4315", + "OTEL_AWS_APP_SIGNALS_EXPORTER_ENDPOINT": "http://cloudwatch-agent.amazon-cloudwatch:4316/v1/metrics", "OTEL_METRICS_EXPORTER": "none", "OTEL_PYTHON_DISTRO": "aws_distro", "OTEL_PYTHON_CONFIGURATOR": "aws_configurator", "OTEL_SMP_ENABLED": "true", - "OTEL_AWS_SMP_EXPORTER_ENDPOINT": "http://cloudwatch-agent.amazon-cloudwatch:4315", + "OTEL_AWS_SMP_EXPORTER_ENDPOINT": "http://cloudwatch-agent.amazon-cloudwatch:4316/v1/metrics", "JAVA_TOOL_OPTIONS": "-javaagent:/otel-auto-instrumentation-java/javaagent.jar" } \ No newline at end of file From 062a350ec9603a614457b3b12b9974a096a83408 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Tue, 23 Apr 2024 16:44:46 -0400 Subject: [PATCH 14/47] fixing operator integration test --- .github/workflows/operator-integration-test.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/operator-integration-test.yml b/.github/workflows/operator-integration-test.yml index 4e0445044..072619145 100644 --- a/.github/workflows/operator-integration-test.yml +++ b/.github/workflows/operator-integration-test.yml @@ -39,17 +39,11 @@ jobs: run: kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.12.0/cert-manager.yaml -<<<<<<< HEAD - # - name: Verify minikube and cert-manager - # run: | - # sleep 10 - # kubectl get pods -A -======= + - name: Verify minikube and cert-manager run: | sleep 10 kubectl get pods -A ->>>>>>> cf7a1e70c257d767c74529867ceddfe033064f94 - name: Build image run: | From e7806da0128b42f51cc044f08a7431b380ea8b75 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Tue, 23 Apr 2024 17:37:54 -0400 Subject: [PATCH 15/47] testing if operator is working --- .github/workflows/operator-integration-test.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/operator-integration-test.yml b/.github/workflows/operator-integration-test.yml index 072619145..aaa48b1cc 100644 --- a/.github/workflows/operator-integration-test.yml +++ b/.github/workflows/operator-integration-test.yml @@ -114,15 +114,15 @@ jobs: - name: Test for default instrumentation resources for python and java run: | kubectl apply -f integration-tests/python-java/sample-deployment-python-java.yaml - sleep 5 + sleep 60 kubectl rollout restart deployment nginx - sleep 5 + sleep 60 kubectl get pods -A kubectl describe pods -n default kubectl describe pods -n amazon-cloudwatch - go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/python-java/default_instrumentation_python-java_env_variables.json - kubectl describe pods -n default - kubectl describe pods -n amazon-cloudwatch +# go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/python-java/default_instrumentation_python-java_env_variables.json +# kubectl describe pods -n default +# kubectl describe pods -n amazon-cloudwatch - name: Test for defined instrumentation resources for python and java From b92beb20316b4ca0abb2e9caa11b4dff6a1c6dba Mon Sep 17 00:00:00 2001 From: Paramadon Date: Tue, 23 Apr 2024 17:38:53 -0400 Subject: [PATCH 16/47] testing if operator is working --- .github/workflows/operator-integration-test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/operator-integration-test.yml b/.github/workflows/operator-integration-test.yml index aaa48b1cc..97e31ebad 100644 --- a/.github/workflows/operator-integration-test.yml +++ b/.github/workflows/operator-integration-test.yml @@ -120,7 +120,7 @@ jobs: kubectl get pods -A kubectl describe pods -n default kubectl describe pods -n amazon-cloudwatch -# go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/python-java/default_instrumentation_python-java_env_variables.json + go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/python-java/default_instrumentation_python-java_env_variables.json # kubectl describe pods -n default # kubectl describe pods -n amazon-cloudwatch From 8c9cd69827ee5a2a7b900ffee2db7dcba3245431 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 24 Apr 2024 16:57:10 -0400 Subject: [PATCH 17/47] replacing operator installation from make deploy to helm chart --- .github/workflows/operator-integration-test.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/operator-integration-test.yml b/.github/workflows/operator-integration-test.yml index 97e31ebad..283be6935 100644 --- a/.github/workflows/operator-integration-test.yml +++ b/.github/workflows/operator-integration-test.yml @@ -53,7 +53,9 @@ jobs: - name: Deploy operator to minikube run: | - make deploy + kubectl patch deploy -n amazon-cloudwatch amazon-cloudwatch-observability-controller-manager --type='json' -p '[{"op": "replace", "path": "/spec/template/spec/containers/0/image", "value": "aws/cloudwatch-agent-operator:1.2.0"}, {"op": "replace", "path": "/spec/template/spec/containers/0/imagePullPolicy", "value": "Always"}]' + kubectl delete pods --all -n amazon-cloudwatch + kubectl wait --for=condition=Ready pod --all -n amazon-cloudwatch - name: Test case for AmazonCloudWatchAgent pod creation run: | @@ -121,6 +123,7 @@ jobs: kubectl describe pods -n default kubectl describe pods -n amazon-cloudwatch go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/python-java/default_instrumentation_python-java_env_variables.json + kubectl get deployment amazon-cloudwatch-observability-controller-manager -n amazon-cloudwatch -o yaml # kubectl describe pods -n default # kubectl describe pods -n amazon-cloudwatch From e8ca07fca606e5d711eda6b1e8626c1af61683b6 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 24 Apr 2024 17:07:47 -0400 Subject: [PATCH 18/47] replacing operator installation from make deploy to helm chart --- .github/workflows/operator-integration-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/operator-integration-test.yml b/.github/workflows/operator-integration-test.yml index 283be6935..e47c4b9fd 100644 --- a/.github/workflows/operator-integration-test.yml +++ b/.github/workflows/operator-integration-test.yml @@ -53,6 +53,8 @@ jobs: - name: Deploy operator to minikube run: | + kubectl create namespace amazon-cloudwatch + sleep 10 kubectl patch deploy -n amazon-cloudwatch amazon-cloudwatch-observability-controller-manager --type='json' -p '[{"op": "replace", "path": "/spec/template/spec/containers/0/image", "value": "aws/cloudwatch-agent-operator:1.2.0"}, {"op": "replace", "path": "/spec/template/spec/containers/0/imagePullPolicy", "value": "Always"}]' kubectl delete pods --all -n amazon-cloudwatch kubectl wait --for=condition=Ready pod --all -n amazon-cloudwatch From 9b43d02b61e38dbd06c6771b81b6ddd90de5ab41 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 24 Apr 2024 17:18:27 -0400 Subject: [PATCH 19/47] adding debug statements --- .github/workflows/operator-integration-test.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/operator-integration-test.yml b/.github/workflows/operator-integration-test.yml index e47c4b9fd..e345484ae 100644 --- a/.github/workflows/operator-integration-test.yml +++ b/.github/workflows/operator-integration-test.yml @@ -53,9 +53,11 @@ jobs: - name: Deploy operator to minikube run: | + kubectl get pods -A + kubectl describe pods -A kubectl create namespace amazon-cloudwatch sleep 10 - kubectl patch deploy -n amazon-cloudwatch amazon-cloudwatch-observability-controller-manager --type='json' -p '[{"op": "replace", "path": "/spec/template/spec/containers/0/image", "value": "aws/cloudwatch-agent-operator:1.2.0"}, {"op": "replace", "path": "/spec/template/spec/containers/0/imagePullPolicy", "value": "Always"}]' + kubectl patch deploy -n amazon-cloudwatch cloudwatch-controller-manager --type='json' -p '[{"op": "replace", "path": "/spec/template/spec/containers/0/image", "value": "aws/cloudwatch-agent-operator:1.2.0"}, {"op": "replace", "path": "/spec/template/spec/containers/0/imagePullPolicy", "value": "Always"}]' kubectl delete pods --all -n amazon-cloudwatch kubectl wait --for=condition=Ready pod --all -n amazon-cloudwatch From f1722e53ca7680e86feaf1f423f039e4b4438003 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 24 Apr 2024 17:19:09 -0400 Subject: [PATCH 20/47] adding debug statements --- .github/workflows/operator-integration-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/operator-integration-test.yml b/.github/workflows/operator-integration-test.yml index e345484ae..79d2b57d6 100644 --- a/.github/workflows/operator-integration-test.yml +++ b/.github/workflows/operator-integration-test.yml @@ -53,6 +53,7 @@ jobs: - name: Deploy operator to minikube run: | + sleep 10 kubectl get pods -A kubectl describe pods -A kubectl create namespace amazon-cloudwatch From e0d8bba0711a05438665af310e8ddb01896f2635 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 24 Apr 2024 17:28:17 -0400 Subject: [PATCH 21/47] adding debug statements --- .github/workflows/operator-integration-test.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/operator-integration-test.yml b/.github/workflows/operator-integration-test.yml index 79d2b57d6..28e5ea34f 100644 --- a/.github/workflows/operator-integration-test.yml +++ b/.github/workflows/operator-integration-test.yml @@ -53,6 +53,7 @@ jobs: - name: Deploy operator to minikube run: | + make deploy sleep 10 kubectl get pods -A kubectl describe pods -A From 0b3736eb8a04d8d583e5b5775aecafb82294b2d2 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 24 Apr 2024 17:41:49 -0400 Subject: [PATCH 22/47] adding debug statements --- .github/workflows/operator-integration-test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/operator-integration-test.yml b/.github/workflows/operator-integration-test.yml index 28e5ea34f..314c9c4d2 100644 --- a/.github/workflows/operator-integration-test.yml +++ b/.github/workflows/operator-integration-test.yml @@ -57,7 +57,6 @@ jobs: sleep 10 kubectl get pods -A kubectl describe pods -A - kubectl create namespace amazon-cloudwatch sleep 10 kubectl patch deploy -n amazon-cloudwatch cloudwatch-controller-manager --type='json' -p '[{"op": "replace", "path": "/spec/template/spec/containers/0/image", "value": "aws/cloudwatch-agent-operator:1.2.0"}, {"op": "replace", "path": "/spec/template/spec/containers/0/imagePullPolicy", "value": "Always"}]' kubectl delete pods --all -n amazon-cloudwatch From bfab47e58a030662fe9cbcaeb0f49a81e89c8b32 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Wed, 24 Apr 2024 17:58:24 -0400 Subject: [PATCH 23/47] adding debug statements --- .github/workflows/operator-integration-test.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/operator-integration-test.yml b/.github/workflows/operator-integration-test.yml index 314c9c4d2..dfadc454c 100644 --- a/.github/workflows/operator-integration-test.yml +++ b/.github/workflows/operator-integration-test.yml @@ -60,8 +60,7 @@ jobs: sleep 10 kubectl patch deploy -n amazon-cloudwatch cloudwatch-controller-manager --type='json' -p '[{"op": "replace", "path": "/spec/template/spec/containers/0/image", "value": "aws/cloudwatch-agent-operator:1.2.0"}, {"op": "replace", "path": "/spec/template/spec/containers/0/imagePullPolicy", "value": "Always"}]' kubectl delete pods --all -n amazon-cloudwatch - kubectl wait --for=condition=Ready pod --all -n amazon-cloudwatch - + sleep 60 - name: Test case for AmazonCloudWatchAgent pod creation run: | helm template --namespace amazon-cloudwatch -s templates/linux/cloudwatch-agent-daemonset.yaml ./helm --set region=us-west-2 | kubectl apply --namespace amazon-cloudwatch -f - From e57d1be9158779b99c461db422e6488d959b41e7 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Fri, 26 Apr 2024 15:19:49 -0400 Subject: [PATCH 24/47] adding feature gate --- .github/workflows/operator-integration-test.yml | 2 -- config/manager/manager.yaml | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/operator-integration-test.yml b/.github/workflows/operator-integration-test.yml index 5d4b02ad0..b40566bc2 100644 --- a/.github/workflows/operator-integration-test.yml +++ b/.github/workflows/operator-integration-test.yml @@ -314,5 +314,3 @@ jobs: go test -v -run TestPythonOnlyNamespace ./integration-tests/manifests/annotations -timeout 30m kubectl get pods -A kubectl describe pods -n default - - diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index ae26d2df7..d4bef9fc2 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -28,6 +28,8 @@ spec: spec: containers: - image: controller + args: + - "--feature-gates=operator.autoinstrumentation.multi-instrumentation,operator.autoinstrumentation.multi-instrumentation.skip-container-validation" name: manager resources: requests: From ba5913171284d0d239cddcd77d02df20d6270d19 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Fri, 26 Apr 2024 15:29:08 -0400 Subject: [PATCH 25/47] added instrumentation --- .../workflows/operator-integration-test.yml | 25 ++ ...oller-manager -n amazon-cloudwatch -o yaml | 256 ++++++++++++++++++ 2 files changed, 281 insertions(+) create mode 100644 bservability-controller-manager -n amazon-cloudwatch -o yaml diff --git a/.github/workflows/operator-integration-test.yml b/.github/workflows/operator-integration-test.yml index b40566bc2..917e3631f 100644 --- a/.github/workflows/operator-integration-test.yml +++ b/.github/workflows/operator-integration-test.yml @@ -118,8 +118,33 @@ jobs: go run validate_instrumentation_vars.go default ns_instrumentation_env_variables.json kubectl delete instrumentation sample-instrumentation + - name: Test for default instrumentation resources for python and java + run: | + kubectl apply -f integration-tests/python-java/sample-deployment-python-java.yaml + sleep 60 + kubectl rollout restart deployment nginx + sleep 60 + kubectl get pods -A + kubectl describe pods -n default + kubectl describe pods -n amazon-cloudwatch + go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/python-java/default_instrumentation_python-java_env_variables.json + kubectl get deployment amazon-cloudwatch-observability-controller-manager -n amazon-cloudwatch -o yaml + # kubectl describe pods -n default + # kubectl describe pods -n amazon-cloudwatch + - name: Test for defined instrumentation resources for python and java + run: | + kubectl apply -f integration-tests/manifests/sample-instrumentation.yaml + sleep 5 + kubectl rollout restart deployment nginx + sleep 5 + kubectl get pods -A + kubectl describe pods -n default + cd integration-tests/manifests/cmd + go run validate_instrumentation_vars.go default ns_instrumentation_env_variables.json + kubectl delete instrumentation sample-instrumentation + DeploymentAnnotationsTest: name: DeploymentAnnotationsTest runs-on: ubuntu-latest diff --git a/bservability-controller-manager -n amazon-cloudwatch -o yaml b/bservability-controller-manager -n amazon-cloudwatch -o yaml new file mode 100644 index 000000000..1e1ebf447 --- /dev/null +++ b/bservability-controller-manager -n amazon-cloudwatch -o yaml @@ -0,0 +1,256 @@ + + SSUUMMMMAARRYY OOFF LLEESSSS CCOOMMMMAANNDDSS + + Commands marked with * may be preceded by a number, _N. + Notes in parentheses indicate the behavior if _N is given. + A key preceded by a caret indicates the Ctrl key; thus ^K is ctrl-K. + + h H Display this help. + q :q Q :Q ZZ Exit. + --------------------------------------------------------------------------- + + MMOOVVIINNGG + + e ^E j ^N CR * Forward one line (or _N lines). + y ^Y k ^K ^P * Backward one line (or _N lines). + f ^F ^V SPACE * Forward one window (or _N lines). + b ^B ESC-v * Backward one window (or _N lines). + z * Forward one window (and set window to _N). + w * Backward one window (and set window to _N). + ESC-SPACE * Forward one window, but don't stop at end-of-file. + d ^D * Forward one half-window (and set half-window to _N). + u ^U * Backward one half-window (and set half-window to _N). + ESC-) RightArrow * Right one half screen width (or _N positions). + ESC-( LeftArrow * Left one half screen width (or _N positions). + ESC-} ^RightArrow Right to last column displayed. + ESC-{ ^LeftArrow Left to first column. + F Forward forever; like "tail -f". + ESC-F Like F but stop when search pattern is found. + r ^R ^L Repaint screen. + R Repaint screen, discarding buffered input. + --------------------------------------------------- + Default "window" is the screen height. + Default "half-window" is half of the screen height. + --------------------------------------------------------------------------- + + SSEEAARRCCHHIINNGG + + /_p_a_t_t_e_r_n * Search forward for (_N-th) matching line. + ?_p_a_t_t_e_r_n * Search backward for (_N-th) matching line. + n * Repeat previous search (for _N-th occurrence). + N * Repeat previous search in reverse direction. + ESC-n * Repeat previous search, spanning files. + ESC-N * Repeat previous search, reverse dir. & spanning files. + ESC-u Undo (toggle) search highlighting. + ESC-U Clear search highlighting. + &_p_a_t_t_e_r_n * Display only matching lines. + --------------------------------------------------- + A search pattern may begin with one or more of: + ^N or ! Search for NON-matching lines. + ^E or * Search multiple files (pass thru END OF FILE). + ^F or @ Start search at FIRST file (for /) or last file (for ?). + ^K Highlight matches, but don't move (KEEP position). + ^R Don't use REGULAR EXPRESSIONS. + ^W WRAP search if no match found. + --------------------------------------------------------------------------- + + JJUUMMPPIINNGG + + g < ESC-< * Go to first line in file (or line _N). + G > ESC-> * Go to last line in file (or line _N). + p % * Go to beginning of file (or _N percent into file). + t * Go to the (_N-th) next tag. + T * Go to the (_N-th) previous tag. + { ( [ * Find close bracket } ) ]. + } ) ] * Find open bracket { ( [. + ESC-^F _<_c_1_> _<_c_2_> * Find close bracket _<_c_2_>. + ESC-^B _<_c_1_> _<_c_2_> * Find open bracket _<_c_1_>. + --------------------------------------------------- + Each "find close bracket" command goes forward to the close bracket + matching the (_N-th) open bracket in the top line. + Each "find open bracket" command goes backward to the open bracket + matching the (_N-th) close bracket in the bottom line. + + m_<_l_e_t_t_e_r_> Mark the current top line with . + M_<_l_e_t_t_e_r_> Mark the current bottom line with . + '_<_l_e_t_t_e_r_> Go to a previously marked position. + '' Go to the previous position. + ^X^X Same as '. + ESC-M_<_l_e_t_t_e_r_> Clear a mark. + --------------------------------------------------- + A mark is any upper-case or lower-case letter. + Certain marks are predefined: + ^ means beginning of the file + $ means end of the file + --------------------------------------------------------------------------- + + CCHHAANNGGIINNGG FFIILLEESS + + :e [_f_i_l_e] Examine a new file. + ^X^V Same as :e. + :n * Examine the (_N-th) next file from the command line. + :p * Examine the (_N-th) previous file from the command line. + :x * Examine the first (or _N-th) file from the command line. + :d Delete the current file from the command line list. + = ^G :f Print current file name. + --------------------------------------------------------------------------- + + MMIISSCCEELLLLAANNEEOOUUSS CCOOMMMMAANNDDSS + + -_<_f_l_a_g_> Toggle a command line option [see OPTIONS below]. + --_<_n_a_m_e_> Toggle a command line option, by name. + __<_f_l_a_g_> Display the setting of a command line option. + ___<_n_a_m_e_> Display the setting of an option, by name. + +_c_m_d Execute the less cmd each time a new file is examined. + + !_c_o_m_m_a_n_d Execute the shell command with $SHELL. + |XX_c_o_m_m_a_n_d Pipe file between current pos & mark XX to shell command. + s _f_i_l_e Save input to a file. + v Edit the current file with $VISUAL or $EDITOR. + V Print version number of "less". + --------------------------------------------------------------------------- + + OOPPTTIIOONNSS + + Most options may be changed either on the command line, + or from within less by using the - or -- command. + Options may be given in one of two forms: either a single + character preceded by a -, or a name preceded by --. + + -? ........ --help + Display help (from command line). + -a ........ --search-skip-screen + Search skips current screen. + -A ........ --SEARCH-SKIP-SCREEN + Search starts just after target line. + -b [_N] .... --buffers=[_N] + Number of buffers. + -B ........ --auto-buffers + Don't automatically allocate buffers for pipes. + -c ........ --clear-screen + Repaint by clearing rather than scrolling. + -d ........ --dumb + Dumb terminal. + -D xx_c_o_l_o_r . --color=xx_c_o_l_o_r + Set screen colors. + -e -E .... --quit-at-eof --QUIT-AT-EOF + Quit at end of file. + -f ........ --force + Force open non-regular files. + -F ........ --quit-if-one-screen + Quit if entire file fits on first screen. + -g ........ --hilite-search + Highlight only last match for searches. + -G ........ --HILITE-SEARCH + Don't highlight any matches for searches. + -h [_N] .... --max-back-scroll=[_N] + Backward scroll limit. + -i ........ --ignore-case + Ignore case in searches that do not contain uppercase. + -I ........ --IGNORE-CASE + Ignore case in all searches. + -j [_N] .... --jump-target=[_N] + Screen position of target lines. + -J ........ --status-column + Display a status column at left edge of screen. + -k [_f_i_l_e] . --lesskey-file=[_f_i_l_e] + Use a lesskey file. + -K ........ --quit-on-intr + Exit less in response to ctrl-C. + -L ........ --no-lessopen + Ignore the LESSOPEN environment variable. + -m -M .... --long-prompt --LONG-PROMPT + Set prompt style. + -n -N .... --line-numbers --LINE-NUMBERS + Don't use line numbers. + -o [_f_i_l_e] . --log-file=[_f_i_l_e] + Copy to log file (standard input only). + -O [_f_i_l_e] . --LOG-FILE=[_f_i_l_e] + Copy to log file (unconditionally overwrite). + -p [_p_a_t_t_e_r_n] --pattern=[_p_a_t_t_e_r_n] + Start at pattern (from command line). + -P [_p_r_o_m_p_t] --prompt=[_p_r_o_m_p_t] + Define new prompt. + -q -Q .... --quiet --QUIET --silent --SILENT + Quiet the terminal bell. + -r -R .... --raw-control-chars --RAW-CONTROL-CHARS + Output "raw" control characters. + -s ........ --squeeze-blank-lines + Squeeze multiple blank lines. + -S ........ --chop-long-lines + Chop (truncate) long lines rather than wrapping. + -t [_t_a_g] .. --tag=[_t_a_g] + Find a tag. + -T [_t_a_g_s_f_i_l_e] --tag-file=[_t_a_g_s_f_i_l_e] + Use an alternate tags file. + -u -U .... --underline-special --UNDERLINE-SPECIAL + Change handling of backspaces. + -V ........ --version + Display the version number of "less". + -w ........ --hilite-unread + Highlight first new line after forward-screen. + -W ........ --HILITE-UNREAD + Highlight first new line after any forward movement. + -x [_N[,...]] --tabs=[_N[,...]] + Set tab stops. + -X ........ --no-init + Don't use termcap init/deinit strings. + -y [_N] .... --max-forw-scroll=[_N] + Forward scroll limit. + -z [_N] .... --window=[_N] + Set size of window. + -" [_c[_c]] . --quotes=[_c[_c]] + Set shell quote characters. + -~ ........ --tilde + Don't display tildes after end of file. + -# [_N] .... --shift=[_N] + Set horizontal scroll amount (0 = one half screen width). + --follow-name + The F command changes files if the input file is renamed. + --incsearch + Search file as each pattern character is typed in. + --line-num-width=N + Set the width of the -N line number field to N characters. + --mouse + Enable mouse input. + --no-keypad + Don't send termcap keypad init/deinit strings. + --no-histdups + Remove duplicates from command history. + --rscroll=C + Set the character used to mark truncated lines. + --save-marks + Retain marks across invocations of less. + --status-col-width=N + Set the width of the -J status column to N characters. + --use-backslash + Subsequent options use backslash as escape char. + --use-color + Enables colored text. + --wheel-lines=N + Each click of the mouse wheel moves N lines. + + + --------------------------------------------------------------------------- + + LLIINNEE EEDDIITTIINNGG + + These keys can be used to edit text being entered + on the "command line" at the bottom of the screen. + + RightArrow ..................... ESC-l ... Move cursor right one character. + LeftArrow ...................... ESC-h ... Move cursor left one character. + ctrl-RightArrow ESC-RightArrow ESC-w ... Move cursor right one word. + ctrl-LeftArrow ESC-LeftArrow ESC-b ... Move cursor left one word. + HOME ........................... ESC-0 ... Move cursor to start of line. + END ............................ ESC-$ ... Move cursor to end of line. + BACKSPACE ................................ Delete char to left of cursor. + DELETE ......................... ESC-x ... Delete char under cursor. + ctrl-BACKSPACE ESC-BACKSPACE ........... Delete word to left of cursor. + ctrl-DELETE .... ESC-DELETE .... ESC-X ... Delete word under cursor. + ctrl-U ......... ESC (MS-DOS only) ....... Delete entire line. + UpArrow ........................ ESC-k ... Retrieve previous command line. + DownArrow ...................... ESC-j ... Retrieve next command line. + TAB ...................................... Complete filename & cycle. + SHIFT-TAB ...................... ESC-TAB Complete filename & reverse cycle. + ctrl-L ................................... Complete filename, list all. From 63c0353b182b9443268505a94e6e6d6296672ab1 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Fri, 26 Apr 2024 15:33:04 -0400 Subject: [PATCH 26/47] controller manager --- ...oller-manager -n amazon-cloudwatch -o yaml | 256 ------------------ 1 file changed, 256 deletions(-) delete mode 100644 bservability-controller-manager -n amazon-cloudwatch -o yaml diff --git a/bservability-controller-manager -n amazon-cloudwatch -o yaml b/bservability-controller-manager -n amazon-cloudwatch -o yaml deleted file mode 100644 index 1e1ebf447..000000000 --- a/bservability-controller-manager -n amazon-cloudwatch -o yaml +++ /dev/null @@ -1,256 +0,0 @@ - - SSUUMMMMAARRYY OOFF LLEESSSS CCOOMMMMAANNDDSS - - Commands marked with * may be preceded by a number, _N. - Notes in parentheses indicate the behavior if _N is given. - A key preceded by a caret indicates the Ctrl key; thus ^K is ctrl-K. - - h H Display this help. - q :q Q :Q ZZ Exit. - --------------------------------------------------------------------------- - - MMOOVVIINNGG - - e ^E j ^N CR * Forward one line (or _N lines). - y ^Y k ^K ^P * Backward one line (or _N lines). - f ^F ^V SPACE * Forward one window (or _N lines). - b ^B ESC-v * Backward one window (or _N lines). - z * Forward one window (and set window to _N). - w * Backward one window (and set window to _N). - ESC-SPACE * Forward one window, but don't stop at end-of-file. - d ^D * Forward one half-window (and set half-window to _N). - u ^U * Backward one half-window (and set half-window to _N). - ESC-) RightArrow * Right one half screen width (or _N positions). - ESC-( LeftArrow * Left one half screen width (or _N positions). - ESC-} ^RightArrow Right to last column displayed. - ESC-{ ^LeftArrow Left to first column. - F Forward forever; like "tail -f". - ESC-F Like F but stop when search pattern is found. - r ^R ^L Repaint screen. - R Repaint screen, discarding buffered input. - --------------------------------------------------- - Default "window" is the screen height. - Default "half-window" is half of the screen height. - --------------------------------------------------------------------------- - - SSEEAARRCCHHIINNGG - - /_p_a_t_t_e_r_n * Search forward for (_N-th) matching line. - ?_p_a_t_t_e_r_n * Search backward for (_N-th) matching line. - n * Repeat previous search (for _N-th occurrence). - N * Repeat previous search in reverse direction. - ESC-n * Repeat previous search, spanning files. - ESC-N * Repeat previous search, reverse dir. & spanning files. - ESC-u Undo (toggle) search highlighting. - ESC-U Clear search highlighting. - &_p_a_t_t_e_r_n * Display only matching lines. - --------------------------------------------------- - A search pattern may begin with one or more of: - ^N or ! Search for NON-matching lines. - ^E or * Search multiple files (pass thru END OF FILE). - ^F or @ Start search at FIRST file (for /) or last file (for ?). - ^K Highlight matches, but don't move (KEEP position). - ^R Don't use REGULAR EXPRESSIONS. - ^W WRAP search if no match found. - --------------------------------------------------------------------------- - - JJUUMMPPIINNGG - - g < ESC-< * Go to first line in file (or line _N). - G > ESC-> * Go to last line in file (or line _N). - p % * Go to beginning of file (or _N percent into file). - t * Go to the (_N-th) next tag. - T * Go to the (_N-th) previous tag. - { ( [ * Find close bracket } ) ]. - } ) ] * Find open bracket { ( [. - ESC-^F _<_c_1_> _<_c_2_> * Find close bracket _<_c_2_>. - ESC-^B _<_c_1_> _<_c_2_> * Find open bracket _<_c_1_>. - --------------------------------------------------- - Each "find close bracket" command goes forward to the close bracket - matching the (_N-th) open bracket in the top line. - Each "find open bracket" command goes backward to the open bracket - matching the (_N-th) close bracket in the bottom line. - - m_<_l_e_t_t_e_r_> Mark the current top line with . - M_<_l_e_t_t_e_r_> Mark the current bottom line with . - '_<_l_e_t_t_e_r_> Go to a previously marked position. - '' Go to the previous position. - ^X^X Same as '. - ESC-M_<_l_e_t_t_e_r_> Clear a mark. - --------------------------------------------------- - A mark is any upper-case or lower-case letter. - Certain marks are predefined: - ^ means beginning of the file - $ means end of the file - --------------------------------------------------------------------------- - - CCHHAANNGGIINNGG FFIILLEESS - - :e [_f_i_l_e] Examine a new file. - ^X^V Same as :e. - :n * Examine the (_N-th) next file from the command line. - :p * Examine the (_N-th) previous file from the command line. - :x * Examine the first (or _N-th) file from the command line. - :d Delete the current file from the command line list. - = ^G :f Print current file name. - --------------------------------------------------------------------------- - - MMIISSCCEELLLLAANNEEOOUUSS CCOOMMMMAANNDDSS - - -_<_f_l_a_g_> Toggle a command line option [see OPTIONS below]. - --_<_n_a_m_e_> Toggle a command line option, by name. - __<_f_l_a_g_> Display the setting of a command line option. - ___<_n_a_m_e_> Display the setting of an option, by name. - +_c_m_d Execute the less cmd each time a new file is examined. - - !_c_o_m_m_a_n_d Execute the shell command with $SHELL. - |XX_c_o_m_m_a_n_d Pipe file between current pos & mark XX to shell command. - s _f_i_l_e Save input to a file. - v Edit the current file with $VISUAL or $EDITOR. - V Print version number of "less". - --------------------------------------------------------------------------- - - OOPPTTIIOONNSS - - Most options may be changed either on the command line, - or from within less by using the - or -- command. - Options may be given in one of two forms: either a single - character preceded by a -, or a name preceded by --. - - -? ........ --help - Display help (from command line). - -a ........ --search-skip-screen - Search skips current screen. - -A ........ --SEARCH-SKIP-SCREEN - Search starts just after target line. - -b [_N] .... --buffers=[_N] - Number of buffers. - -B ........ --auto-buffers - Don't automatically allocate buffers for pipes. - -c ........ --clear-screen - Repaint by clearing rather than scrolling. - -d ........ --dumb - Dumb terminal. - -D xx_c_o_l_o_r . --color=xx_c_o_l_o_r - Set screen colors. - -e -E .... --quit-at-eof --QUIT-AT-EOF - Quit at end of file. - -f ........ --force - Force open non-regular files. - -F ........ --quit-if-one-screen - Quit if entire file fits on first screen. - -g ........ --hilite-search - Highlight only last match for searches. - -G ........ --HILITE-SEARCH - Don't highlight any matches for searches. - -h [_N] .... --max-back-scroll=[_N] - Backward scroll limit. - -i ........ --ignore-case - Ignore case in searches that do not contain uppercase. - -I ........ --IGNORE-CASE - Ignore case in all searches. - -j [_N] .... --jump-target=[_N] - Screen position of target lines. - -J ........ --status-column - Display a status column at left edge of screen. - -k [_f_i_l_e] . --lesskey-file=[_f_i_l_e] - Use a lesskey file. - -K ........ --quit-on-intr - Exit less in response to ctrl-C. - -L ........ --no-lessopen - Ignore the LESSOPEN environment variable. - -m -M .... --long-prompt --LONG-PROMPT - Set prompt style. - -n -N .... --line-numbers --LINE-NUMBERS - Don't use line numbers. - -o [_f_i_l_e] . --log-file=[_f_i_l_e] - Copy to log file (standard input only). - -O [_f_i_l_e] . --LOG-FILE=[_f_i_l_e] - Copy to log file (unconditionally overwrite). - -p [_p_a_t_t_e_r_n] --pattern=[_p_a_t_t_e_r_n] - Start at pattern (from command line). - -P [_p_r_o_m_p_t] --prompt=[_p_r_o_m_p_t] - Define new prompt. - -q -Q .... --quiet --QUIET --silent --SILENT - Quiet the terminal bell. - -r -R .... --raw-control-chars --RAW-CONTROL-CHARS - Output "raw" control characters. - -s ........ --squeeze-blank-lines - Squeeze multiple blank lines. - -S ........ --chop-long-lines - Chop (truncate) long lines rather than wrapping. - -t [_t_a_g] .. --tag=[_t_a_g] - Find a tag. - -T [_t_a_g_s_f_i_l_e] --tag-file=[_t_a_g_s_f_i_l_e] - Use an alternate tags file. - -u -U .... --underline-special --UNDERLINE-SPECIAL - Change handling of backspaces. - -V ........ --version - Display the version number of "less". - -w ........ --hilite-unread - Highlight first new line after forward-screen. - -W ........ --HILITE-UNREAD - Highlight first new line after any forward movement. - -x [_N[,...]] --tabs=[_N[,...]] - Set tab stops. - -X ........ --no-init - Don't use termcap init/deinit strings. - -y [_N] .... --max-forw-scroll=[_N] - Forward scroll limit. - -z [_N] .... --window=[_N] - Set size of window. - -" [_c[_c]] . --quotes=[_c[_c]] - Set shell quote characters. - -~ ........ --tilde - Don't display tildes after end of file. - -# [_N] .... --shift=[_N] - Set horizontal scroll amount (0 = one half screen width). - --follow-name - The F command changes files if the input file is renamed. - --incsearch - Search file as each pattern character is typed in. - --line-num-width=N - Set the width of the -N line number field to N characters. - --mouse - Enable mouse input. - --no-keypad - Don't send termcap keypad init/deinit strings. - --no-histdups - Remove duplicates from command history. - --rscroll=C - Set the character used to mark truncated lines. - --save-marks - Retain marks across invocations of less. - --status-col-width=N - Set the width of the -J status column to N characters. - --use-backslash - Subsequent options use backslash as escape char. - --use-color - Enables colored text. - --wheel-lines=N - Each click of the mouse wheel moves N lines. - - - --------------------------------------------------------------------------- - - LLIINNEE EEDDIITTIINNGG - - These keys can be used to edit text being entered - on the "command line" at the bottom of the screen. - - RightArrow ..................... ESC-l ... Move cursor right one character. - LeftArrow ...................... ESC-h ... Move cursor left one character. - ctrl-RightArrow ESC-RightArrow ESC-w ... Move cursor right one word. - ctrl-LeftArrow ESC-LeftArrow ESC-b ... Move cursor left one word. - HOME ........................... ESC-0 ... Move cursor to start of line. - END ............................ ESC-$ ... Move cursor to end of line. - BACKSPACE ................................ Delete char to left of cursor. - DELETE ......................... ESC-x ... Delete char under cursor. - ctrl-BACKSPACE ESC-BACKSPACE ........... Delete word to left of cursor. - ctrl-DELETE .... ESC-DELETE .... ESC-X ... Delete word under cursor. - ctrl-U ......... ESC (MS-DOS only) ....... Delete entire line. - UpArrow ........................ ESC-k ... Retrieve previous command line. - DownArrow ...................... ESC-j ... Retrieve next command line. - TAB ...................................... Complete filename & cycle. - SHIFT-TAB ...................... ESC-TAB Complete filename & reverse cycle. - ctrl-L ................................... Complete filename, list all. From 7dd29907410b4c388668de4078f41ffcc5b9ec6b Mon Sep 17 00:00:00 2001 From: Paramadon Date: Fri, 26 Apr 2024 17:06:27 -0400 Subject: [PATCH 27/47] fixing bug --- .github/workflows/operator-integration-test.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/operator-integration-test.yml b/.github/workflows/operator-integration-test.yml index 917e3631f..5df01a509 100644 --- a/.github/workflows/operator-integration-test.yml +++ b/.github/workflows/operator-integration-test.yml @@ -128,7 +128,6 @@ jobs: kubectl describe pods -n default kubectl describe pods -n amazon-cloudwatch go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/python-java/default_instrumentation_python-java_env_variables.json - kubectl get deployment amazon-cloudwatch-observability-controller-manager -n amazon-cloudwatch -o yaml # kubectl describe pods -n default # kubectl describe pods -n amazon-cloudwatch From d6a67563996478821974818ac644b3b078b7c9ea Mon Sep 17 00:00:00 2001 From: Paramadon Date: Mon, 29 Apr 2024 09:54:37 -0400 Subject: [PATCH 28/47] lowering times --- .../workflows/operator-integration-test.yml | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/.github/workflows/operator-integration-test.yml b/.github/workflows/operator-integration-test.yml index 5df01a509..c9f9cbb57 100644 --- a/.github/workflows/operator-integration-test.yml +++ b/.github/workflows/operator-integration-test.yml @@ -54,13 +54,11 @@ jobs: - name: Deploy operator to minikube run: | make deploy - sleep 10 - kubectl get pods -A - kubectl describe pods -A - sleep 10 + sleep 5 kubectl patch deploy -n amazon-cloudwatch cloudwatch-controller-manager --type='json' -p '[{"op": "replace", "path": "/spec/template/spec/containers/0/image", "value": "aws/cloudwatch-agent-operator:1.2.0"}, {"op": "replace", "path": "/spec/template/spec/containers/0/imagePullPolicy", "value": "Always"}]' + sleep 5 kubectl delete pods --all -n amazon-cloudwatch - sleep 60 + - name: Test case for AmazonCloudWatchAgent pod creation run: | helm template --namespace amazon-cloudwatch -s templates/linux/cloudwatch-agent-daemonset.yaml ./helm --set region=us-west-2 | kubectl apply --namespace amazon-cloudwatch -f - @@ -110,8 +108,6 @@ jobs: run: | kubectl apply -f integration-tests/manifests/sample-instrumentation.yaml sleep 5 - kubectl rollout restart deployment nginx - sleep 5 kubectl get pods -A kubectl describe pods -n default cd integration-tests/manifests/cmd @@ -121,23 +117,18 @@ jobs: - name: Test for default instrumentation resources for python and java run: | kubectl apply -f integration-tests/python-java/sample-deployment-python-java.yaml - sleep 60 - kubectl rollout restart deployment nginx - sleep 60 + sleep 5 kubectl get pods -A kubectl describe pods -n default kubectl describe pods -n amazon-cloudwatch go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/python-java/default_instrumentation_python-java_env_variables.json - # kubectl describe pods -n default - # kubectl describe pods -n amazon-cloudwatch + - name: Test for defined instrumentation resources for python and java run: | kubectl apply -f integration-tests/manifests/sample-instrumentation.yaml sleep 5 - kubectl rollout restart deployment nginx - sleep 5 kubectl get pods -A kubectl describe pods -n default cd integration-tests/manifests/cmd From e08b517adce74d675f49edf1350d31b1c692cf4f Mon Sep 17 00:00:00 2001 From: Paramadon Date: Mon, 29 Apr 2024 11:16:36 -0400 Subject: [PATCH 29/47] fixing test --- .github/workflows/operator-integration-test.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/operator-integration-test.yml b/.github/workflows/operator-integration-test.yml index c9f9cbb57..fed61ab18 100644 --- a/.github/workflows/operator-integration-test.yml +++ b/.github/workflows/operator-integration-test.yml @@ -182,8 +182,8 @@ jobs: go test -v -run TestPythonOnlyDeployment ./integration-tests/manifests/annotations -timeout 30m kubectl get pods -A kubectl describe pods -n default - - + + DaemonsetAnnotationsTest: name: DaemonsetAnnotationsTest @@ -232,8 +232,8 @@ jobs: go test -v -run TestPythonOnlyDaemonSet ./integration-tests/manifests/annotations -timeout 30m kubectl get pods -A kubectl describe pods -n default - - + + StatefulsetAnnotationsTest: name: StatefulsetAnnotationsTest From 51f6913ff4158557add18239c8ca6efd3c3b8d84 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Mon, 29 Apr 2024 11:47:22 -0400 Subject: [PATCH 30/47] fixing instrumentation --- .../manifests/cmd/ns_instrumentation_env_variables.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-tests/manifests/cmd/ns_instrumentation_env_variables.json b/integration-tests/manifests/cmd/ns_instrumentation_env_variables.json index d47ff1574..3c328cde5 100644 --- a/integration-tests/manifests/cmd/ns_instrumentation_env_variables.json +++ b/integration-tests/manifests/cmd/ns_instrumentation_env_variables.json @@ -2,5 +2,5 @@ "OTEL_TRACES_SAMPLER":"traceidratio", "OTEL_TRACES_SAMPLER_ARG": "0.5", "OTEL_EXPORTER_OTLP_ENDPOINT":"http://example.com/collector", - "OTEL_PROPAGATORS": "tracecontext,baggage,b3" + "OTEL_PROPAGATORS": "tracecontext,baggage,b3,xray" } \ No newline at end of file From f24c2b5061a2fb03f39a549adeea0608d9fe1726 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Mon, 29 Apr 2024 12:06:45 -0400 Subject: [PATCH 31/47] fixing instrumentation --- integration-tests/manifests/sample-instrumentation.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/integration-tests/manifests/sample-instrumentation.yaml b/integration-tests/manifests/sample-instrumentation.yaml index 899bb137c..d7158042d 100644 --- a/integration-tests/manifests/sample-instrumentation.yaml +++ b/integration-tests/manifests/sample-instrumentation.yaml @@ -16,4 +16,5 @@ spec: propagators: - tracecontext - baggage - - b3 \ No newline at end of file + - b3 + - xray \ No newline at end of file From cbb76f062a985ff3f26a840b3d48932db810e052 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Mon, 29 Apr 2024 12:31:56 -0400 Subject: [PATCH 32/47] fixing keys --- .../python/default_instrumentation_python_env_variables.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/integration-tests/python/default_instrumentation_python_env_variables.json b/integration-tests/python/default_instrumentation_python_env_variables.json index d1334ff71..502c67a4a 100644 --- a/integration-tests/python/default_instrumentation_python_env_variables.json +++ b/integration-tests/python/default_instrumentation_python_env_variables.json @@ -3,7 +3,7 @@ "PYTHONPATH": "/otel-auto-instrumentation-python/opentelemetry/instrumentation/auto_instrumentation:/otel-auto-instrumentation-python", "OTEL_AWS_APP_SIGNALS_ENABLED": "true", "OTEL_TRACES_SAMPLER_ARG": "endpoint=http://cloudwatch-agent.amazon-cloudwatch:2000", - "OTEL_TRACES_SAMPLER": "xray", + "OTEL_TRACES_SAMPLER": "traceidratio", "OTEL_EXPORTER_OTLP_PROTOCOL": "http/protobuf", "OTEL_EXPORTER_OTLP_TRACES_ENDPOINT": "http://cloudwatch-agent.amazon-cloudwatch:4316/v1/traces", "OTEL_AWS_APP_SIGNALS_EXPORTER_ENDPOINT": "http://cloudwatch-agent.amazon-cloudwatch:4316/v1/metrics", From 07720b8633797f9994214beb0f9ef4bfee2614bb Mon Sep 17 00:00:00 2001 From: Paramadon Date: Mon, 29 Apr 2024 12:40:36 -0400 Subject: [PATCH 33/47] removing patch from operator --- .github/workflows/operator-integration-test.yml | 6 +----- .../default_instrumentation_python_env_variables.json | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/operator-integration-test.yml b/.github/workflows/operator-integration-test.yml index fed61ab18..02eaa43fb 100644 --- a/.github/workflows/operator-integration-test.yml +++ b/.github/workflows/operator-integration-test.yml @@ -54,10 +54,6 @@ jobs: - name: Deploy operator to minikube run: | make deploy - sleep 5 - kubectl patch deploy -n amazon-cloudwatch cloudwatch-controller-manager --type='json' -p '[{"op": "replace", "path": "/spec/template/spec/containers/0/image", "value": "aws/cloudwatch-agent-operator:1.2.0"}, {"op": "replace", "path": "/spec/template/spec/containers/0/imagePullPolicy", "value": "Always"}]' - sleep 5 - kubectl delete pods --all -n amazon-cloudwatch - name: Test case for AmazonCloudWatchAgent pod creation run: | @@ -102,7 +98,7 @@ jobs: kubectl get pods -A kubectl describe pods -n default go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/python/default_instrumentation_python_env_variables.json - + - name: Test for defined instrumentation resources for python run: | diff --git a/integration-tests/python/default_instrumentation_python_env_variables.json b/integration-tests/python/default_instrumentation_python_env_variables.json index 502c67a4a..d1334ff71 100644 --- a/integration-tests/python/default_instrumentation_python_env_variables.json +++ b/integration-tests/python/default_instrumentation_python_env_variables.json @@ -3,7 +3,7 @@ "PYTHONPATH": "/otel-auto-instrumentation-python/opentelemetry/instrumentation/auto_instrumentation:/otel-auto-instrumentation-python", "OTEL_AWS_APP_SIGNALS_ENABLED": "true", "OTEL_TRACES_SAMPLER_ARG": "endpoint=http://cloudwatch-agent.amazon-cloudwatch:2000", - "OTEL_TRACES_SAMPLER": "traceidratio", + "OTEL_TRACES_SAMPLER": "xray", "OTEL_EXPORTER_OTLP_PROTOCOL": "http/protobuf", "OTEL_EXPORTER_OTLP_TRACES_ENDPOINT": "http://cloudwatch-agent.amazon-cloudwatch:4316/v1/traces", "OTEL_AWS_APP_SIGNALS_EXPORTER_ENDPOINT": "http://cloudwatch-agent.amazon-cloudwatch:4316/v1/metrics", From 80ede30b47cb7cc7b10d939caa813c63c92398a6 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Mon, 29 Apr 2024 13:00:10 -0400 Subject: [PATCH 34/47] fixed python issue --- .github/workflows/operator-integration-test.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/operator-integration-test.yml b/.github/workflows/operator-integration-test.yml index 02eaa43fb..6994af9d6 100644 --- a/.github/workflows/operator-integration-test.yml +++ b/.github/workflows/operator-integration-test.yml @@ -98,12 +98,15 @@ jobs: kubectl get pods -A kubectl describe pods -n default go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/python/default_instrumentation_python_env_variables.json - + kubectl delete deployment nginx + sleep 5 - name: Test for defined instrumentation resources for python run: | kubectl apply -f integration-tests/manifests/sample-instrumentation.yaml sleep 5 + kubectl rollout restart deployment nginx + sleep 5 kubectl get pods -A kubectl describe pods -n default cd integration-tests/manifests/cmd From f269124e91059ba7b30a1c4fc86e4fad38d75959 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Mon, 29 Apr 2024 13:31:17 -0400 Subject: [PATCH 35/47] fixed python issue --- .github/workflows/operator-integration-test.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/operator-integration-test.yml b/.github/workflows/operator-integration-test.yml index 6994af9d6..8e6e134c3 100644 --- a/.github/workflows/operator-integration-test.yml +++ b/.github/workflows/operator-integration-test.yml @@ -98,8 +98,6 @@ jobs: kubectl get pods -A kubectl describe pods -n default go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/python/default_instrumentation_python_env_variables.json - kubectl delete deployment nginx - sleep 5 - name: Test for defined instrumentation resources for python run: | From bd825d639c9ebcd9461d6247382ce430742dbc6e Mon Sep 17 00:00:00 2001 From: Paramadon Date: Mon, 29 Apr 2024 13:46:45 -0400 Subject: [PATCH 36/47] adding restart to nginx --- .github/workflows/operator-integration-test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/operator-integration-test.yml b/.github/workflows/operator-integration-test.yml index 8e6e134c3..b733fe1ab 100644 --- a/.github/workflows/operator-integration-test.yml +++ b/.github/workflows/operator-integration-test.yml @@ -126,6 +126,8 @@ jobs: run: | kubectl apply -f integration-tests/manifests/sample-instrumentation.yaml sleep 5 + kubectl rollout restart deployment nginx + sleep 5 kubectl get pods -A kubectl describe pods -n default cd integration-tests/manifests/cmd From d2e3199a75a2110a1ca911e432e9909a98ea1e4d Mon Sep 17 00:00:00 2001 From: Paramadon Date: Mon, 29 Apr 2024 13:49:07 -0400 Subject: [PATCH 37/47] fixed timing --- .github/workflows/operator-integration-test.yml | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/operator-integration-test.yml b/.github/workflows/operator-integration-test.yml index b733fe1ab..700138fb3 100644 --- a/.github/workflows/operator-integration-test.yml +++ b/.github/workflows/operator-integration-test.yml @@ -72,7 +72,7 @@ jobs: - name: Test for default instrumentation resources for Java run: | kubectl apply -f integration-tests/java/sample-deployment-java.yaml - sleep 5 + kubectl wait --for=condition=Ready pod --all -n default kubectl get pods -A kubectl describe pods -n default go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/java/default_instrumentation_java_env_variables.json @@ -80,9 +80,8 @@ jobs: - name: Test for defined instrumentation resources for Java run: | kubectl apply -f integration-tests/manifests/sample-instrumentation.yaml - sleep 5 kubectl rollout restart deployment nginx - sleep 5 + kubectl wait --for=condition=Ready pod --all -n default kubectl get pods -A kubectl describe pods -n default cd integration-tests/manifests/cmd @@ -92,9 +91,8 @@ jobs: - name: Test for default instrumentation resources for python run: | kubectl apply -f integration-tests/python/sample-deployment-python.yaml - sleep 5 kubectl rollout restart deployment nginx - sleep 5 + kubectl wait --for=condition=Ready pod --all -n default kubectl get pods -A kubectl describe pods -n default go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/python/default_instrumentation_python_env_variables.json @@ -102,9 +100,8 @@ jobs: - name: Test for defined instrumentation resources for python run: | kubectl apply -f integration-tests/manifests/sample-instrumentation.yaml - sleep 5 kubectl rollout restart deployment nginx - sleep 5 + kubectl wait --for=condition=Ready pod --all -n default kubectl get pods -A kubectl describe pods -n default cd integration-tests/manifests/cmd @@ -114,7 +111,7 @@ jobs: - name: Test for default instrumentation resources for python and java run: | kubectl apply -f integration-tests/python-java/sample-deployment-python-java.yaml - sleep 5 + kubectl wait --for=condition=Ready pod --all -n default kubectl get pods -A kubectl describe pods -n default kubectl describe pods -n amazon-cloudwatch @@ -125,6 +122,8 @@ jobs: - name: Test for defined instrumentation resources for python and java run: | kubectl apply -f integration-tests/manifests/sample-instrumentation.yaml + kubectl delete pods --all -n default + kubectl wait --for=condition=Ready pod --all -n default sleep 5 kubectl rollout restart deployment nginx sleep 5 From 7e7af5c9b0cf531acc579cfafc27cc28284713f8 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Mon, 29 Apr 2024 14:08:40 -0400 Subject: [PATCH 38/47] fixed wait cond --- .github/workflows/operator-integration-test.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/operator-integration-test.yml b/.github/workflows/operator-integration-test.yml index 700138fb3..e320f7631 100644 --- a/.github/workflows/operator-integration-test.yml +++ b/.github/workflows/operator-integration-test.yml @@ -72,6 +72,7 @@ jobs: - name: Test for default instrumentation resources for Java run: | kubectl apply -f integration-tests/java/sample-deployment-java.yaml + sleep 3 kubectl wait --for=condition=Ready pod --all -n default kubectl get pods -A kubectl describe pods -n default @@ -81,6 +82,7 @@ jobs: run: | kubectl apply -f integration-tests/manifests/sample-instrumentation.yaml kubectl rollout restart deployment nginx + sleep 3 kubectl wait --for=condition=Ready pod --all -n default kubectl get pods -A kubectl describe pods -n default @@ -92,6 +94,7 @@ jobs: run: | kubectl apply -f integration-tests/python/sample-deployment-python.yaml kubectl rollout restart deployment nginx + sleep 3 kubectl wait --for=condition=Ready pod --all -n default kubectl get pods -A kubectl describe pods -n default @@ -101,6 +104,7 @@ jobs: run: | kubectl apply -f integration-tests/manifests/sample-instrumentation.yaml kubectl rollout restart deployment nginx + sleep 3 kubectl wait --for=condition=Ready pod --all -n default kubectl get pods -A kubectl describe pods -n default @@ -111,6 +115,7 @@ jobs: - name: Test for default instrumentation resources for python and java run: | kubectl apply -f integration-tests/python-java/sample-deployment-python-java.yaml + sleep 3 kubectl wait --for=condition=Ready pod --all -n default kubectl get pods -A kubectl describe pods -n default @@ -123,8 +128,8 @@ jobs: run: | kubectl apply -f integration-tests/manifests/sample-instrumentation.yaml kubectl delete pods --all -n default + sleep 3 kubectl wait --for=condition=Ready pod --all -n default - sleep 5 kubectl rollout restart deployment nginx sleep 5 kubectl get pods -A From 0e5273a751aea5aaa9c8885a97c3f5ac61911366 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Mon, 29 Apr 2024 19:01:06 -0400 Subject: [PATCH 39/47] waiting to delete pod --- .github/workflows/operator-integration-test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/operator-integration-test.yml b/.github/workflows/operator-integration-test.yml index e320f7631..15dfcb665 100644 --- a/.github/workflows/operator-integration-test.yml +++ b/.github/workflows/operator-integration-test.yml @@ -89,6 +89,8 @@ jobs: cd integration-tests/manifests/cmd go run validate_instrumentation_vars.go default ns_instrumentation_env_variables.json kubectl delete instrumentation sample-instrumentation + kubectl wait --for=delete pod --all -n default + - name: Test for default instrumentation resources for python run: | @@ -111,6 +113,7 @@ jobs: cd integration-tests/manifests/cmd go run validate_instrumentation_vars.go default ns_instrumentation_env_variables.json kubectl delete instrumentation sample-instrumentation + kubectl wait --for=delete pod --all -n default - name: Test for default instrumentation resources for python and java run: | @@ -137,6 +140,7 @@ jobs: cd integration-tests/manifests/cmd go run validate_instrumentation_vars.go default ns_instrumentation_env_variables.json kubectl delete instrumentation sample-instrumentation + kubectl wait --for=delete pod --all -n default DeploymentAnnotationsTest: name: DeploymentAnnotationsTest From 3d13e68b50c790ab1df20fca91fb4880fbf05e8d Mon Sep 17 00:00:00 2001 From: Paramadon Date: Tue, 30 Apr 2024 10:39:28 -0400 Subject: [PATCH 40/47] fixing ready cond --- .github/workflows/operator-integration-test.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/operator-integration-test.yml b/.github/workflows/operator-integration-test.yml index 15dfcb665..ce789b7b7 100644 --- a/.github/workflows/operator-integration-test.yml +++ b/.github/workflows/operator-integration-test.yml @@ -89,7 +89,8 @@ jobs: cd integration-tests/manifests/cmd go run validate_instrumentation_vars.go default ns_instrumentation_env_variables.json kubectl delete instrumentation sample-instrumentation - kubectl wait --for=delete pod --all -n default + sleep 2 + kubectl wait --for=condition=Ready pod --all -n default - name: Test for default instrumentation resources for python @@ -113,7 +114,7 @@ jobs: cd integration-tests/manifests/cmd go run validate_instrumentation_vars.go default ns_instrumentation_env_variables.json kubectl delete instrumentation sample-instrumentation - kubectl wait --for=delete pod --all -n default + kubectl wait --for=condition=Ready pod --all -n default - name: Test for default instrumentation resources for python and java run: | @@ -140,7 +141,7 @@ jobs: cd integration-tests/manifests/cmd go run validate_instrumentation_vars.go default ns_instrumentation_env_variables.json kubectl delete instrumentation sample-instrumentation - kubectl wait --for=delete pod --all -n default + kubectl wait --for=condition=Ready pod --all -n default DeploymentAnnotationsTest: name: DeploymentAnnotationsTest From b3e86f2fee71557213e6a687375a961988e6b9d2 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Tue, 30 Apr 2024 11:47:35 -0400 Subject: [PATCH 41/47] remove deleting pod --- .github/workflows/operator-integration-test.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/operator-integration-test.yml b/.github/workflows/operator-integration-test.yml index ce789b7b7..6db7c51a8 100644 --- a/.github/workflows/operator-integration-test.yml +++ b/.github/workflows/operator-integration-test.yml @@ -131,11 +131,9 @@ jobs: - name: Test for defined instrumentation resources for python and java run: | kubectl apply -f integration-tests/manifests/sample-instrumentation.yaml - kubectl delete pods --all -n default - sleep 3 - kubectl wait --for=condition=Ready pod --all -n default kubectl rollout restart deployment nginx - sleep 5 + sleep 2 + kubectl wait --for=condition=Ready pod --all -n default kubectl get pods -A kubectl describe pods -n default cd integration-tests/manifests/cmd From 919adaf71329576893ff9213bd3958534ff70cb8 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Tue, 30 Apr 2024 12:12:55 -0400 Subject: [PATCH 42/47] removing unnecessary waits --- .github/workflows/operator-integration-test.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/operator-integration-test.yml b/.github/workflows/operator-integration-test.yml index 6db7c51a8..957163114 100644 --- a/.github/workflows/operator-integration-test.yml +++ b/.github/workflows/operator-integration-test.yml @@ -89,8 +89,6 @@ jobs: cd integration-tests/manifests/cmd go run validate_instrumentation_vars.go default ns_instrumentation_env_variables.json kubectl delete instrumentation sample-instrumentation - sleep 2 - kubectl wait --for=condition=Ready pod --all -n default - name: Test for default instrumentation resources for python @@ -114,7 +112,6 @@ jobs: cd integration-tests/manifests/cmd go run validate_instrumentation_vars.go default ns_instrumentation_env_variables.json kubectl delete instrumentation sample-instrumentation - kubectl wait --for=condition=Ready pod --all -n default - name: Test for default instrumentation resources for python and java run: | @@ -139,7 +136,6 @@ jobs: cd integration-tests/manifests/cmd go run validate_instrumentation_vars.go default ns_instrumentation_env_variables.json kubectl delete instrumentation sample-instrumentation - kubectl wait --for=condition=Ready pod --all -n default DeploymentAnnotationsTest: name: DeploymentAnnotationsTest From d004092eb50b19aff229c50cdd94cf67f2733c2f Mon Sep 17 00:00:00 2001 From: Paramadon Date: Tue, 30 Apr 2024 14:12:53 -0400 Subject: [PATCH 43/47] fix wait command --- .github/workflows/operator-integration-test.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/operator-integration-test.yml b/.github/workflows/operator-integration-test.yml index ca5ace981..2b14d2823 100644 --- a/.github/workflows/operator-integration-test.yml +++ b/.github/workflows/operator-integration-test.yml @@ -73,7 +73,7 @@ jobs: run: | kubectl apply -f integration-tests/java/sample-deployment-java.yaml sleep 3 - kubectl wait --for=condition=Ready pod --all -n default + kubectl wait --for=condition=Ready pod --all --field-selector=status.phase!=Terminating -n default kubectl get pods -A kubectl describe pods -n default go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/java/default_instrumentation_java_env_variables.json @@ -83,7 +83,7 @@ jobs: kubectl apply -f integration-tests/manifests/sample-instrumentation.yaml kubectl rollout restart deployment nginx sleep 3 - kubectl wait --for=condition=Ready pod --all -n default + kubectl wait --for=condition=Ready pod --all --field-selector=status.phase!=Terminating -n default kubectl get pods -A kubectl describe pods -n default cd integration-tests/manifests/cmd @@ -96,7 +96,7 @@ jobs: kubectl apply -f integration-tests/python/sample-deployment-python.yaml kubectl rollout restart deployment nginx sleep 3 - kubectl wait --for=condition=Ready pod --all -n default + kubectl wait --for=condition=Ready pod --all --field-selector=status.phase!=Terminating -n default kubectl get pods -A kubectl describe pods -n default go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/python/default_instrumentation_python_env_variables.json @@ -106,7 +106,7 @@ jobs: kubectl apply -f integration-tests/manifests/sample-instrumentation.yaml kubectl rollout restart deployment nginx sleep 3 - kubectl wait --for=condition=Ready pod --all -n default + kubectl wait --for=condition=Ready pod --all --field-selector=status.phase!=Terminating -n default kubectl get pods -A kubectl describe pods -n default cd integration-tests/manifests/cmd @@ -117,7 +117,7 @@ jobs: run: | kubectl apply -f integration-tests/python-java/sample-deployment-python-java.yaml sleep 3 - kubectl wait --for=condition=Ready pod --all -n default + kubectl wait --for=condition=Ready pod --all --field-selector=status.phase!=Terminating -n default kubectl get pods -A kubectl describe pods -n default kubectl describe pods -n amazon-cloudwatch @@ -130,7 +130,7 @@ jobs: kubectl apply -f integration-tests/manifests/sample-instrumentation.yaml kubectl rollout restart deployment nginx sleep 2 - kubectl wait --for=condition=Ready pod --all -n default + kubectl wait --for=condition=Ready pod --all --field-selector=status.phase!=Terminating -n default kubectl get pods -A kubectl describe pods -n default cd integration-tests/manifests/cmd From 7bb9bfc10c2a5483e1e906a26e95f505c3005a61 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Tue, 30 Apr 2024 15:15:25 -0400 Subject: [PATCH 44/47] fixing wait --- .../workflows/operator-integration-test.yml | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/.github/workflows/operator-integration-test.yml b/.github/workflows/operator-integration-test.yml index 2b14d2823..502c6a14c 100644 --- a/.github/workflows/operator-integration-test.yml +++ b/.github/workflows/operator-integration-test.yml @@ -72,8 +72,7 @@ jobs: - name: Test for default instrumentation resources for Java run: | kubectl apply -f integration-tests/java/sample-deployment-java.yaml - sleep 3 - kubectl wait --for=condition=Ready pod --all --field-selector=status.phase!=Terminating -n default + kubectl wait --for=condition=Available deployment/nginx -n default kubectl get pods -A kubectl describe pods -n default go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/java/default_instrumentation_java_env_variables.json @@ -82,8 +81,7 @@ jobs: run: | kubectl apply -f integration-tests/manifests/sample-instrumentation.yaml kubectl rollout restart deployment nginx - sleep 3 - kubectl wait --for=condition=Ready pod --all --field-selector=status.phase!=Terminating -n default + kubectl wait --for=condition=Available deployment/nginx -n default kubectl get pods -A kubectl describe pods -n default cd integration-tests/manifests/cmd @@ -95,8 +93,7 @@ jobs: run: | kubectl apply -f integration-tests/python/sample-deployment-python.yaml kubectl rollout restart deployment nginx - sleep 3 - kubectl wait --for=condition=Ready pod --all --field-selector=status.phase!=Terminating -n default + kubectl wait --for=condition=Available deployment/nginx -n default kubectl get pods -A kubectl describe pods -n default go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/python/default_instrumentation_python_env_variables.json @@ -105,9 +102,7 @@ jobs: run: | kubectl apply -f integration-tests/manifests/sample-instrumentation.yaml kubectl rollout restart deployment nginx - sleep 3 - kubectl wait --for=condition=Ready pod --all --field-selector=status.phase!=Terminating -n default - kubectl get pods -A + kubectl wait --for=condition=Available deployment/nginx -n default kubectl describe pods -n default cd integration-tests/manifests/cmd go run validate_instrumentation_vars.go default ns_instrumentation_env_variables.json @@ -116,8 +111,7 @@ jobs: - name: Test for default instrumentation resources for python and java run: | kubectl apply -f integration-tests/python-java/sample-deployment-python-java.yaml - sleep 3 - kubectl wait --for=condition=Ready pod --all --field-selector=status.phase!=Terminating -n default + kubectl wait --for=condition=Available deployment/nginx -n default kubectl get pods -A kubectl describe pods -n default kubectl describe pods -n amazon-cloudwatch @@ -129,8 +123,7 @@ jobs: run: | kubectl apply -f integration-tests/manifests/sample-instrumentation.yaml kubectl rollout restart deployment nginx - sleep 2 - kubectl wait --for=condition=Ready pod --all --field-selector=status.phase!=Terminating -n default + kubectl wait --for=condition=Available deployment/nginx -n default kubectl get pods -A kubectl describe pods -n default cd integration-tests/manifests/cmd From 148ade735b2f8476f8eae9860f9455f08e796650 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Tue, 30 Apr 2024 15:53:44 -0400 Subject: [PATCH 45/47] quick change --- .github/workflows/operator-integration-test.yml | 10 +++++++++- .../manifests/cmd/validate_instrumentation_vars.go | 5 ++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/operator-integration-test.yml b/.github/workflows/operator-integration-test.yml index 502c6a14c..90e6dc7c9 100644 --- a/.github/workflows/operator-integration-test.yml +++ b/.github/workflows/operator-integration-test.yml @@ -72,7 +72,8 @@ jobs: - name: Test for default instrumentation resources for Java run: | kubectl apply -f integration-tests/java/sample-deployment-java.yaml - kubectl wait --for=condition=Available deployment/nginx -n default +# sleep is to make sure the app is fully active before restart wait doesn't work as accurately + sleep 5 kubectl get pods -A kubectl describe pods -n default go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/java/default_instrumentation_java_env_variables.json @@ -80,6 +81,7 @@ jobs: - name: Test for defined instrumentation resources for Java run: | kubectl apply -f integration-tests/manifests/sample-instrumentation.yaml + sleep 5 kubectl rollout restart deployment nginx kubectl wait --for=condition=Available deployment/nginx -n default kubectl get pods -A @@ -92,6 +94,7 @@ jobs: - name: Test for default instrumentation resources for python run: | kubectl apply -f integration-tests/python/sample-deployment-python.yaml + sleep 5 kubectl rollout restart deployment nginx kubectl wait --for=condition=Available deployment/nginx -n default kubectl get pods -A @@ -101,6 +104,7 @@ jobs: - name: Test for defined instrumentation resources for python run: | kubectl apply -f integration-tests/manifests/sample-instrumentation.yaml + sleep 5 kubectl rollout restart deployment nginx kubectl wait --for=condition=Available deployment/nginx -n default kubectl describe pods -n default @@ -111,7 +115,10 @@ jobs: - name: Test for default instrumentation resources for python and java run: | kubectl apply -f integration-tests/python-java/sample-deployment-python-java.yaml + sleep 5 + kubectl rollout restart deployment nginx kubectl wait --for=condition=Available deployment/nginx -n default + sleep 5 kubectl get pods -A kubectl describe pods -n default kubectl describe pods -n amazon-cloudwatch @@ -122,6 +129,7 @@ jobs: - name: Test for defined instrumentation resources for python and java run: | kubectl apply -f integration-tests/manifests/sample-instrumentation.yaml + sleep 5 kubectl rollout restart deployment nginx kubectl wait --for=condition=Available deployment/nginx -n default kubectl get pods -A diff --git a/integration-tests/manifests/cmd/validate_instrumentation_vars.go b/integration-tests/manifests/cmd/validate_instrumentation_vars.go index 979e8c462..96cca63e2 100644 --- a/integration-tests/manifests/cmd/validate_instrumentation_vars.go +++ b/integration-tests/manifests/cmd/validate_instrumentation_vars.go @@ -52,7 +52,10 @@ func main() { } func verifyInstrumentationEnvVariables(clientset *kubernetes.Clientset, namespace, jsonPath string) bool { - podList, err := clientset.CoreV1().Pods(namespace).List(context.TODO(), metav1.ListOptions{LabelSelector: "app=nginx"}) + podList, err := clientset.CoreV1().Pods(namespace).List(context.TODO(), metav1.ListOptions{ + LabelSelector: "app=nginx", + FieldSelector: "status.phase!=Terminating", + }) if err != nil { fmt.Println("Error retrieving pods:", err) return false From a273b5c402ad13f87f2c1a0e69d967ad2b9f9186 Mon Sep 17 00:00:00 2001 From: Paramadon Date: Mon, 6 May 2024 14:09:47 -0400 Subject: [PATCH 46/47] removing unnecessary file --- helm/values.yaml | 225 ----------------------------------------------- 1 file changed, 225 deletions(-) delete mode 100644 helm/values.yaml diff --git a/helm/values.yaml b/helm/values.yaml deleted file mode 100644 index fc0091187..000000000 --- a/helm/values.yaml +++ /dev/null @@ -1,225 +0,0 @@ -# Default values for amazon-cloudwatch-observability. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 1 - -## Provide a name in place of cloudwatchagent-operator. -## -nameOverride: "" - -## Reference one or more secrets to be used when pulling images from authenticated repositories. -imagePullSecrets: [ ] - -## Provide the ClusterName (optional parameter, if not provided, a generated name will be used) -clusterName: - -## Provide the Region (this is a required parameter) -region: - -gpuNodeLabelKey: node.kubernetes.io/instance-type -## NVIDIA GPU instance types -gpuInstances: [ p2.xlarge, p2.8xlarge, p2.16xlarge, p3.2xlarge, p3.8xlarge, p3.16xlarge, p3dn.24xlarge, p4d.24xlarge, p4de.24xlarge, p5.48xlarge, g3s.xlarge, g3.4xlarge, g3.8xlarge, g3.16xlarge, g4dn.xlarge, g4dn.2xlarge, g4dn.4xlarge, g4dn.8xlarge, g4dn.16xlarge, g4dn.12xlarge, g4dn.metal, g4ad.xlarge, g4ad.2xlarge, g4ad.4xlarge, g4ad.8xlarge, g4ad.16xlarge, g5.xlarge, g5.2xlarge, g5.4xlarge, g5.8xlarge, g5.16xlarge, g5.12xlarge, g5.24xlarge, g5.48xlarge, g5g.xlarge, g5g.2xlarge, g5g.4xlarge, g5g.8xlarge, g5g.16xlarge, g5g.metal ] - -containerLogs: - enabled: true - fluentBit: - image: - repository: aws-for-fluent-bit - tag: 2.32.0.20240304 - tagWindows: 2.31.12-windowsservercore - repositoryDomainMap: - public: public.ecr.aws/aws-observability - cn-north-1: 128054284489.dkr.ecr.cn-north-1.amazonaws.com.cn - cn-northwest-1: 128054284489.dkr.ecr.cn-northwest-1.amazonaws.com.cn - us-gov-east-1: 161423150738.dkr.ecr.us-gov-east-1.amazonaws.com - us-gov-west-1: 161423150738.dkr.ecr.us-gov-west-1.amazonaws.com - -## Provide CloudWatchAgent Operator manager container image and resources. -## -manager: - name: - image: - repository: cloudwatch-agent-operator - tag: 1.1.0 - repositoryDomainMap: - public: public.ecr.aws/cloudwatch-agent - cn-north-1: 934860584483.dkr.ecr.cn-north-1.amazonaws.com.cn - cn-northwest-1: 934860584483.dkr.ecr.cn-northwest-1.amazonaws.com.cn - us-gov-east-1: 743662458514.dkr.ecr.us-gov-east-1.amazonaws.com - us-gov-west-1: 743662458514.dkr.ecr.us-gov-west-1.amazonaws.com - autoInstrumentationImage: - java: - repositoryDomain: public.ecr.aws/aws-observability - repository: adot-autoinstrumentation-java - tag: v1.32.1 - python: - repositoryDomain: public.ecr.aws/aws-observability - repository: adot-autoinstrumentation-python - tag: v0.0.1 - autoAnnotateAutoInstrumentation: - java: - namespaces: [ ] - deployments: [ ] - daemonsets: [ ] - statefulsets: [ ] - python: - namespaces: [ ] - deployments: [ ] - daemonsets: [ ] - statefulsets: [ ] - ports: - containerPort: 9443 - metricsPort: 8080 - webhookPort: 9443 - healthzPort: 8081 - resources: - requests: - cpu: 100m - memory: 64Mi - ## Adds additional environment variables - ## e.g ENV_VAR: env_value - env: - ENABLE_WEBHOOKS: "true" - - # -- Create the manager ServiceAccount - serviceAccount: - create: true - annotations: { } - - podAnnotations: { } - podLabels: { } - - service: - name: - -## Admission webhooks make sure only requests with correctly formatted rules will get into the Operator. -admissionWebhooks: - create: true - failurePolicy: Ignore - secretName: "" - - ## Defines the sidecar injection logic in Pods. - ## - Ignore, the injection is fail-open. The pod will be created, but the sidecar won't be injected. - ## - Fail, the injection is fail-close. If the webhook pod is not ready, pods cannot be created. - pods: - failurePolicy: Ignore - - ## Adds a prefix to the mutating webhook name. - ## This can be used to order this mutating webhook with all your cluster's mutating webhooks. - namePrefix: "" - - ## Customize webhook timeout duration - timeoutSeconds: 10 - - ## Provide selectors for your objects - namespaceSelector: { } - objectSelector: { } - - ## TLS Certificate Option 1: Use Helm to automatically generate self-signed certificate. - ## autoGenerateCert must be enabled. This is the default option. - ## If true, Helm will automatically create a self-signed cert and secret for you. - autoGenerateCert: - enabled: true - expiryDays: 3650 # 10 years - - ## TLS Certificate Option 2: Use certManager to generate self-signed certificate. - ## certManager must be enabled. If enabled, it takes precedence over option 1. - certManager: - enabled: false - ## Provide the issuer kind and name to do the cert auth job. - ## By default, OpenTelemetry Operator will use self-signer issuer. - issuerRef: { } - # kind: - # name: - ## Annotations for the cert and issuer if cert-manager is enabled. - certificateAnnotations: { } - issuerAnnotations: { } - - ## Secret annotations - secretAnnotations: { } - ## Secret labels - secretLabels: { } - -agent: - name: - image: - repository: cloudwatch-agent - tag: 1.300034.0b498 - repositoryDomainMap: - public: public.ecr.aws/cloudwatch-agent - cn-north-1: 934860584483.dkr.ecr.cn-north-1.amazonaws.com.cn - cn-northwest-1: 934860584483.dkr.ecr.cn-northwest-1.amazonaws.com.cn - us-gov-east-1: 743662458514.dkr.ecr.us-gov-east-1.amazonaws.com - us-gov-west-1: 743662458514.dkr.ecr.us-gov-west-1.amazonaws.com - enabled: true - ## TLS Certificate Option 1: Use Helm to automatically generate self-signed certificate. - ## autoGenerateCert must be enabled. This is the default option. - ## If true, Helm will automatically create a self-signed cert and secret for you. - autoGenerateCert: - enabled: true - expiryDays: 3650 # 10 years - - ## TLS Certificate Option 2: Use certManager to generate self-signed certificate. - ## certManager must be enabled. If enabled, it takes precedence over option 1. - certManager: - enabled: false - ## Provide the issuer kind and name to do the cert auth job. - ## By default, OpenTelemetry Operator will use self-signer issuer. - issuerRef: { } - # kind: - # name: - ## Annotations for the cert and issuer if cert-manager is enabled. - certificateAnnotations: { } - issuerAnnotations: { } - serviceAccount: - name: # override agent service account name - config: # optional config that can be provided to override the defaultConfig - defaultConfig: - { - "logs": { - "metrics_collected": { - "kubernetes": { - "enhanced_container_insights": true - }, - "app_signals": { } - } - }, - "traces": { - "traces_collected": { - "app_signals": { } - } - } - } - windowsDefaultConfig: - { - "logs": { - "metrics_collected": { - "kubernetes": { - "enhanced_container_insights": true - }, - } - } - } - -dcgmExporter: - name: - image: - repository: dcgm-exporter - tag: 3.3.3-3.3.1-ubuntu22.04 - repositoryDomainMap: - public: nvcr.io/nvidia/k8s - cn-north-1: 934860584483.dkr.ecr.cn-north-1.amazonaws.com.cn - cn-northwest-1: 934860584483.dkr.ecr.cn-northwest-1.amazonaws.com.cn - us-gov-east-1: 743662458514.dkr.ecr.us-gov-east-1.amazonaws.com - us-gov-west-1: 743662458514.dkr.ecr.us-gov-west-1.amazonaws.com - configmap: dcgm-exporter-config-map - arguments: ["--web-config-file=/etc/dcgm-exporter/web-config.yaml"] - service: - enable: true - type: ClusterIP - port: 9400 - address: ":9400" - kubeletPath: "/var/lib/kubelet/pod-resources" - serviceAccount: - name: # override exporter service account name \ No newline at end of file From 2759fc9c0bb528c34fe4c1a13c10a200775e568b Mon Sep 17 00:00:00 2001 From: Paramadon Date: Mon, 6 May 2024 14:11:56 -0400 Subject: [PATCH 47/47] done to merge --- .github/workflows/operator-integration-test.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/operator-integration-test.yml b/.github/workflows/operator-integration-test.yml index 5c4989e97..3db79ee35 100644 --- a/.github/workflows/operator-integration-test.yml +++ b/.github/workflows/operator-integration-test.yml @@ -39,7 +39,6 @@ jobs: run: kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.12.0/cert-manager.yaml - - name: Verify minikube and cert-manager run: | sleep 10 @@ -90,7 +89,6 @@ jobs: go run validate_instrumentation_vars.go default ns_instrumentation_env_variables.json kubectl delete instrumentation sample-instrumentation - - name: Test for default instrumentation resources for python run: | kubectl apply -f integration-tests/python/sample-deployment-python.yaml @@ -124,8 +122,6 @@ jobs: kubectl describe pods -n amazon-cloudwatch go run integration-tests/manifests/cmd/validate_instrumentation_vars.go default integration-tests/python-java/default_instrumentation_python-java_env_variables.json - - - name: Test for defined instrumentation resources for python and java run: | kubectl apply -f integration-tests/manifests/sample-instrumentation.yaml