From 6c7552f896c039e4f6ae562cb6debee6f675fb6b Mon Sep 17 00:00:00 2001 From: Michael Villiger Date: Thu, 10 Oct 2024 19:15:29 -0500 Subject: [PATCH 01/19] updating to dynatrace-operator 1.3.0 and adding test job --- .../dynatrace-dynakube/dynakube-cr.yaml | 16 +-- .../dynatrace-operator/dynatrace-release.yaml | 4 +- .../dynatrace-operator/namespace.yaml | 2 +- .../dynatrace/dynatrace-variables.yaml | 7 +- .../Testers/dynatrace/testJob.yaml | 118 ++++++++++++++++++ 5 files changed, 128 insertions(+), 19 deletions(-) create mode 100644 eks-anywhere-common/Testers/dynatrace/testJob.yaml diff --git a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-dynakube/dynakube-cr.yaml b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-dynakube/dynakube-cr.yaml index 0b4d8127..c651e771 100644 --- a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-dynakube/dynakube-cr.yaml +++ b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-dynakube/dynakube-cr.yaml @@ -1,18 +1,16 @@ --- -apiVersion: dynatrace.com/v1beta1 +apiVersion: dynatrace.com/v1beta2 kind: DynaKube metadata: name: "${dynakubename}" namespace: dynatrace annotations: - feature.dynatrace.com/automatic-kubernetes-api-monitoring: "true" + feature.dynatrace.com/k8s-app-enabled: "true" spec: - apiUrl: ${apiurl} + apiUrl: "${apiurl}" tokens: ${dynatracesecretname} - skipCertCheck: false oneAgent: - classicFullStack: - # image: "" + cloudNativeFullStack: tolerations: - effect: NoSchedule key: node-role.kubernetes.io/master @@ -20,18 +18,14 @@ spec: - effect: NoSchedule key: node-role.kubernetes.io/control-plane operator: Exists - env: - - name: ONEAGENT_ENABLE_VOLUME_STORAGE - value: "${oneagentvolumestorage}" activeGate: capabilities: - routing - kubernetes-monitoring - dynatrace-api - #image: "" resources: requests: - cpu: 50m + cpu: 500m memory: 512Mi limits: cpu: 1000m diff --git a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-release.yaml b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-release.yaml index 7bea5d14..79865d79 100644 --- a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-release.yaml +++ b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-release.yaml @@ -1,5 +1,5 @@ --- -apiVersion: helm.toolkit.fluxcd.io/v2beta1 +apiVersion: helm.toolkit.fluxcd.io/v2 kind: HelmRelease metadata: name: dynatrace-operator @@ -12,7 +12,7 @@ spec: kind: HelmRepository name: dynatrace-operator namespace: flux-system - version: 0.10.1 + version: 1.3.0 interval: 1m0s values: installCRD: true diff --git a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/namespace.yaml b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/namespace.yaml index a3be1d9c..79dfeecf 100644 --- a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/namespace.yaml +++ b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/namespace.yaml @@ -6,4 +6,4 @@ metadata: labels: aws.conformance.vendor: dynatrace aws.conformance.vendor-solution: dynatrace - aws.conformance.vendor-solution-version: 0.10.1 \ No newline at end of file + aws.conformance.vendor-solution-version: 1.3.0 \ No newline at end of file diff --git a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-variables.yaml b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-variables.yaml index f508c548..3171daf7 100644 --- a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-variables.yaml +++ b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-variables.yaml @@ -6,11 +6,8 @@ metadata: namespace: flux-system data: # api url for dynatrace environment - apiurl: "https://syh360.dynatrace-managed.com/e/29143f4b-2894-450d-a1fc-89a197b68909/api" + apiurl: "" # name of secret containing tokens dynatracesecretname: "dt-secret" # name of cluster to be listed in Dynatrace - dynakubename: "eks-flux-test-cluster" - # ONEAGENT_ENABLE_VOLUME_STORAGE should be false for EKS, the escaped are due to flux being weird - # and the value here isn't actually a boolean - oneagentvolumestorage: "\"false\"" \ No newline at end of file + dynakubename: "" diff --git a/eks-anywhere-common/Testers/dynatrace/testJob.yaml b/eks-anywhere-common/Testers/dynatrace/testJob.yaml new file mode 100644 index 00000000..d90a84dc --- /dev/null +++ b/eks-anywhere-common/Testers/dynatrace/testJob.yaml @@ -0,0 +1,118 @@ +apiVersion: batch/v1 +kind: CronJob +metadata: + name: dynatrace-tester-cron + namespace: dynatrace +spec: + schedule: "*/10 * * * *" + jobTemplate: + spec: + template: + spec: + containers: + - name: job + image: 'alpine/k8s:1.26.2' + command: ["/bin/bash", "-c"] + args: + - | + #!/bin/bash + + PATTERN="Ping received: Healthy(" + DAEMONSET_INCLUDE_PATTERN="oneagent" + DAEMONSET_EXCLUDE_PATTERN="csi" + CUSTOM_RESOURCE="dynakubes.dynatrace.com" + EXIT_STATUS=0 # Default to success + echo "Starting search for Dynakubes..." + # Get the list of namespaces + NAMESPACES=$(kubectl get namespaces -o jsonpath='{.items[*].metadata.name}') + echo "NAMESPACES: $NAMESPACES" + # Iterate over each namespace + for NAMESPACE in $NAMESPACES; do + echo "Checking namespace: $NAMESPACE" + # Get the list of custom resources in the current namespace that match the pattern + RESOURCES=$(kubectl get $CUSTOM_RESOURCE -n $NAMESPACE -o jsonpath='{.items[*].metadata.name}' | tr ' ' '\n') + echo "RESOURCES: $RESOURCES" + if [[ -z $RESOURCES ]]; then + echo "No matching resources found in namespace: $NAMESPACE" + continue + fi + # Iterate over each matching resource + for RESOURCE in $RESOURCES; do + echo "Found matching resource: $RESOURCE in namespace: $NAMESPACE" + # Get the list of pods in the current namespace created by the custom resource + echo "Checking pods created by the custom resource: $RESOURCE" + PODS=$(kubectl get pods -n $NAMESPACE --selector=app.kubernetes.io/created-by=$RESOURCE,app.kubernetes.io/name=oneagent -o jsonpath='{.items[*].metadata.name}') + echo "Oneagent pods: $PODS" + ALL_PODS_VALID=true # Assume all pods are valid initially + # Iterate over each pod + for POD in $PODS; do + echo "Checking logs for oneagent pod: $POD in CustomResource: $RESOURCE" + # Get the logs of the current pod + LOGS=$(kubectl logs -n $NAMESPACE $POD) + # Check the logs for the pattern + if ! echo "$LOGS" | grep -q "$PATTERN"; then + echo "Pattern not found in pod: $POD" + ALL_PODS_VALID=false # Mark as invalid if the pattern is not found + break + fi + done + # If any pod in the DaemonSet does not have the pattern, set exit status to failure + if ! $ALL_PODS_VALID; then + EXIT_STATUS=1 + fi + done + done + if [[ $EXIT_STATUS -eq 0 ]]; then + echo "Search successful: Pattern found in all pods of all matching DaemonSets." + else + echo "Search complete: Pattern not found in all pods of one or more DaemonSets." + fi + exit $EXIT_STATUS + restartPolicy: Never + serviceAccountName: test-dynatrace + successfulJobsHistoryLimit: 3 + failedJobsHistoryLimit: 1 + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: dynatrace-test-role +rules: +# Permissions for listing namespaces +- apiGroups: [""] + resources: ["namespaces"] + verbs: ["get", "list", "watch"] +# Permissions for listing pods and getting pod logs +- apiGroups: [""] + resources: ["pods"] + verbs: ["get", "list", "watch"] +# Permissions for getting pod logs +- apiGroups: [""] + resources: ["pods/log"] + verbs: ["get"] +# Permissions for listing the custom resource dynakube from the dynatrace.com apigroup +- apiGroups: ["dynatrace.com"] + resources: ["dynakubes"] + verbs: ["get", "list", "watch"] + +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: test-dynatrace + namespace: dynatrace + +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: custom-list-pods-logs-dynakube-binding +subjects: +- kind: ServiceAccount + name: test-dynatrace + namespace: dynatrace +roleRef: + kind: ClusterRole + name: dynatrace-test-role + apiGroup: rbac.authorization.k8s.io From 36532ef4b24d228c0040a2c18f3f98d31551b5fc Mon Sep 17 00:00:00 2001 From: Michael Villiger Date: Wed, 13 Nov 2024 15:54:56 -0600 Subject: [PATCH 02/19] putting real values back in for now --- .../Addons/Partner/dynatrace/dynatrace-variables.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-variables.yaml b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-variables.yaml index 3171daf7..98eabd8d 100644 --- a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-variables.yaml +++ b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-variables.yaml @@ -6,8 +6,8 @@ metadata: namespace: flux-system data: # api url for dynatrace environment - apiurl: "" + apiurl: "https://fjy55252.sprint.apps.dynatracelabs.com/api" # name of secret containing tokens dynatracesecretname: "dt-secret" # name of cluster to be listed in Dynatrace - dynakubename: "" + dynakubename: "eks-flux-test-cluster" From fba7298ce3448ca3407098d273113e4edf392ca2 Mon Sep 17 00:00:00 2001 From: Michael Villiger Date: Wed, 13 Nov 2024 16:06:03 -0600 Subject: [PATCH 03/19] wrong URI --- .../Addons/Partner/dynatrace/dynatrace-variables.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-variables.yaml b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-variables.yaml index 98eabd8d..73521f2b 100644 --- a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-variables.yaml +++ b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-variables.yaml @@ -6,7 +6,7 @@ metadata: namespace: flux-system data: # api url for dynatrace environment - apiurl: "https://fjy55252.sprint.apps.dynatracelabs.com/api" + apiUrl: https://fjy55252.sprint.dynatracelabs.com/api # name of secret containing tokens dynatracesecretname: "dt-secret" # name of cluster to be listed in Dynatrace From 6f933fb261f0731f23ae36adfe0ff4ee297fcfc3 Mon Sep 17 00:00:00 2001 From: Michael Villiger Date: Wed, 13 Nov 2024 18:27:18 -0600 Subject: [PATCH 04/19] moving apiurl to external secret --- .../Partner/dynatrace/dynakube-operator.yaml | 4 +++- .../dynatrace-operator/external-secret.yaml | 19 ++++++++++++++++++- .../dynatrace/dynatrace-variables.yaml | 4 +--- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/eks-anywhere-common/Addons/Partner/dynatrace/dynakube-operator.yaml b/eks-anywhere-common/Addons/Partner/dynatrace/dynakube-operator.yaml index 54da1f4c..fe0125e3 100644 --- a/eks-anywhere-common/Addons/Partner/dynatrace/dynakube-operator.yaml +++ b/eks-anywhere-common/Addons/Partner/dynatrace/dynakube-operator.yaml @@ -31,4 +31,6 @@ spec: postBuild: substituteFrom: - kind: ConfigMap - name: dynatrace-variables # Provides apiurl, dynatracesecretname, dynakubename, oneagentvolumestorage \ No newline at end of file + name: dynatrace-variables # Provides dynatracesecretname, dynakubename, oneagentvolumestorage + - kind: Secret + name: dynatrace-apiurl # provides apiurl \ No newline at end of file diff --git a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/external-secret.yaml b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/external-secret.yaml index 6ebcb369..8f2a7996 100644 --- a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/external-secret.yaml +++ b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/external-secret.yaml @@ -15,4 +15,21 @@ spec: - extract: # we expect an external secret in the following format # {"apiToken":"sometoken","dataIngestToken":"anothertoken"} - key: dt-tokens-secret \ No newline at end of file + key: dt-tokens-secret +--- +apiVersion: external-secrets.io/v1beta1 +kind: ExternalSecret +metadata: + name: dynatrace-apiurl-external-secret + namespace: dynatrace +spec: + refreshInterval: 1m + secretStoreRef: + name: eksa-secret-store #The secret store name we have just created. + kind: ClusterSecretStore + target: + name: dynatrace-apiurl # Secret name in k8s + data: + - secretKey: apiurl + remoteRef: + key: dynatrace-apiurl diff --git a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-variables.yaml b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-variables.yaml index 73521f2b..e106ddbc 100644 --- a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-variables.yaml +++ b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-variables.yaml @@ -5,9 +5,7 @@ metadata: name: dynatrace-variables namespace: flux-system data: - # api url for dynatrace environment - apiUrl: https://fjy55252.sprint.dynatracelabs.com/api - # name of secret containing tokens + # name of secret containing tokens created by external-secret dynatracesecretname: "dt-secret" # name of cluster to be listed in Dynatrace dynakubename: "eks-flux-test-cluster" From a5ec51887603c2d4b516b314558a7b901e5cb2ec Mon Sep 17 00:00:00 2001 From: Michael Villiger Date: Thu, 14 Nov 2024 14:43:14 -0600 Subject: [PATCH 05/19] moving apiurl to flux-system ns --- .../Partner/dynatrace/dynatrace-operator/external-secret.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/external-secret.yaml b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/external-secret.yaml index 8f2a7996..b473377c 100644 --- a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/external-secret.yaml +++ b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/external-secret.yaml @@ -21,7 +21,7 @@ apiVersion: external-secrets.io/v1beta1 kind: ExternalSecret metadata: name: dynatrace-apiurl-external-secret - namespace: dynatrace + namespace: flux-system spec: refreshInterval: 1m secretStoreRef: From c595f46fb9b595e60dd62510cdbaf265df8b93b8 Mon Sep 17 00:00:00 2001 From: Mike Villiger Date: Thu, 14 Nov 2024 15:45:01 -0600 Subject: [PATCH 06/19] removing external secrets --- .../dynatrace-operator/external-secret.yaml | 35 ------------------- 1 file changed, 35 deletions(-) delete mode 100644 eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/external-secret.yaml diff --git a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/external-secret.yaml b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/external-secret.yaml deleted file mode 100644 index b473377c..00000000 --- a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/external-secret.yaml +++ /dev/null @@ -1,35 +0,0 @@ ---- -apiVersion: external-secrets.io/v1beta1 -kind: ExternalSecret -metadata: - name: dynatrace-external-secret - namespace: dynatrace -spec: - refreshInterval: 1m - secretStoreRef: - name: eksa-secret-store #The secret store name we have just created. - kind: ClusterSecretStore - target: - name: dt-secret # Secret name in k8s - dataFrom: - - extract: - # we expect an external secret in the following format - # {"apiToken":"sometoken","dataIngestToken":"anothertoken"} - key: dt-tokens-secret ---- -apiVersion: external-secrets.io/v1beta1 -kind: ExternalSecret -metadata: - name: dynatrace-apiurl-external-secret - namespace: flux-system -spec: - refreshInterval: 1m - secretStoreRef: - name: eksa-secret-store #The secret store name we have just created. - kind: ClusterSecretStore - target: - name: dynatrace-apiurl # Secret name in k8s - data: - - secretKey: apiurl - remoteRef: - key: dynatrace-apiurl From db24d6576aa7a87bfe54cd68d8c124c5ca3fbea5 Mon Sep 17 00:00:00 2001 From: Michael Villiger Date: Thu, 14 Nov 2024 16:02:57 -0600 Subject: [PATCH 07/19] updating annotations and namespace selector for dynakube --- .../Partner/dynatrace/dynatrace-dynakube/dynakube-cr.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-dynakube/dynakube-cr.yaml b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-dynakube/dynakube-cr.yaml index c651e771..109c60d4 100644 --- a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-dynakube/dynakube-cr.yaml +++ b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-dynakube/dynakube-cr.yaml @@ -6,9 +6,15 @@ metadata: namespace: dynatrace annotations: feature.dynatrace.com/k8s-app-enabled: "true" + feature.dynatrace.com/no-proxy: "dynakube-activegate.dynatrace.svc.cluster.local,.svc.cluster.local,.dynatrace.svc" + feature.dynatrace.com/oneagent-ignore-proxy: "true" + spec: apiUrl: "${apiurl}" tokens: ${dynatracesecretname} + namespaceSelector: + matchLabels: + dynatrace.com/inject: "true" oneAgent: cloudNativeFullStack: tolerations: From 80ad5e8b01e58bfb0239526c5dca2fb2afa1fd19 Mon Sep 17 00:00:00 2001 From: Michael Villiger Date: Thu, 14 Nov 2024 16:23:18 -0600 Subject: [PATCH 08/19] changing apiVersion --- .../Partner/dynatrace/dynatrace-dynakube/dynakube-cr.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-dynakube/dynakube-cr.yaml b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-dynakube/dynakube-cr.yaml index 109c60d4..8124cb46 100644 --- a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-dynakube/dynakube-cr.yaml +++ b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-dynakube/dynakube-cr.yaml @@ -1,5 +1,5 @@ --- -apiVersion: dynatrace.com/v1beta2 +apiVersion: dynatrace.com/v1beta1 kind: DynaKube metadata: name: "${dynakubename}" From 070d2c42b427c5c9ec418b01c6010aee7d6985b8 Mon Sep 17 00:00:00 2001 From: Mike Villiger Date: Thu, 14 Nov 2024 16:40:47 -0600 Subject: [PATCH 09/19] update operator to 1.3.2 --- .../Partner/dynatrace/dynatrace-operator/dynatrace-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-release.yaml b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-release.yaml index 79865d79..1d907641 100644 --- a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-release.yaml +++ b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-release.yaml @@ -12,7 +12,7 @@ spec: kind: HelmRepository name: dynatrace-operator namespace: flux-system - version: 1.3.0 + version: 1.3.2 interval: 1m0s values: installCRD: true From 95c0a1fa79f06b4eb6f1bcbe1cf288754ecf29e2 Mon Sep 17 00:00:00 2001 From: Michael Villiger Date: Thu, 14 Nov 2024 17:41:51 -0600 Subject: [PATCH 10/19] updating helmrelease to use oci url instead of helm repo --- .../dynatrace-operator/dynatrace-release.yaml | 13 +++++++------ .../dynatrace-operator/dynatrace-source.yaml | 9 --------- 2 files changed, 7 insertions(+), 15 deletions(-) delete mode 100644 eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-source.yaml diff --git a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-release.yaml b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-release.yaml index 1d907641..91712ee5 100644 --- a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-release.yaml +++ b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-release.yaml @@ -1,5 +1,5 @@ --- -apiVersion: helm.toolkit.fluxcd.io/v2 +apiVersion: helm.toolkit.fluxcd.io/v2beta1 kind: HelmRelease metadata: name: dynatrace-operator @@ -9,15 +9,16 @@ spec: spec: chart: dynatrace-operator sourceRef: - kind: HelmRepository + kind: OCIRepository name: dynatrace-operator namespace: flux-system + url: oci://public.ecr.aws/dynatrace/dynatrace-operator version: 1.3.2 - interval: 1m0s - values: - installCRD: true install: crds: CreateReplace + interval: 1m0s + targetNamespace: dynatrace upgrade: crds: CreateReplace - targetNamespace: dynatrace \ No newline at end of file + values: + installCRD: true diff --git a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-source.yaml b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-source.yaml deleted file mode 100644 index f570fc6d..00000000 --- a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-source.yaml +++ /dev/null @@ -1,9 +0,0 @@ ---- -apiVersion: source.toolkit.fluxcd.io/v1beta2 -kind: HelmRepository -metadata: - name: dynatrace-operator - namespace: flux-system -spec: - interval: 1m0s - url: https://raw.githubusercontent.com/Dynatrace/dynatrace-operator/master/config/helm/repos/stable \ No newline at end of file From ab52191de30ca6e21fb6351fd8642035f1601e08 Mon Sep 17 00:00:00 2001 From: Michael Villiger Date: Thu, 14 Nov 2024 17:45:56 -0600 Subject: [PATCH 11/19] ocirepository needs to be configured in its own file --- .../dynatrace/dynatrace-operator/dynatrace-release.yaml | 1 - .../dynatrace-operator/dynatrace-repository.yaml | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-repository.yaml diff --git a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-release.yaml b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-release.yaml index 91712ee5..bc0c3a78 100644 --- a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-release.yaml +++ b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-release.yaml @@ -12,7 +12,6 @@ spec: kind: OCIRepository name: dynatrace-operator namespace: flux-system - url: oci://public.ecr.aws/dynatrace/dynatrace-operator version: 1.3.2 install: crds: CreateReplace diff --git a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-repository.yaml b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-repository.yaml new file mode 100644 index 00000000..278cd18e --- /dev/null +++ b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-repository.yaml @@ -0,0 +1,8 @@ +apiVersion: source.toolkit.fluxcd.io/v1beta2 +kind: OCIRepository +metadata: + name: dynatrace-operator + namespace: flux-system +spec: + interval: 1m0s + url: oci://public.ecr.aws/dynatrace/dynatrace-operator From 51f7ade0a28155dd9e696ceeda7683d08cfc3910 Mon Sep 17 00:00:00 2001 From: Michael Villiger Date: Thu, 14 Nov 2024 17:51:16 -0600 Subject: [PATCH 12/19] updating to include spec.type --- .../dynatrace/dynatrace-operator/dynatrace-repository.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-repository.yaml b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-repository.yaml index 278cd18e..21054cec 100644 --- a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-repository.yaml +++ b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-repository.yaml @@ -1,8 +1,9 @@ apiVersion: source.toolkit.fluxcd.io/v1beta2 -kind: OCIRepository +kind: HelmRepository metadata: - name: dynatrace-operator + name: dynatrace-operator-oci namespace: flux-system spec: interval: 1m0s + type: "oci" url: oci://public.ecr.aws/dynatrace/dynatrace-operator From 825fa2498183da7dd2d52734011cf100eb7d0e94 Mon Sep 17 00:00:00 2001 From: Michael Villiger Date: Thu, 14 Nov 2024 17:52:34 -0600 Subject: [PATCH 13/19] have to change spec.chart.spec.sourceref.kind as well --- .../Partner/dynatrace/dynatrace-operator/dynatrace-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-release.yaml b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-release.yaml index bc0c3a78..83543456 100644 --- a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-release.yaml +++ b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-release.yaml @@ -9,7 +9,7 @@ spec: spec: chart: dynatrace-operator sourceRef: - kind: OCIRepository + kind: HelmRepository name: dynatrace-operator namespace: flux-system version: 1.3.2 From a30c421fe0586c0547ccd68e42befe0d1bbf9a9d Mon Sep 17 00:00:00 2001 From: Michael Villiger Date: Thu, 14 Nov 2024 18:01:03 -0600 Subject: [PATCH 14/19] ensuring spec.chart.spec.sourceref.name references the right repo --- .../Partner/dynatrace/dynatrace-operator/dynatrace-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-release.yaml b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-release.yaml index 83543456..548f5a86 100644 --- a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-release.yaml +++ b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-release.yaml @@ -10,7 +10,7 @@ spec: chart: dynatrace-operator sourceRef: kind: HelmRepository - name: dynatrace-operator + name: dynatrace-operator-oci namespace: flux-system version: 1.3.2 install: From 598d10637a6713b8766895b18f90ada1e8cccae9 Mon Sep 17 00:00:00 2001 From: Michael Villiger Date: Thu, 14 Nov 2024 18:04:58 -0600 Subject: [PATCH 15/19] trying a different value for the oci url --- .../dynatrace/dynatrace-operator/dynatrace-repository.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-repository.yaml b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-repository.yaml index 21054cec..449cc096 100644 --- a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-repository.yaml +++ b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-repository.yaml @@ -6,4 +6,4 @@ metadata: spec: interval: 1m0s type: "oci" - url: oci://public.ecr.aws/dynatrace/dynatrace-operator + url: oci://public.ecr.aws/dynatrace From f3498c037b85802efbec3555aaa631ac04d18015 Mon Sep 17 00:00:00 2001 From: Michael Villiger Date: Thu, 14 Nov 2024 18:42:42 -0600 Subject: [PATCH 16/19] lets see what happens with no version --- .../Partner/dynatrace/dynatrace-operator/dynatrace-release.yaml | 2 +- .../dynatrace/dynatrace-operator/dynatrace-repository.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-release.yaml b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-release.yaml index 548f5a86..5e47501e 100644 --- a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-release.yaml +++ b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-release.yaml @@ -12,7 +12,7 @@ spec: kind: HelmRepository name: dynatrace-operator-oci namespace: flux-system - version: 1.3.2 + # version: "1.3.2" install: crds: CreateReplace interval: 1m0s diff --git a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-repository.yaml b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-repository.yaml index 449cc096..21054cec 100644 --- a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-repository.yaml +++ b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-repository.yaml @@ -6,4 +6,4 @@ metadata: spec: interval: 1m0s type: "oci" - url: oci://public.ecr.aws/dynatrace + url: oci://public.ecr.aws/dynatrace/dynatrace-operator From e7a48fafb49afed157392b36e095115744735268 Mon Sep 17 00:00:00 2001 From: Michael Villiger Date: Thu, 14 Nov 2024 18:50:03 -0600 Subject: [PATCH 17/19] removing dynatrace-operator from end of oci url --- .../dynatrace/dynatrace-operator/dynatrace-repository.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-repository.yaml b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-repository.yaml index 21054cec..449cc096 100644 --- a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-repository.yaml +++ b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/dynatrace-repository.yaml @@ -6,4 +6,4 @@ metadata: spec: interval: 1m0s type: "oci" - url: oci://public.ecr.aws/dynatrace/dynatrace-operator + url: oci://public.ecr.aws/dynatrace From ec29853b4af865c2af93bd075c7294d6cb474e4b Mon Sep 17 00:00:00 2001 From: Michael Villiger Date: Thu, 14 Nov 2024 19:12:13 -0600 Subject: [PATCH 18/19] adding external secrets back --- .../dynatrace-operator/external-secrets.yaml | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/external-secrets.yaml diff --git a/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/external-secrets.yaml b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/external-secrets.yaml new file mode 100644 index 00000000..461523a5 --- /dev/null +++ b/eks-anywhere-common/Addons/Partner/dynatrace/dynatrace-operator/external-secrets.yaml @@ -0,0 +1,35 @@ +--- +apiVersion: external-secrets.io/v1beta1 +kind: ExternalSecret +metadata: + name: dynatrace-external-secret + namespace: dynatrace +spec: + refreshInterval: 1m + secretStoreRef: + name: eksa-secret-store #The secret store name we have just created. + kind: ClusterSecretStore + target: + name: dt-secret # Secret name in k8s + dataFrom: + - extract: + # we expect an external secret in the following format + # {"apiToken":"sometoken","dataIngestToken":"anothertoken"} + key: dt-tokens-secret +--- +apiVersion: external-secrets.io/v1beta1 +kind: ExternalSecret +metadata: + name: dynatrace-apiurl-external-secret + namespace: flux-system +spec: + refreshInterval: 1m + secretStoreRef: + name: eksa-secret-store #The secret store name we have just created. + kind: ClusterSecretStore + target: + name: dynatrace-apiurl # Secret name in k8s + data: + - secretKey: apiurl + remoteRef: + key: dynatrace-apiurl \ No newline at end of file From 774b77ed7a01993208887c620133f1675e30c33f Mon Sep 17 00:00:00 2001 From: Michael Villiger Date: Thu, 21 Nov 2024 11:02:24 -0600 Subject: [PATCH 19/19] adjusting cronjab for much lower frequency --- eks-anywhere-common/Testers/dynatrace/testJob.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eks-anywhere-common/Testers/dynatrace/testJob.yaml b/eks-anywhere-common/Testers/dynatrace/testJob.yaml index d90a84dc..a037eaed 100644 --- a/eks-anywhere-common/Testers/dynatrace/testJob.yaml +++ b/eks-anywhere-common/Testers/dynatrace/testJob.yaml @@ -4,7 +4,7 @@ metadata: name: dynatrace-tester-cron namespace: dynatrace spec: - schedule: "*/10 * * * *" + schedule: "10 10 * * *" jobTemplate: spec: template: