From c3f7b74123a127b5a1f7e46f2b11408df6e3cb29 Mon Sep 17 00:00:00 2001 From: Jacob Aronoff Date: Tue, 13 Aug 2024 15:57:39 -0400 Subject: [PATCH 01/25] add uninstall hook --- charts/opentelemetry-kube-stack/Chart.yaml | 2 +- .../examples/cloud-demo/rendered/bridge.yaml | 2 +- .../cloud-demo/rendered/collector.yaml | 4 +- .../examples/cloud-demo/rendered/hooks.yaml | 59 +++++++++++++++++++ .../cloud-demo/rendered/instrumentation.yaml | 2 +- .../prometheus-otel/rendered/collector.yaml | 2 +- .../kube-api-server/servicemonitor.yaml | 2 +- .../kube-controller-manager/service.yaml | 2 +- .../servicemonitor.yaml | 2 +- .../rendered/exporters/kube-dns/service.yaml | 2 +- .../exporters/kube-dns/servicemonitor.yaml | 2 +- .../rendered/exporters/kube-etcd/service.yaml | 2 +- .../exporters/kube-etcd/servicemonitor.yaml | 2 +- .../exporters/kube-proxy/service.yaml | 2 +- .../exporters/kube-proxy/servicemonitor.yaml | 2 +- .../exporters/kube-scheduler/service.yaml | 2 +- .../kube-scheduler/servicemonitor.yaml | 2 +- .../prometheus-otel/rendered/hooks.yaml | 59 +++++++++++++++++++ .../templates/hooks.yaml | 56 ++++++++++++++++++ .../values.schema.json | 8 +++ charts/opentelemetry-kube-stack/values.yaml | 4 ++ 21 files changed, 203 insertions(+), 17 deletions(-) create mode 100644 charts/opentelemetry-kube-stack/examples/cloud-demo/rendered/hooks.yaml create mode 100644 charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/hooks.yaml create mode 100644 charts/opentelemetry-kube-stack/templates/hooks.yaml diff --git a/charts/opentelemetry-kube-stack/Chart.yaml b/charts/opentelemetry-kube-stack/Chart.yaml index 0cda6d890..133d87dca 100644 --- a/charts/opentelemetry-kube-stack/Chart.yaml +++ b/charts/opentelemetry-kube-stack/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: opentelemetry-kube-stack -version: 0.1.2 +version: 0.1.3 description: | OpenTelemetry Quickstart chart for Kubernetes. Installs an operator and collector for an easy way to get started with Kubernetes observability. diff --git a/charts/opentelemetry-kube-stack/examples/cloud-demo/rendered/bridge.yaml b/charts/opentelemetry-kube-stack/examples/cloud-demo/rendered/bridge.yaml index 8564092af..0857ce3ff 100644 --- a/charts/opentelemetry-kube-stack/examples/cloud-demo/rendered/bridge.yaml +++ b/charts/opentelemetry-kube-stack/examples/cloud-demo/rendered/bridge.yaml @@ -5,7 +5,7 @@ kind: OpAMPBridge metadata: name: example labels: - helm.sh/chart: opentelemetry-kube-stack-0.1.2 + helm.sh/chart: opentelemetry-kube-stack-0.1.3 app.kubernetes.io/version: "0.105.0" app.kubernetes.io/managed-by: Helm spec: diff --git a/charts/opentelemetry-kube-stack/examples/cloud-demo/rendered/collector.yaml b/charts/opentelemetry-kube-stack/examples/cloud-demo/rendered/collector.yaml index 9ba3e4ddc..10137921d 100644 --- a/charts/opentelemetry-kube-stack/examples/cloud-demo/rendered/collector.yaml +++ b/charts/opentelemetry-kube-stack/examples/cloud-demo/rendered/collector.yaml @@ -6,7 +6,7 @@ metadata: name: example-cluster-stats namespace: default labels: - helm.sh/chart: opentelemetry-kube-stack-0.1.2 + helm.sh/chart: opentelemetry-kube-stack-0.1.3 app.kubernetes.io/version: "0.105.0" app.kubernetes.io/managed-by: Helm opentelemetry.io/opamp-reporting: "true" @@ -189,7 +189,7 @@ metadata: name: example-daemon namespace: default labels: - helm.sh/chart: opentelemetry-kube-stack-0.1.2 + helm.sh/chart: opentelemetry-kube-stack-0.1.3 app.kubernetes.io/version: "0.105.0" app.kubernetes.io/managed-by: Helm opentelemetry.io/opamp-reporting: "true" diff --git a/charts/opentelemetry-kube-stack/examples/cloud-demo/rendered/hooks.yaml b/charts/opentelemetry-kube-stack/examples/cloud-demo/rendered/hooks.yaml new file mode 100644 index 000000000..954f1aaf3 --- /dev/null +++ b/charts/opentelemetry-kube-stack/examples/cloud-demo/rendered/hooks.yaml @@ -0,0 +1,59 @@ +--- +# Source: opentelemetry-kube-stack/templates/hooks.yaml +apiVersion: v1 +kind: ServiceAccount +metadata: + name: delete-resources-sa +--- +# Source: opentelemetry-kube-stack/templates/hooks.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: delete-resources-role +rules: + - apiGroups: + - opentelemetry.io + resources: + - instrumentations + - opampbridges + - opentelemetrycollectors + verbs: + - get + - list + - delete +--- +# Source: opentelemetry-kube-stack/templates/hooks.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: delete-resources-rolebinding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: delete-resources-role +subjects: + - kind: ServiceAccount + name: delete-resources-sa +--- +# Source: opentelemetry-kube-stack/templates/hooks.yaml +apiVersion: batch/v1 +kind: Job +metadata: + name: opentelemetry-kube-stack-pre-delete-job + annotations: + "helm.sh/hook": pre-delete + "helm.sh/hook-delete-policy": hook-succeeded,hook-failed +spec: + template: + spec: + restartPolicy: Never + serviceAccountName: delete-resources-sa + containers: + - name: delete-resources + image: bitnami/kubectl:latest + command: + - /bin/sh + - -c + - | + kubectl delete instrumentations,opampbridges,opentelemetrycollectors \ + -l helm.sh/chart=opentelemetry-kube-stack-0.1.3 diff --git a/charts/opentelemetry-kube-stack/examples/cloud-demo/rendered/instrumentation.yaml b/charts/opentelemetry-kube-stack/examples/cloud-demo/rendered/instrumentation.yaml index 0277b17ca..646a2696f 100644 --- a/charts/opentelemetry-kube-stack/examples/cloud-demo/rendered/instrumentation.yaml +++ b/charts/opentelemetry-kube-stack/examples/cloud-demo/rendered/instrumentation.yaml @@ -5,7 +5,7 @@ kind: Instrumentation metadata: name: example labels: - helm.sh/chart: opentelemetry-kube-stack-0.1.2 + helm.sh/chart: opentelemetry-kube-stack-0.1.3 app.kubernetes.io/version: "0.105.0" app.kubernetes.io/managed-by: Helm spec: diff --git a/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/collector.yaml b/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/collector.yaml index 523fcbb29..642c2b822 100644 --- a/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/collector.yaml +++ b/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/collector.yaml @@ -6,7 +6,7 @@ metadata: name: example-daemon namespace: default labels: - helm.sh/chart: opentelemetry-kube-stack-0.1.2 + helm.sh/chart: opentelemetry-kube-stack-0.1.3 app.kubernetes.io/version: "0.105.0" app.kubernetes.io/managed-by: Helm spec: diff --git a/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-api-server/servicemonitor.yaml b/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-api-server/servicemonitor.yaml index 930645aa6..72f491005 100644 --- a/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-api-server/servicemonitor.yaml +++ b/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-api-server/servicemonitor.yaml @@ -7,7 +7,7 @@ metadata: namespace: default labels: app: opentelemetry-kube-stack-apiserver - helm.sh/chart: opentelemetry-kube-stack-0.1.2 + helm.sh/chart: opentelemetry-kube-stack-0.1.3 app.kubernetes.io/version: "0.105.0" app.kubernetes.io/managed-by: Helm spec: diff --git a/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-controller-manager/service.yaml b/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-controller-manager/service.yaml index 7c2671129..5b2a51ed3 100644 --- a/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-controller-manager/service.yaml +++ b/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-controller-manager/service.yaml @@ -7,7 +7,7 @@ metadata: labels: app: opentelemetry-kube-stack-kube-controller-manager jobLabel: kube-controller-manager - helm.sh/chart: opentelemetry-kube-stack-0.1.2 + helm.sh/chart: opentelemetry-kube-stack-0.1.3 app.kubernetes.io/version: "0.105.0" app.kubernetes.io/managed-by: Helm namespace: kube-system diff --git a/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-controller-manager/servicemonitor.yaml b/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-controller-manager/servicemonitor.yaml index 43ed0ada6..621930ab3 100644 --- a/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-controller-manager/servicemonitor.yaml +++ b/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-controller-manager/servicemonitor.yaml @@ -7,7 +7,7 @@ metadata: namespace: default labels: app: opentelemetry-kube-stack-kube-controller-manager - helm.sh/chart: opentelemetry-kube-stack-0.1.2 + helm.sh/chart: opentelemetry-kube-stack-0.1.3 app.kubernetes.io/version: "0.105.0" app.kubernetes.io/managed-by: Helm spec: diff --git a/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-dns/service.yaml b/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-dns/service.yaml index 6ff350874..eefda8d5f 100644 --- a/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-dns/service.yaml +++ b/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-dns/service.yaml @@ -7,7 +7,7 @@ metadata: labels: app: opentelemetry-kube-stack-kube-dns jobLabel: kube-dns - helm.sh/chart: opentelemetry-kube-stack-0.1.2 + helm.sh/chart: opentelemetry-kube-stack-0.1.3 app.kubernetes.io/version: "0.105.0" app.kubernetes.io/managed-by: Helm namespace: kube-system diff --git a/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-dns/servicemonitor.yaml b/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-dns/servicemonitor.yaml index ad5ab3943..a76a39484 100644 --- a/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-dns/servicemonitor.yaml +++ b/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-dns/servicemonitor.yaml @@ -7,7 +7,7 @@ metadata: namespace: default labels: app: opentelemetry-kube-stack-kube-dns - helm.sh/chart: opentelemetry-kube-stack-0.1.2 + helm.sh/chart: opentelemetry-kube-stack-0.1.3 app.kubernetes.io/version: "0.105.0" app.kubernetes.io/managed-by: Helm spec: diff --git a/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-etcd/service.yaml b/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-etcd/service.yaml index 3ab63740b..0fd227631 100644 --- a/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-etcd/service.yaml +++ b/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-etcd/service.yaml @@ -7,7 +7,7 @@ metadata: labels: app: opentelemetry-kube-stack-kube-etcd jobLabel: kube-etcd - helm.sh/chart: opentelemetry-kube-stack-0.1.2 + helm.sh/chart: opentelemetry-kube-stack-0.1.3 app.kubernetes.io/version: "0.105.0" app.kubernetes.io/managed-by: Helm namespace: kube-system diff --git a/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-etcd/servicemonitor.yaml b/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-etcd/servicemonitor.yaml index 73348c36f..d487a5e24 100644 --- a/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-etcd/servicemonitor.yaml +++ b/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-etcd/servicemonitor.yaml @@ -7,7 +7,7 @@ metadata: namespace: default labels: app: opentelemetry-kube-stack-kube-etcd - helm.sh/chart: opentelemetry-kube-stack-0.1.2 + helm.sh/chart: opentelemetry-kube-stack-0.1.3 app.kubernetes.io/version: "0.105.0" app.kubernetes.io/managed-by: Helm spec: diff --git a/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-proxy/service.yaml b/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-proxy/service.yaml index ea1a9ff26..1a4c73dea 100644 --- a/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-proxy/service.yaml +++ b/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-proxy/service.yaml @@ -7,7 +7,7 @@ metadata: labels: app: opentelemetry-kube-stack-kube-proxy jobLabel: kube-proxy - helm.sh/chart: opentelemetry-kube-stack-0.1.2 + helm.sh/chart: opentelemetry-kube-stack-0.1.3 app.kubernetes.io/version: "0.105.0" app.kubernetes.io/managed-by: Helm namespace: kube-system diff --git a/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-proxy/servicemonitor.yaml b/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-proxy/servicemonitor.yaml index c3eb42400..0a7c28915 100644 --- a/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-proxy/servicemonitor.yaml +++ b/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-proxy/servicemonitor.yaml @@ -7,7 +7,7 @@ metadata: namespace: default labels: app: opentelemetry-kube-stack-kube-proxy - helm.sh/chart: opentelemetry-kube-stack-0.1.2 + helm.sh/chart: opentelemetry-kube-stack-0.1.3 app.kubernetes.io/version: "0.105.0" app.kubernetes.io/managed-by: Helm spec: diff --git a/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-scheduler/service.yaml b/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-scheduler/service.yaml index 4b830ebc8..f3659311b 100644 --- a/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-scheduler/service.yaml +++ b/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-scheduler/service.yaml @@ -7,7 +7,7 @@ metadata: labels: app: opentelemetry-kube-stack-kube-scheduler jobLabel: kube-scheduler - helm.sh/chart: opentelemetry-kube-stack-0.1.2 + helm.sh/chart: opentelemetry-kube-stack-0.1.3 app.kubernetes.io/version: "0.105.0" app.kubernetes.io/managed-by: Helm namespace: kube-system diff --git a/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-scheduler/servicemonitor.yaml b/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-scheduler/servicemonitor.yaml index 4a5f05f6d..4c7eb6a98 100644 --- a/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-scheduler/servicemonitor.yaml +++ b/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/exporters/kube-scheduler/servicemonitor.yaml @@ -7,7 +7,7 @@ metadata: namespace: default labels: app: opentelemetry-kube-stack-kube-scheduler - helm.sh/chart: opentelemetry-kube-stack-0.1.2 + helm.sh/chart: opentelemetry-kube-stack-0.1.3 app.kubernetes.io/version: "0.105.0" app.kubernetes.io/managed-by: Helm spec: diff --git a/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/hooks.yaml b/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/hooks.yaml new file mode 100644 index 000000000..954f1aaf3 --- /dev/null +++ b/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/hooks.yaml @@ -0,0 +1,59 @@ +--- +# Source: opentelemetry-kube-stack/templates/hooks.yaml +apiVersion: v1 +kind: ServiceAccount +metadata: + name: delete-resources-sa +--- +# Source: opentelemetry-kube-stack/templates/hooks.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: delete-resources-role +rules: + - apiGroups: + - opentelemetry.io + resources: + - instrumentations + - opampbridges + - opentelemetrycollectors + verbs: + - get + - list + - delete +--- +# Source: opentelemetry-kube-stack/templates/hooks.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: delete-resources-rolebinding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: delete-resources-role +subjects: + - kind: ServiceAccount + name: delete-resources-sa +--- +# Source: opentelemetry-kube-stack/templates/hooks.yaml +apiVersion: batch/v1 +kind: Job +metadata: + name: opentelemetry-kube-stack-pre-delete-job + annotations: + "helm.sh/hook": pre-delete + "helm.sh/hook-delete-policy": hook-succeeded,hook-failed +spec: + template: + spec: + restartPolicy: Never + serviceAccountName: delete-resources-sa + containers: + - name: delete-resources + image: bitnami/kubectl:latest + command: + - /bin/sh + - -c + - | + kubectl delete instrumentations,opampbridges,opentelemetrycollectors \ + -l helm.sh/chart=opentelemetry-kube-stack-0.1.3 diff --git a/charts/opentelemetry-kube-stack/templates/hooks.yaml b/charts/opentelemetry-kube-stack/templates/hooks.yaml new file mode 100644 index 000000000..a8694b470 --- /dev/null +++ b/charts/opentelemetry-kube-stack/templates/hooks.yaml @@ -0,0 +1,56 @@ +{{- if .Values.cleanupJob.enabled }} +apiVersion: v1 +kind: ServiceAccount +metadata: + name: delete-resources-sa +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: delete-resources-role +rules: + - apiGroups: + - opentelemetry.io + resources: + - instrumentations + - opampbridges + - opentelemetrycollectors + verbs: + - get + - list + - delete +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: delete-resources-rolebinding +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: delete-resources-role +subjects: + - kind: ServiceAccount + name: delete-resources-sa +--- +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ include "opentelemetry-kube-stack.name" . }}-pre-delete-job + annotations: + "helm.sh/hook": pre-delete + "helm.sh/hook-delete-policy": hook-succeeded,hook-failed +spec: + template: + spec: + restartPolicy: Never + serviceAccountName: delete-resources-sa + containers: + - name: delete-resources + image: bitnami/kubectl:latest + command: + - /bin/sh + - -c + - | + kubectl delete instrumentations,opampbridges,opentelemetrycollectors \ + -l helm.sh/chart={{ include "opentelemetry-kube-stack.chart" . }} +{{- end }} diff --git a/charts/opentelemetry-kube-stack/values.schema.json b/charts/opentelemetry-kube-stack/values.schema.json index f79d5d855..f37ef4ad0 100644 --- a/charts/opentelemetry-kube-stack/values.schema.json +++ b/charts/opentelemetry-kube-stack/values.schema.json @@ -3827,6 +3827,14 @@ } }, "properties": { + "cleanupJob": { + "type": "object", + "properties": { + "enabled": { + "type": "boolean" + } + } + }, "crds": { "type": "object", "properties": { diff --git a/charts/opentelemetry-kube-stack/values.yaml b/charts/opentelemetry-kube-stack/values.yaml index cda2bcaf1..842ee53d5 100644 --- a/charts/opentelemetry-kube-stack/values.yaml +++ b/charts/opentelemetry-kube-stack/values.yaml @@ -9,6 +9,10 @@ clusterName: "" # Extra environment variables to add to each collector, bridge and instrumentation extraEnvs: [] +# Enables a cleanup job to make sure the CRs are uninstalled before the operator +cleanupJob: + enabled: true + # Should the CRDs be installed by this chart. crds: # Should the CRDs be installed From 0ba99ee62344cdf6ca0b3d5e4489b252ddcadad0 Mon Sep 17 00:00:00 2001 From: Jacob Aronoff Date: Tue, 13 Aug 2024 15:59:19 -0400 Subject: [PATCH 02/25] update values --- .../opentelemetry-kube-stack/examples/cloud-demo/values.yaml | 2 -- .../examples/prometheus-otel/values.yaml | 2 -- charts/opentelemetry-kube-stack/values.yaml | 3 +-- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/charts/opentelemetry-kube-stack/examples/cloud-demo/values.yaml b/charts/opentelemetry-kube-stack/examples/cloud-demo/values.yaml index 75cc5e9c2..85099bc50 100644 --- a/charts/opentelemetry-kube-stack/examples/cloud-demo/values.yaml +++ b/charts/opentelemetry-kube-stack/examples/cloud-demo/values.yaml @@ -1,6 +1,4 @@ clusterName: demo -opentelemetry-operator: - enabled: true collectors: daemon: ports: diff --git a/charts/opentelemetry-kube-stack/examples/prometheus-otel/values.yaml b/charts/opentelemetry-kube-stack/examples/prometheus-otel/values.yaml index 66c3bc1b4..57e3a544f 100644 --- a/charts/opentelemetry-kube-stack/examples/prometheus-otel/values.yaml +++ b/charts/opentelemetry-kube-stack/examples/prometheus-otel/values.yaml @@ -1,6 +1,4 @@ clusterName: demo -opentelemetry-operator: - enabled: true collectors: daemon: enabled: true diff --git a/charts/opentelemetry-kube-stack/values.yaml b/charts/opentelemetry-kube-stack/values.yaml index 842ee53d5..f537df217 100644 --- a/charts/opentelemetry-kube-stack/values.yaml +++ b/charts/opentelemetry-kube-stack/values.yaml @@ -21,8 +21,7 @@ crds: # Top level field related to the OpenTelemetry Operator opentelemetry-operator: # Field indicating whether the operator is enabled or not - # This is disabled for now while the chart is under development - enabled: false + enabled: true manager: collectorImage: repository: otel/opentelemetry-collector-k8s From 309d885817452c9a5c55f3c34440b7dbb1370520 Mon Sep 17 00:00:00 2001 From: Jacob Aronoff Date: Tue, 13 Aug 2024 16:06:52 -0400 Subject: [PATCH 03/25] set manual name --- .github/workflows/kube-stack-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/kube-stack-test.yaml b/.github/workflows/kube-stack-test.yaml index 18a588e20..cae1afca9 100644 --- a/.github/workflows/kube-stack-test.yaml +++ b/.github/workflows/kube-stack-test.yaml @@ -28,4 +28,4 @@ jobs: kubectl wait --timeout=5m --for=condition=available deployment cert-manager-webhook -n cert-manager - name: Run chart-testing (install) - run: ct install --charts charts/opentelemetry-kube-stack + run: ct install --charts charts/opentelemetry-kube-stack --namespace oks-test From 20bb6a385f523f92d1f69bb9555516fd80a85cb5 Mon Sep 17 00:00:00 2001 From: Jacob Aronoff Date: Wed, 14 Aug 2024 11:47:36 -0400 Subject: [PATCH 04/25] Update hooks --- .github/workflows/kube-stack-test.yaml | 3 ++- .../examples/cloud-demo/rendered/hooks.yaml | 6 ++++++ .../examples/prometheus-otel/rendered/hooks.yaml | 6 ++++++ charts/opentelemetry-kube-stack/templates/hooks.yaml | 7 +++++++ 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/.github/workflows/kube-stack-test.yaml b/.github/workflows/kube-stack-test.yaml index cae1afca9..eeb3921b1 100644 --- a/.github/workflows/kube-stack-test.yaml +++ b/.github/workflows/kube-stack-test.yaml @@ -26,6 +26,7 @@ jobs: kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.6.1/cert-manager.yaml kubectl wait --timeout=5m --for=condition=available deployment cert-manager -n cert-manager kubectl wait --timeout=5m --for=condition=available deployment cert-manager-webhook -n cert-manager + kubectl create ns oks-test - name: Run chart-testing (install) - run: ct install --charts charts/opentelemetry-kube-stack --namespace oks-test + run: ct install --charts charts/opentelemetry-kube-stack --namespace oks-test --build-id "" diff --git a/charts/opentelemetry-kube-stack/examples/cloud-demo/rendered/hooks.yaml b/charts/opentelemetry-kube-stack/examples/cloud-demo/rendered/hooks.yaml index 954f1aaf3..aa31a6136 100644 --- a/charts/opentelemetry-kube-stack/examples/cloud-demo/rendered/hooks.yaml +++ b/charts/opentelemetry-kube-stack/examples/cloud-demo/rendered/hooks.yaml @@ -4,12 +4,16 @@ apiVersion: v1 kind: ServiceAccount metadata: name: delete-resources-sa + annotations: + "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded --- # Source: opentelemetry-kube-stack/templates/hooks.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: delete-resources-role + annotations: + "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded rules: - apiGroups: - opentelemetry.io @@ -27,6 +31,8 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: delete-resources-rolebinding + annotations: + "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded roleRef: apiGroup: rbac.authorization.k8s.io kind: Role diff --git a/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/hooks.yaml b/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/hooks.yaml index 954f1aaf3..aa31a6136 100644 --- a/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/hooks.yaml +++ b/charts/opentelemetry-kube-stack/examples/prometheus-otel/rendered/hooks.yaml @@ -4,12 +4,16 @@ apiVersion: v1 kind: ServiceAccount metadata: name: delete-resources-sa + annotations: + "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded --- # Source: opentelemetry-kube-stack/templates/hooks.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: delete-resources-role + annotations: + "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded rules: - apiGroups: - opentelemetry.io @@ -27,6 +31,8 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: delete-resources-rolebinding + annotations: + "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded roleRef: apiGroup: rbac.authorization.k8s.io kind: Role diff --git a/charts/opentelemetry-kube-stack/templates/hooks.yaml b/charts/opentelemetry-kube-stack/templates/hooks.yaml index a8694b470..95c7898d5 100644 --- a/charts/opentelemetry-kube-stack/templates/hooks.yaml +++ b/charts/opentelemetry-kube-stack/templates/hooks.yaml @@ -1,13 +1,18 @@ {{- if .Values.cleanupJob.enabled }} +--- apiVersion: v1 kind: ServiceAccount metadata: name: delete-resources-sa + annotations: + "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded --- apiVersion: rbac.authorization.k8s.io/v1 kind: Role metadata: name: delete-resources-role + annotations: + "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded rules: - apiGroups: - opentelemetry.io @@ -24,6 +29,8 @@ apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: delete-resources-rolebinding + annotations: + "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded roleRef: apiGroup: rbac.authorization.k8s.io kind: Role From 2b1b36562d3d503579d4c44fddbc9b607ea5bf04 Mon Sep 17 00:00:00 2001 From: Jacob Aronoff Date: Wed, 14 Aug 2024 11:48:57 -0400 Subject: [PATCH 05/25] comment --- charts/opentelemetry-kube-stack/values.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/charts/opentelemetry-kube-stack/values.yaml b/charts/opentelemetry-kube-stack/values.yaml index f537df217..ab63ff236 100644 --- a/charts/opentelemetry-kube-stack/values.yaml +++ b/charts/opentelemetry-kube-stack/values.yaml @@ -11,6 +11,9 @@ extraEnvs: [] # Enables a cleanup job to make sure the CRs are uninstalled before the operator cleanupJob: + # It is recommended to always keep this enabled so that running helm uninstall works properly. + # For non-helm installations i.e. ones created via helm template, it may make sense to disable this. + # For those installations, ensure that uninstallation for the operator happens _after_ the deletion of the CRs. enabled: true # Should the CRDs be installed by this chart. From f466528c0ec03dc8c8aec739a7913e682bab6c3f Mon Sep 17 00:00:00 2001 From: Jacob Aronoff Date: Wed, 14 Aug 2024 11:58:21 -0400 Subject: [PATCH 06/25] plz --- .github/workflows/kube-stack-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/kube-stack-test.yaml b/.github/workflows/kube-stack-test.yaml index eeb3921b1..77baee823 100644 --- a/.github/workflows/kube-stack-test.yaml +++ b/.github/workflows/kube-stack-test.yaml @@ -29,4 +29,4 @@ jobs: kubectl create ns oks-test - name: Run chart-testing (install) - run: ct install --charts charts/opentelemetry-kube-stack --namespace oks-test --build-id "" + run: ct install --charts charts/opentelemetry-kube-stack --namespace oks-test --build-id "x" From a1d7fdf4a1c442c631d96d14ebda314dfbef3eed Mon Sep 17 00:00:00 2001 From: Jacob Aronoff Date: Wed, 14 Aug 2024 15:14:01 -0400 Subject: [PATCH 07/25] print the config --- .github/workflows/kube-stack-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/kube-stack-test.yaml b/.github/workflows/kube-stack-test.yaml index 77baee823..d90c25115 100644 --- a/.github/workflows/kube-stack-test.yaml +++ b/.github/workflows/kube-stack-test.yaml @@ -29,4 +29,4 @@ jobs: kubectl create ns oks-test - name: Run chart-testing (install) - run: ct install --charts charts/opentelemetry-kube-stack --namespace oks-test --build-id "x" + run: ct install --print-config --namespace oks-test --build-id "x" --charts charts/opentelemetry-kube-stack From 991253c3135a5df11233fbd05d1428893097e2bf Mon Sep 17 00:00:00 2001 From: Jacob Aronoff Date: Wed, 14 Aug 2024 15:21:24 -0400 Subject: [PATCH 08/25] use normal helm --- .github/workflows/kube-stack-test.yaml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/kube-stack-test.yaml b/.github/workflows/kube-stack-test.yaml index d90c25115..c75617c2e 100644 --- a/.github/workflows/kube-stack-test.yaml +++ b/.github/workflows/kube-stack-test.yaml @@ -26,7 +26,6 @@ jobs: kubectl apply -f https://github.com/jetstack/cert-manager/releases/download/v1.6.1/cert-manager.yaml kubectl wait --timeout=5m --for=condition=available deployment cert-manager -n cert-manager kubectl wait --timeout=5m --for=condition=available deployment cert-manager-webhook -n cert-manager - kubectl create ns oks-test - - name: Run chart-testing (install) - run: ct install --print-config --namespace oks-test --build-id "x" --charts charts/opentelemetry-kube-stack + - name: Run Helm Install + run: helm install opentelemetry-kube-stack charts/opentelemetry-kube-stack From ed43c14e2d46a2d90f549c99b7dd32423bfb2ee9 Mon Sep 17 00:00:00 2001 From: Jacob Aronoff Date: Wed, 14 Aug 2024 15:46:00 -0400 Subject: [PATCH 09/25] more --- .github/workflows/kube-stack-test.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/kube-stack-test.yaml b/.github/workflows/kube-stack-test.yaml index c75617c2e..d5e4de02a 100644 --- a/.github/workflows/kube-stack-test.yaml +++ b/.github/workflows/kube-stack-test.yaml @@ -28,4 +28,6 @@ jobs: kubectl wait --timeout=5m --for=condition=available deployment cert-manager-webhook -n cert-manager - name: Run Helm Install - run: helm install opentelemetry-kube-stack charts/opentelemetry-kube-stack + run: | + helm dep build charts/opentelemetry-kube-stack + helm install opentelemetry-kube-stack charts/opentelemetry-kube-stack From 88f0154c232c5cfc4def7da88e7e2dad4a9d2892 Mon Sep 17 00:00:00 2001 From: Jacob Aronoff Date: Mon, 19 Aug 2024 13:31:24 -0400 Subject: [PATCH 10/25] bump ci version --- .github/actions/setup/action.yaml | 18 +++--- fun-values.yaml | 93 +++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+), 9 deletions(-) create mode 100644 fun-values.yaml diff --git a/.github/actions/setup/action.yaml b/.github/actions/setup/action.yaml index fa9b4e843..9fd9d39fb 100644 --- a/.github/actions/setup/action.yaml +++ b/.github/actions/setup/action.yaml @@ -1,17 +1,17 @@ name: Setup description: sets up helm lint and testing environment inputs: - create-kind-cluster: # id of input - description: 'Whether or not to create a kind cluster during setup' + create-kind-cluster: # id of input + description: "Whether or not to create a kind cluster during setup" required: true default: "false" runs: using: "composite" steps: - name: Set up Helm - uses: azure/setup-helm@v3.5 + uses: azure/setup-helm@v4.2.0 with: - version: v3.9.0 + version: v4.2.0 - uses: actions/setup-python@v4 with: @@ -29,8 +29,8 @@ runs: - name: Add Dependencies shell: bash run: | - helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts - helm repo add prometheus https://prometheus-community.github.io/helm-charts - helm repo add grafana https://grafana.github.io/helm-charts - helm repo add jaeger https://jaegertracing.github.io/helm-charts - helm repo add opensearch https://opensearch-project.github.io/helm-charts + helm repo add open-telemetry https://open-telemetry.github.io/opentelemetry-helm-charts + helm repo add prometheus https://prometheus-community.github.io/helm-charts + helm repo add grafana https://grafana.github.io/helm-charts + helm repo add jaeger https://jaegertracing.github.io/helm-charts + helm repo add opensearch https://opensearch-project.github.io/helm-charts diff --git a/fun-values.yaml b/fun-values.yaml new file mode 100644 index 000000000..fb2010365 --- /dev/null +++ b/fun-values.yaml @@ -0,0 +1,93 @@ +clusterName: demo +opentelemetry-operator: + enabled: true +defaultCRConfig: + image: + repository: jaronoff/contrib + tag: "v05" +collectors: + daemon: + env: + - name: LS_TOKEN + valueFrom: + secretKeyRef: + key: LS_TOKEN + name: otel-collector-secret + config: + extensions: + healthcheckv2: + use_v2: true + component_health: + include_permanent_errors: false + include_recoverable_errors: true + recovery_duration: 5m + http: + endpoint: "0.0.0.0:13133" + status: + enabled: true + path: "/health/status" + config: + enabled: true + path: "/health/config" + grpc: + endpoint: "0.0.0.0:13132" + transport: "tcp" + exporters: + otlp: + endpoint: ingest.lightstep.com:443 + headers: + lightstep-access-token: ${LS_TOKEN} + service: + extensions: [healthcheckv2] + pipelines: + metrics: + exporters: [otlp] + traces: + exporters: [otlp] + logs: + exporters: [otlp] + cluster: + env: + - name: LS_TOKEN + valueFrom: + secretKeyRef: + key: LS_TOKEN + name: otel-collector-secret + config: + exporters: + otlp: + endpoint: ingest.lightstep.com:443 + headers: + lightstep-access-token: ${LS_TOKEN} + service: + pipelines: + metrics: + exporters: [otlp] +instrumentation: + enabled: true + env: + - name: OTEL_K8S_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + exporter: + endpoint: http://${OTEL_K8S_NODE_NAME}:4317 + python: + env: + - name: OTEL_EXPORTER_OTLP_ENDPOINT + value: http://${OTEL_K8S_NODE_NAME}:4318 +opAMPBridge: + enabled: true + addReportingLabel: true + image: + tag: "0.104.0" + endpoint: https://opamp.lightstep.com/v1/opamp + headers: + "Authorization": "bearer ${LS_OPAMP_API_KEY}" + env: + - name: LS_OPAMP_API_KEY + valueFrom: + secretKeyRef: + key: LS_OPAMP_API_KEY + name: otel-opamp-bridge-secret + optional: true From b1d91fc4aaf2c8e51ad523619f1805b7276d11fa Mon Sep 17 00:00:00 2001 From: Jacob Aronoff Date: Mon, 19 Aug 2024 13:31:42 -0400 Subject: [PATCH 11/25] oops --- fun-values.yaml | 93 ------------------------------------------------- 1 file changed, 93 deletions(-) delete mode 100644 fun-values.yaml diff --git a/fun-values.yaml b/fun-values.yaml deleted file mode 100644 index fb2010365..000000000 --- a/fun-values.yaml +++ /dev/null @@ -1,93 +0,0 @@ -clusterName: demo -opentelemetry-operator: - enabled: true -defaultCRConfig: - image: - repository: jaronoff/contrib - tag: "v05" -collectors: - daemon: - env: - - name: LS_TOKEN - valueFrom: - secretKeyRef: - key: LS_TOKEN - name: otel-collector-secret - config: - extensions: - healthcheckv2: - use_v2: true - component_health: - include_permanent_errors: false - include_recoverable_errors: true - recovery_duration: 5m - http: - endpoint: "0.0.0.0:13133" - status: - enabled: true - path: "/health/status" - config: - enabled: true - path: "/health/config" - grpc: - endpoint: "0.0.0.0:13132" - transport: "tcp" - exporters: - otlp: - endpoint: ingest.lightstep.com:443 - headers: - lightstep-access-token: ${LS_TOKEN} - service: - extensions: [healthcheckv2] - pipelines: - metrics: - exporters: [otlp] - traces: - exporters: [otlp] - logs: - exporters: [otlp] - cluster: - env: - - name: LS_TOKEN - valueFrom: - secretKeyRef: - key: LS_TOKEN - name: otel-collector-secret - config: - exporters: - otlp: - endpoint: ingest.lightstep.com:443 - headers: - lightstep-access-token: ${LS_TOKEN} - service: - pipelines: - metrics: - exporters: [otlp] -instrumentation: - enabled: true - env: - - name: OTEL_K8S_NODE_NAME - valueFrom: - fieldRef: - fieldPath: spec.nodeName - exporter: - endpoint: http://${OTEL_K8S_NODE_NAME}:4317 - python: - env: - - name: OTEL_EXPORTER_OTLP_ENDPOINT - value: http://${OTEL_K8S_NODE_NAME}:4318 -opAMPBridge: - enabled: true - addReportingLabel: true - image: - tag: "0.104.0" - endpoint: https://opamp.lightstep.com/v1/opamp - headers: - "Authorization": "bearer ${LS_OPAMP_API_KEY}" - env: - - name: LS_OPAMP_API_KEY - valueFrom: - secretKeyRef: - key: LS_OPAMP_API_KEY - name: otel-opamp-bridge-secret - optional: true From de786ac43e5d6512049cca19ea599fdc15d8d769 Mon Sep 17 00:00:00 2001 From: Jacob Aronoff Date: Mon, 19 Aug 2024 13:39:44 -0400 Subject: [PATCH 12/25] oop --- .github/actions/setup/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup/action.yaml b/.github/actions/setup/action.yaml index 9fd9d39fb..c139be57c 100644 --- a/.github/actions/setup/action.yaml +++ b/.github/actions/setup/action.yaml @@ -11,7 +11,7 @@ runs: - name: Set up Helm uses: azure/setup-helm@v4.2.0 with: - version: v4.2.0 + version: v3.15.4 - uses: actions/setup-python@v4 with: From 5ccfdbfa384aab851eb705082f9141b31bbd29ba Mon Sep 17 00:00:00 2001 From: Jacob Aronoff Date: Mon, 19 Aug 2024 13:48:35 -0400 Subject: [PATCH 13/25] undo --- .github/actions/setup/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup/action.yaml b/.github/actions/setup/action.yaml index c139be57c..ebbc7e810 100644 --- a/.github/actions/setup/action.yaml +++ b/.github/actions/setup/action.yaml @@ -11,7 +11,7 @@ runs: - name: Set up Helm uses: azure/setup-helm@v4.2.0 with: - version: v3.15.4 + version: v3.14.4 - uses: actions/setup-python@v4 with: From 241b487e1438748dfc0bff15f5c122cfd5e2d414 Mon Sep 17 00:00:00 2001 From: Jacob Aronoff Date: Mon, 19 Aug 2024 13:51:54 -0400 Subject: [PATCH 14/25] down another --- .github/actions/setup/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup/action.yaml b/.github/actions/setup/action.yaml index ebbc7e810..cf09ff253 100644 --- a/.github/actions/setup/action.yaml +++ b/.github/actions/setup/action.yaml @@ -11,7 +11,7 @@ runs: - name: Set up Helm uses: azure/setup-helm@v4.2.0 with: - version: v3.14.4 + version: v3.13.3 - uses: actions/setup-python@v4 with: From f1434c1710f38528ca6f9ac8792d39ec4a859566 Mon Sep 17 00:00:00 2001 From: Jacob Aronoff Date: Mon, 19 Aug 2024 13:53:46 -0400 Subject: [PATCH 15/25] down another --- .github/actions/setup/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup/action.yaml b/.github/actions/setup/action.yaml index cf09ff253..0d322828f 100644 --- a/.github/actions/setup/action.yaml +++ b/.github/actions/setup/action.yaml @@ -11,7 +11,7 @@ runs: - name: Set up Helm uses: azure/setup-helm@v4.2.0 with: - version: v3.13.3 + version: v3.12.3 - uses: actions/setup-python@v4 with: From a90e99829aae998f66c7bb71b8faf5d80bc07ca0 Mon Sep 17 00:00:00 2001 From: Jacob Aronoff Date: Mon, 19 Aug 2024 13:55:39 -0400 Subject: [PATCH 16/25] down another --- .github/actions/setup/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup/action.yaml b/.github/actions/setup/action.yaml index 0d322828f..4f7e09e09 100644 --- a/.github/actions/setup/action.yaml +++ b/.github/actions/setup/action.yaml @@ -11,7 +11,7 @@ runs: - name: Set up Helm uses: azure/setup-helm@v4.2.0 with: - version: v3.12.3 + version: v3.11.3 - uses: actions/setup-python@v4 with: From b47f76ebf4a55b5921d885d6148a20509c0ef31a Mon Sep 17 00:00:00 2001 From: Jacob Aronoff Date: Mon, 19 Aug 2024 13:57:37 -0400 Subject: [PATCH 17/25] down another --- .github/actions/setup/action.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/setup/action.yaml b/.github/actions/setup/action.yaml index 4f7e09e09..c2c81228e 100644 --- a/.github/actions/setup/action.yaml +++ b/.github/actions/setup/action.yaml @@ -11,7 +11,7 @@ runs: - name: Set up Helm uses: azure/setup-helm@v4.2.0 with: - version: v3.11.3 + version: v3.10.3 - uses: actions/setup-python@v4 with: From f8e2f0f52ca51c2e0cbcb3a8b8f319cd46dd53ba Mon Sep 17 00:00:00 2001 From: Jacob Aronoff Date: Mon, 19 Aug 2024 17:00:28 -0400 Subject: [PATCH 18/25] idk maybe --- .github/workflows/kube-stack-test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/kube-stack-test.yaml b/.github/workflows/kube-stack-test.yaml index a6815aff7..fec8eee1b 100644 --- a/.github/workflows/kube-stack-test.yaml +++ b/.github/workflows/kube-stack-test.yaml @@ -19,7 +19,7 @@ jobs: uses: ./.github/actions/setup with: create-kind-cluster: "true" - helm-version: "v3.11.3" + helm-version: "v3.12.3" # We'll need this eventually, but for now leave it commented. - name: Install cert-manager From ed28bddb3c686156566d972e12b2eb871257ff00 Mon Sep 17 00:00:00 2001 From: Jacob Aronoff Date: Tue, 20 Aug 2024 10:21:57 -0400 Subject: [PATCH 19/25] matrix --- .github/workflows/kube-stack-test.yaml | 2 +- .github/workflows/lint.yaml | 22 +++++++++++++++++++++- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/.github/workflows/kube-stack-test.yaml b/.github/workflows/kube-stack-test.yaml index fec8eee1b..a6815aff7 100644 --- a/.github/workflows/kube-stack-test.yaml +++ b/.github/workflows/kube-stack-test.yaml @@ -19,7 +19,7 @@ jobs: uses: ./.github/actions/setup with: create-kind-cluster: "true" - helm-version: "v3.12.3" + helm-version: "v3.11.3" # We'll need this eventually, but for now leave it commented. - name: Install cert-manager diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 110a5da41..ccd4ef6c6 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -6,7 +6,26 @@ on: - main jobs: + get-charts: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.set-matrix.outputs.matrix }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + - name: Get chart names + id: get-charts + run: | + chart_names=$(ls charts) + echo "Chart names: $chart_names" + matrix=$(echo "${chart_names}" | jq -R -s -c 'split("\n") | map(select(length > 0))') + echo "matrix=$matrix" >> "$GITHUB_OUTPUT" lint-test: + needs: get-charts + strategy: + matrix: + helm-version: ["v3.9.4", "v3.11.3"] + chart-name: ${{ fromJson(needs.get-charts.outputs.matrix) }} runs-on: ubuntu-latest steps: - name: Checkout @@ -17,6 +36,7 @@ jobs: uses: ./.github/actions/setup with: create-kind-cluster: "false" + helm-version: "${{ matrix.helm-version }}" - name: Run chart-testing (lint) run: "ct lint --target-branch main @@ -27,4 +47,4 @@ jobs: --chart-repos opensearch=https://opensearch-project.github.io/helm-charts" - name: Run make check-examples - run: make check-examples + run: make check-examples CHARTS=${{ matrix.chart-name }} From 8c04e037fe6c0743f1cbb94ae0a5a6eb7e3d6195 Mon Sep 17 00:00:00 2001 From: Jacob Aronoff Date: Tue, 20 Aug 2024 10:24:46 -0400 Subject: [PATCH 20/25] whoops --- .github/workflows/lint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index ccd4ef6c6..b391f5564 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -14,7 +14,7 @@ jobs: - name: Checkout code uses: actions/checkout@v4 - name: Get chart names - id: get-charts + id: set-matrix run: | chart_names=$(ls charts) echo "Chart names: $chart_names" From 06c4cba557132563941a1f501837821fd46c830c Mon Sep 17 00:00:00 2001 From: Jacob Aronoff Date: Tue, 20 Aug 2024 10:28:58 -0400 Subject: [PATCH 21/25] Add exclude --- .github/workflows/lint.yaml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index b391f5564..f1f5b63ba 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -20,12 +20,18 @@ jobs: echo "Chart names: $chart_names" matrix=$(echo "${chart_names}" | jq -R -s -c 'split("\n") | map(select(length > 0))') echo "matrix=$matrix" >> "$GITHUB_OUTPUT" - lint-test: + lint-matrix: needs: get-charts strategy: matrix: helm-version: ["v3.9.4", "v3.11.3"] chart-name: ${{ fromJson(needs.get-charts.outputs.matrix) }} + exclude: + # Excludes this version from testing for the OKS chart + # This version has a bug which prevents hooks from being rendered + # https://github.com/open-telemetry/opentelemetry-helm-charts/pull/1305 + - chart-name: opentelemetry-kube-stack + helm-version: "v3.9.4" runs-on: ubuntu-latest steps: - name: Checkout @@ -48,3 +54,19 @@ jobs: - name: Run make check-examples run: make check-examples CHARTS=${{ matrix.chart-name }} + lint-test: + runs-on: ubuntu-latest + if: always() + needs: [lint-matrix] + steps: + - name: Print result + run: echo ${{ needs.lint-matrix.result }} + - name: Interpret result + run: | + if [[ success == ${{ needs.e2e-tests.result }} ]] + then + echo "All matrix jobs passed!" + else + echo "One or more matrix jobs failed." + false + fi From 3f4cedf1fb22bf65697a6e381451f581d6af68c9 Mon Sep 17 00:00:00 2001 From: Jacob Aronoff Date: Tue, 20 Aug 2024 10:30:59 -0400 Subject: [PATCH 22/25] fix the matrix --- .github/actions/setup/action.yaml | 2 +- .github/workflows/lint.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup/action.yaml b/.github/actions/setup/action.yaml index 8ecff45ae..fe5fcdc21 100644 --- a/.github/actions/setup/action.yaml +++ b/.github/actions/setup/action.yaml @@ -17,7 +17,7 @@ runs: with: version: ${{ inputs.helm-version }} - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: 3.7 diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index f1f5b63ba..3aa4e712f 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -63,7 +63,7 @@ jobs: run: echo ${{ needs.lint-matrix.result }} - name: Interpret result run: | - if [[ success == ${{ needs.e2e-tests.result }} ]] + if [[ success == ${{ needs.lint-matrix.result }} ]] then echo "All matrix jobs passed!" else From 897f2044773f364caf945888e5dca3fdeb92fc3e Mon Sep 17 00:00:00 2001 From: Jacob Aronoff Date: Tue, 20 Aug 2024 10:34:17 -0400 Subject: [PATCH 23/25] revert matrix change --- .github/actions/setup/action.yaml | 2 +- .github/workflows/kube-stack-test.yaml | 6 ++-- .github/workflows/lint.yaml | 46 ++------------------------ 3 files changed, 5 insertions(+), 49 deletions(-) diff --git a/.github/actions/setup/action.yaml b/.github/actions/setup/action.yaml index fe5fcdc21..8ecff45ae 100644 --- a/.github/actions/setup/action.yaml +++ b/.github/actions/setup/action.yaml @@ -17,7 +17,7 @@ runs: with: version: ${{ inputs.helm-version }} - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v4 with: python-version: 3.7 diff --git a/.github/workflows/kube-stack-test.yaml b/.github/workflows/kube-stack-test.yaml index a6815aff7..6e6288988 100644 --- a/.github/workflows/kube-stack-test.yaml +++ b/.github/workflows/kube-stack-test.yaml @@ -28,7 +28,5 @@ jobs: kubectl wait --timeout=5m --for=condition=available deployment cert-manager -n cert-manager kubectl wait --timeout=5m --for=condition=available deployment cert-manager-webhook -n cert-manager - - name: Run Helm Install - run: | - helm dep build charts/opentelemetry-kube-stack - helm install opentelemetry-kube-stack charts/opentelemetry-kube-stack + - name: Run chart-testing (install) + run: ct install --charts charts/opentelemetry-kube-stack diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 3aa4e712f..110a5da41 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -6,32 +6,7 @@ on: - main jobs: - get-charts: - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.set-matrix.outputs.matrix }} - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Get chart names - id: set-matrix - run: | - chart_names=$(ls charts) - echo "Chart names: $chart_names" - matrix=$(echo "${chart_names}" | jq -R -s -c 'split("\n") | map(select(length > 0))') - echo "matrix=$matrix" >> "$GITHUB_OUTPUT" - lint-matrix: - needs: get-charts - strategy: - matrix: - helm-version: ["v3.9.4", "v3.11.3"] - chart-name: ${{ fromJson(needs.get-charts.outputs.matrix) }} - exclude: - # Excludes this version from testing for the OKS chart - # This version has a bug which prevents hooks from being rendered - # https://github.com/open-telemetry/opentelemetry-helm-charts/pull/1305 - - chart-name: opentelemetry-kube-stack - helm-version: "v3.9.4" + lint-test: runs-on: ubuntu-latest steps: - name: Checkout @@ -42,7 +17,6 @@ jobs: uses: ./.github/actions/setup with: create-kind-cluster: "false" - helm-version: "${{ matrix.helm-version }}" - name: Run chart-testing (lint) run: "ct lint --target-branch main @@ -53,20 +27,4 @@ jobs: --chart-repos opensearch=https://opensearch-project.github.io/helm-charts" - name: Run make check-examples - run: make check-examples CHARTS=${{ matrix.chart-name }} - lint-test: - runs-on: ubuntu-latest - if: always() - needs: [lint-matrix] - steps: - - name: Print result - run: echo ${{ needs.lint-matrix.result }} - - name: Interpret result - run: | - if [[ success == ${{ needs.lint-matrix.result }} ]] - then - echo "All matrix jobs passed!" - else - echo "One or more matrix jobs failed." - false - fi + run: make check-examples From bc6758c0efb138dd63dea4144e755a484f82fbdb Mon Sep 17 00:00:00 2001 From: Jacob Aronoff Date: Tue, 20 Aug 2024 10:35:21 -0400 Subject: [PATCH 24/25] version --- .github/workflows/lint.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 110a5da41..d20ca5329 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -17,6 +17,7 @@ jobs: uses: ./.github/actions/setup with: create-kind-cluster: "false" + helm-version: "v3.11.3" - name: Run chart-testing (lint) run: "ct lint --target-branch main From f6e697db071576cb186c2826069448636630c1bb Mon Sep 17 00:00:00 2001 From: Jacob Aronoff Date: Tue, 20 Aug 2024 10:39:59 -0400 Subject: [PATCH 25/25] oops --- .github/workflows/kube-stack-test.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/kube-stack-test.yaml b/.github/workflows/kube-stack-test.yaml index 6e6288988..a6815aff7 100644 --- a/.github/workflows/kube-stack-test.yaml +++ b/.github/workflows/kube-stack-test.yaml @@ -28,5 +28,7 @@ jobs: kubectl wait --timeout=5m --for=condition=available deployment cert-manager -n cert-manager kubectl wait --timeout=5m --for=condition=available deployment cert-manager-webhook -n cert-manager - - name: Run chart-testing (install) - run: ct install --charts charts/opentelemetry-kube-stack + - name: Run Helm Install + run: | + helm dep build charts/opentelemetry-kube-stack + helm install opentelemetry-kube-stack charts/opentelemetry-kube-stack