From f9430973322ca4efe9db20e2f192022595970df7 Mon Sep 17 00:00:00 2001 From: Brian Kopp Date: Mon, 22 Jul 2024 09:14:48 -0600 Subject: [PATCH 1/5] Update readme to remove prometheus --- README.md | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 2eaee753..714e967a 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Temporal is a distributed, scalable, durable, and highly available orchestration This repo contains a V3 [Helm](https://helm.sh) chart that deploys Temporal to a Kubernetes cluster. The dependencies that are bundled with this solution by default offer a baseline configuration to experiment with Temporal software. This Helm chart can also be used to install just the Temporal server, configured to connect to dependencies (such as a Cassandra, MySQL, or PostgreSQL database) that you may already have available in your environment. -The only portions of the helm chart that are considered production ready are the parts that configure and manage Temporal itself. Cassandra, Elasticsearch, Prometheus, and Grafana are all using minimal development configurations, and should be reconfigured in a production deployment. +The only portions of the helm chart that are considered production ready are the parts that configure and manage Temporal itself. Cassandra, Elasticsearch, and Grafana are all using minimal development configurations, and should be reconfigured in a production deployment. This Helm Chart code is tested by a dedicated test pipeline. It is also used extensively by other Temporal pipelines for testing various aspects of Temporal systems. Our test pipeline currently uses Helm 3.1.1. @@ -43,14 +43,13 @@ Temporal can be configured to run with various dependencies. The default "Batter * Cassandra * Elasticsearch -* Prometheus * Grafana The sections that follow describe various deployment configurations, from a minimal one-replica installation using included dependencies, to a replicated deployment on existing infrastructure. ### Minimal installation with required dependencies only -To install Temporal in a limited but working and self-contained configuration (one replica of Cassandra, Elasticsearch and each of Temporal's services, no metrics), you can run: +To install Temporal in a limited but working and self-contained configuration (one replica of Cassandra, Elasticsearch and each of Temporal's services), you can run: ```bash helm install \ @@ -58,7 +57,6 @@ helm install \ --set server.replicaCount=1 \ --set cassandra.config.cluster_size=1 \ --set elasticsearch.replicas=1 \ - --set prometheus.enabled=false \ --set grafana.enabled=false \ temporaltest temporal \ --timeout 15m @@ -87,7 +85,7 @@ temporaltest-worker-7c9d68f4cf-8tzfw 1/1 Running 2 11m This method requires a three node kubernetes cluster to successfully bring up all the dependencies. -When installed without manully setting dependency replicas to 1, this Temporal Helm Chart configures Temporal to run with a three node Cassandra cluster (for persistence) and Elasticsearch (for "visibility" features), Prometheus, and Grafana. By default, Temporal Helm Chart installs all dependencies, out of the box. +When installed without manully setting dependency replicas to 1, this Temporal Helm Chart configures Temporal to run with a three node Cassandra cluster (for persistence) and Elasticsearch (for "visibility" features), and Grafana. By default, Temporal Helm Chart installs all dependencies, out of the box. To install Temporal with all of its dependencies run this command: @@ -97,12 +95,11 @@ helm install --repo https://go.temporal.io/helm-charts temporaltest temporal --t To use your own instance of Elasticsearch, MySQL, PostgreSQL, or Cassandra, please read the "Bring Your Own" sections below. -Other components (Prometheus, Grafana) can be omitted from the installation by setting their corresponding `enable` flag to `false`: +Other components (Grafana) can be omitted from the installation by setting their corresponding `enable` flag to `false`: ```bash helm install \ --repo https://go.temporal.io/helm-charts \ - --set prometheus.enabled=false \ --set grafana.enabled=false \ temporaltest temporal \ --timeout 900s @@ -275,7 +272,6 @@ helm install \ -f values/values.archival.filestore.yaml \ --set server.replicaCount=1 \ --set cassandra.config.cluster_size=1 \ - --set prometheus.enabled=false \ --set grafana.enabled=false \ --set elasticsearch.enabled=false \ temporaltest temporal \ @@ -302,7 +298,6 @@ helm install \ -f values/values.elasticsearch.yaml \ --set elasticsearch.enabled=true \ --set grafana.enabled=false \ - --set prometheus.enabled=false \ --set server.replicaCount=5 \ --set server.config.persistence.default.cassandra.hosts=cassandra.data.host.example \ --set server.config.persistence.default.cassandra.user=cassandra_user \ From 95d7e2fc6b0d547ca96fdef66928d12d0e859c0e Mon Sep 17 00:00:00 2001 From: Brian Kopp Date: Mon, 22 Jul 2024 09:15:14 -0600 Subject: [PATCH 2/5] Remove prometheus from dependencies and examples --- charts/temporal/Chart.yaml | 4 --- charts/temporal/values.yaml | 4 --- .../temporal/values/values.antiaffinity.yaml | 9 ------ charts/temporal/values/values.postgresql.yaml | 3 -- .../values/values.prometheus.external.yaml | 28 ------------------- 5 files changed, 48 deletions(-) delete mode 100644 charts/temporal/values/values.prometheus.external.yaml diff --git a/charts/temporal/Chart.yaml b/charts/temporal/Chart.yaml index f7c08a33..e680d9e7 100644 --- a/charts/temporal/Chart.yaml +++ b/charts/temporal/Chart.yaml @@ -16,10 +16,6 @@ dependencies: version: "0.14.3" repository: https://charts.helm.sh/incubator condition: cassandra.enabled - - name: prometheus - repository: https://prometheus-community.github.io/helm-charts - version: 25.22.0 - condition: prometheus.enabled - name: elasticsearch repository: https://helm.elastic.co version: 7.17.3 diff --git a/charts/temporal/values.yaml b/charts/temporal/values.yaml index 03afa2b0..285b7501 100644 --- a/charts/temporal/values.yaml +++ b/charts/temporal/values.yaml @@ -405,10 +405,6 @@ elasticsearch: username: "" password: "" visibilityIndex: "temporal_visibility_v1_dev" -prometheus: - enabled: true - nodeExporter: - enabled: false grafana: enabled: true replicas: 1 diff --git a/charts/temporal/values/values.antiaffinity.yaml b/charts/temporal/values/values.antiaffinity.yaml index 29cd8779..797ba312 100644 --- a/charts/temporal/values/values.antiaffinity.yaml +++ b/charts/temporal/values/values.antiaffinity.yaml @@ -23,15 +23,6 @@ cassandra: values: - elasticsearch-master topologyKey: kubernetes.io/hostname - - weight: 5 - podAffinityTerm: - labelSelector: - matchExpressions: - - key: app - operator: In - values: - - prometheus - topologyKey: kubernetes.io/hostname - weight: 1 podAffinityTerm: labelSelector: diff --git a/charts/temporal/values/values.postgresql.yaml b/charts/temporal/values/values.postgresql.yaml index 5ce63edb..f4293513 100644 --- a/charts/temporal/values/values.postgresql.yaml +++ b/charts/temporal/values/values.postgresql.yaml @@ -64,9 +64,6 @@ mysql: postgresql: enabled: true -prometheus: - enabled: true - grafana: enabled: true diff --git a/charts/temporal/values/values.prometheus.external.yaml b/charts/temporal/values/values.prometheus.external.yaml deleted file mode 100644 index b70fef33..00000000 --- a/charts/temporal/values/values.prometheus.external.yaml +++ /dev/null @@ -1,28 +0,0 @@ -prometheus: - alertmanager: - enabled: false - alertmanagerFiles: - alertmanager.yml: {} - kubeStateMetrics: - enabled: false - nodeExporter: - enabled: false - pushgateway: - enabled: false - server: - persistentVolume: - enabled: false - extraArgs: - # minimal possible values - storage.tsdb.retention: 6h - storage.tsdb.min-block-duration: 2h - storage.tsdb.max-block-duration: 2h - serverFiles: - alerts: {} - prometheus.yml: - remote_write: - - url: _URL_ - basic_auth: - password: _PASSWORD_ - username: _USERNAME_ - rules: {} From e3018d8f7d3cd8701c0b7661cae51b79de03061d Mon Sep 17 00:00:00 2001 From: Brian Kopp Date: Mon, 22 Jul 2024 09:15:34 -0600 Subject: [PATCH 3/5] Add label to pod that was missing from the service --- charts/temporal/templates/server-deployment.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/charts/temporal/templates/server-deployment.yaml b/charts/temporal/templates/server-deployment.yaml index f8e4488b..6345695d 100644 --- a/charts/temporal/templates/server-deployment.yaml +++ b/charts/temporal/templates/server-deployment.yaml @@ -23,6 +23,7 @@ spec: {{- if (default $.Values.server.metrics.annotations.enabled $serviceValues.metrics.annotations.enabled) }} prometheus.io/job: {{ $.Chart.Name }}-{{ $service }} prometheus.io/scrape: 'true' + prometheus.io/scheme: http prometheus.io/port: '9090' {{- end }} {{- with (default $.Values.server.podAnnotations $serviceValues.podAnnotations) }} From 57d08249292730ee477778cc8f1c5c323f630b2b Mon Sep 17 00:00:00 2001 From: Brian Kopp Date: Mon, 22 Jul 2024 09:15:45 -0600 Subject: [PATCH 4/5] Conditionally create the prometheus labels on the service --- charts/temporal/templates/server-service.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/charts/temporal/templates/server-service.yaml b/charts/temporal/templates/server-service.yaml index 47e4d0bf..1b5f0d80 100644 --- a/charts/temporal/templates/server-service.yaml +++ b/charts/temporal/templates/server-service.yaml @@ -38,10 +38,12 @@ metadata: labels: {{- include "temporal.resourceLabels" (list $ $service "") | nindent 4 }} app.kubernetes.io/headless: 'true' + {{- if (default $.Values.server.metrics.annotations.enabled $serviceValues.metrics.annotations.enabled) }} prometheus.io/job: {{ $.Chart.Name }}-{{ $service }} prometheus.io/scrape: 'true' prometheus.io/scheme: http prometheus.io/port: "9090" + {{- end }} annotations: # Use this annotation in addition to the actual field below because the From ae7d49bc9b0f3ceb8d80db512ec9358d833ce502 Mon Sep 17 00:00:00 2001 From: Brian Kopp Date: Mon, 22 Jul 2024 09:15:57 -0600 Subject: [PATCH 5/5] Update comment in values.yaml to better describe what's happening --- charts/temporal/values.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/charts/temporal/values.yaml b/charts/temporal/values.yaml index 285b7501..ff4c3a3f 100644 --- a/charts/temporal/values.yaml +++ b/charts/temporal/values.yaml @@ -25,8 +25,11 @@ server: # Global default settings (can be overridden per service) replicaCount: 1 metrics: - # Annotate pods directly with Prometheus annotations. - # Use this if you installed Prometheus from a Helm chart. + # Annotate pods and services directly with the following Prometheus annotations. + # prometheus.io/job + # prometheus.io/port + # prometheus.io/scheme + # prometheus.io/scrape annotations: enabled: true # Additional tags to be added to Prometheus metrics