Replace monitoring solution with kube-prometheus-stack dependency (#299)

* Replace monitoring solution with kube-prometheus-stack dependency

* Enable pod monitors

* Download necessary chart dependencies for CI

* Actually run dependency update

* Enable missed podMonitor

* Disable alertmanager by default for feature parity

Related issues #294 #65

Supersedes #296 and #297

### Motivation

Our helm chart is out of date. I propose we make a breaking change for the monitoring solution and start using the `kube-prometheus-stack` as a dependency. This should make upgrades easier and will let users leverage all of that chart's features.

This change will result in the removal of the StreamNative Grafana Dashboards. We'll need to figure out the right way to address that. The apache/pulsar project has grafana dashboards, but they have not been maintained. With this added dependency, we'll have the benefit of being able to use k8s `ConfigMap`s to configure grafana dashboards.

### Modifications

* Remove old prometheus and grafana configuration
* Add kube-prometheus-stack chart as a dependency
* Enable several components by default. I am not opinionated on these, but it is based on the other values in the chart.

### Verifying this change

This is a large change that will require manual validation, and may break deployments. I propose this triggers a helm chart 3.0.0 release.
This commit is contained in:
Michael Marshall 2022-10-19 08:23:08 -07:00 committed by GitHub
parent 62a0d2b8a4
commit 7f23af26b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 34 additions and 753 deletions

View File

@ -110,6 +110,8 @@ function ci::install_pulsar_chart() {
${CHARTS_HOME}/scripts/pulsar/prepare_helm_release.sh -k ${CLUSTER} -n ${NAMESPACE} ${extra_opts} ${CHARTS_HOME}/scripts/pulsar/prepare_helm_release.sh -k ${CLUSTER} -n ${NAMESPACE} ${extra_opts}
sleep 10 sleep 10
echo ${HELM} dependency update ${CHARTS_HOME}/charts/pulsar
${HELM} dependency update ${CHARTS_HOME}/charts/pulsar
echo ${HELM} install --set initialize=true --values ${value_file} ${CLUSTER} ${CHARTS_HOME}/charts/pulsar echo ${HELM} install --set initialize=true --values ${value_file} ${CLUSTER} ${CHARTS_HOME}/charts/pulsar
${HELM} template --values ${value_file} ${CLUSTER} ${CHARTS_HOME}/charts/pulsar ${HELM} template --values ${value_file} ${CLUSTER} ${CHARTS_HOME}/charts/pulsar
${HELM} install --set initialize=true --values ${value_file} --namespace=${NAMESPACE} ${CLUSTER} ${CHARTS_HOME}/charts/pulsar ${HELM} install --set initialize=true --values ${value_file} --namespace=${NAMESPACE} ${CLUSTER} ${CHARTS_HOME}/charts/pulsar

View File

@ -29,3 +29,8 @@ icon: https://pulsar.apache.org/img/pulsar.svg
maintainers: maintainers:
- name: The Apache Pulsar Team - name: The Apache Pulsar Team
email: dev@pulsar.apache.org email: dev@pulsar.apache.org
dependencies:
- name: kube-prometheus-stack
version: 41.x.x
repository: https://prometheus-community.github.io/helm-charts
condition: kube-prometheus-stack.enabled

View File

@ -1,35 +0,0 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
{{- if or .Values.monitoring.grafana .Values.extra.monitoring }}
apiVersion: v1
kind: Secret
metadata:
name: "{{ template "pulsar.fullname" . }}-{{ .Values.grafana.component }}-secret"
namespace: {{ template "pulsar.namespace" . }}
labels:
{{- include "pulsar.standardLabels" . | nindent 4 }}
component: {{ .Values.grafana.component }}
type: Opaque
stringData:
{{- if .Values.grafana.admin}}
GRAFANA_ADMIN_PASSWORD: {{ .Values.grafana.admin.password | default "pulsar" }}
GRAFANA_ADMIN_USER: {{ .Values.grafana.admin.user | default "pulsar" }}
{{- end }}
{{- end }}

View File

@ -1,31 +0,0 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
{{- if or .Values.monitoring.grafana .Values.extra.monitoring }}
apiVersion: v1
kind: ConfigMap
metadata:
name: "{{ template "pulsar.fullname" . }}-{{ .Values.grafana.component }}"
namespace: {{ template "pulsar.namespace" . }}
labels:
{{- include "pulsar.standardLabels" . | nindent 4 }}
component: {{ .Values.grafana.component }}
data:
{{ toYaml .Values.grafana.configData | indent 2 }}
{{- end }}

View File

@ -1,91 +0,0 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
{{- if or .Values.monitoring.grafana .Values.extra.monitoring }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: "{{ template "pulsar.fullname" . }}-{{ .Values.grafana.component }}"
namespace: {{ template "pulsar.namespace" . }}
labels:
{{- include "pulsar.standardLabels" . | nindent 4 }}
component: {{ .Values.grafana.component }}
spec:
replicas: {{ .Values.grafana.replicaCount }}
selector:
matchLabels:
{{- include "pulsar.matchLabels" . | nindent 6 }}
component: {{ .Values.grafana.component }}
template:
metadata:
labels:
{{- include "pulsar.template.labels" . | nindent 8 }}
component: {{ .Values.grafana.component }}
annotations:
{{- if .Values.grafana.restartPodsOnConfigMapChange }}
checksum/config: {{ include (print $.Template.BasePath "/grafana-configmap.yaml") . | sha256sum }}
{{- end }}
{{- with .Values.grafana.annotations }}
{{ toYaml . | indent 8 }}
{{- end }}
spec:
{{- if .Values.grafana.nodeSelector }}
nodeSelector:
{{ toYaml .Values.grafana.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.grafana.tolerations }}
tolerations:
{{ toYaml .Values.grafana.tolerations | indent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ .Values.grafana.gracePeriod }}
containers:
- name: "{{ template "pulsar.fullname" . }}-{{ .Values.grafana.component }}"
image: "{{ .Values.images.grafana.repository }}:{{ .Values.images.grafana.tag }}"
imagePullPolicy: {{ .Values.images.grafana.pullPolicy }}
{{- if .Values.grafana.resources }}
resources:
{{ toYaml .Values.grafana.resources | indent 10 }}
{{- end }}
ports:
- name: server
containerPort: {{ .Values.grafana.service.targetPort }}
envFrom:
- configMapRef:
name: "{{ template "pulsar.fullname" . }}-{{ .Values.grafana.component }}"
env:
# for supporting apachepulsar/pulsar-grafana
- name: PROMETHEUS_URL
value: http://{{ template "pulsar.fullname" . }}-{{ .Values.prometheus.component }}:9090/
# for supporting streamnative/apache-pulsar-grafana-dashboard
- name: PULSAR_PROMETHEUS_URL
value: http://{{ template "pulsar.fullname" . }}-{{ .Values.prometheus.component }}:9090/
- name: PULSAR_CLUSTER
value: {{ template "pulsar.fullname" . }}
- name: GRAFANA_ADMIN_USER
valueFrom:
secretKeyRef:
name: "{{ template "pulsar.fullname" . }}-{{ .Values.grafana.component }}-secret"
key: GRAFANA_ADMIN_USER
- name: GRAFANA_ADMIN_PASSWORD
valueFrom:
secretKeyRef:
name: "{{ template "pulsar.fullname" . }}-{{ .Values.grafana.component }}-secret"
key: GRAFANA_ADMIN_PASSWORD
{{- include "pulsar.imagePullSecrets" . | nindent 6}}
{{- end }}

View File

@ -1,66 +0,0 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
{{- if or .Values.monitoring.grafana .Values.extra.monitoring }}
{{- if .Values.grafana.ingress.enabled }}
{{- if semverCompare "<1.19-0" .Capabilities.KubeVersion.Version }}
apiVersion: extensions/v1beta1
{{- else }}
apiVersion: networking.k8s.io/v1
{{- end }}
kind: Ingress
metadata:
name: "{{ template "pulsar.fullname" . }}-{{ .Values.grafana.component }}"
namespace: {{ template "pulsar.namespace" . }}
labels:
app: {{ template "pulsar.name" . }}
chart: {{ template "pulsar.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
{{- with .Values.grafana.ingress.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
spec:
{{- if .Values.grafana.ingress.tls }}
tls:
{{ toYaml .Values.grafana.ingress.tls | indent 4 }}
{{- end }}
rules:
- http:
paths:
- path: {{ .Values.grafana.ingress.path }}
{{- if semverCompare "<1.19-0" .Capabilities.KubeVersion.Version }}
backend:
serviceName: "{{ template "pulsar.fullname" . }}-{{ .Values.grafana.component }}"
servicePort: {{ .Values.grafana.ingress.port }}
{{- else }}
pathType: ImplementationSpecific
backend:
service:
name: "{{ template "pulsar.fullname" . }}-{{ .Values.grafana.component }}"
port:
number: {{ .Values.grafana.ingress.port }}
{{- end }}
{{- if .Values.grafana.ingress.hostname }}
host: {{ .Values.grafana.ingress.hostname }}
{{- end }}
{{- end }}
{{- end }}

View File

@ -1,48 +0,0 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
{{- if or .Values.monitoring.grafana .Values.extra.monitoring }}
apiVersion: v1
kind: Service
metadata:
name: "{{ template "pulsar.fullname" . }}-{{ .Values.grafana.component }}"
namespace: {{ template "pulsar.namespace" . }}
labels:
{{- include "pulsar.standardLabels" . | nindent 4 }}
component: {{ .Values.grafana.component }}
annotations:
{{- with .Values.grafana.service.annotations }}
{{ toYaml . | indent 4 }}
{{- end }}
spec:
type: {{ .Values.grafana.service.type }}
ports:
- name: server
port: {{ .Values.grafana.service.port }}
targetPort: {{ .Values.grafana.service.targetPort }}
protocol: TCP
selector:
{{- include "pulsar.matchLabels" . | nindent 4 }}
component: {{ .Values.grafana.component }}
sessionAffinity: None
{{- if .Values.grafana.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{ toYaml .Values.grafana.service.loadBalancerSourceRanges | indent 4 }}
{{- end }}
{{- end }}

View File

@ -1,66 +0,0 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
{{- if or .Values.monitoring.prometheus .Values.extra.monitoring }}
apiVersion: v1
kind: ConfigMap
metadata:
name: "{{ template "pulsar.fullname" . }}-{{ .Values.prometheus.component }}"
namespace: {{ template "pulsar.namespace" . }}
labels:
{{- include "pulsar.standardLabels" . | nindent 4 }}
component: {{ .Values.prometheus.component }}
data:
# Include prometheus configuration file, setup to monitor all the
# Kubernetes pods with the "scrape=true" annotation.
prometheus.yml: |
global:
scrape_interval: 15s
scrape_configs:
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']
- job_name: 'kubernetes-pods'
kubernetes_sd_configs:
- role: pod
relabel_configs:
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape]
action: keep
regex: true
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_path]
action: replace
target_label: __metrics_path__
regex: (.+)
- source_labels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port]
action: replace
regex: ([^:]+)(?::\d+)?;(\d+)
replacement: $1:$2
target_label: __address__
- action: labelmap
regex: __meta_kubernetes_pod_label_(.+)
- source_labels: [__meta_kubernetes_namespace]
action: replace
target_label: kubernetes_namespace
- source_labels: [__meta_kubernetes_pod_label_component]
action: replace
target_label: job
- source_labels: [__meta_kubernetes_pod_name]
action: replace
target_label: kubernetes_pod_name
{{- end }}

View File

@ -1,97 +0,0 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
{{- if or .Values.monitoring.prometheus .Values.extra.monitoring }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: "{{ template "pulsar.fullname" . }}-{{ .Values.prometheus.component }}"
namespace: {{ template "pulsar.namespace" . }}
labels:
{{- include "pulsar.standardLabels" . | nindent 4 }}
component: {{ .Values.prometheus.component }}
spec:
replicas: {{ .Values.prometheus.replicaCount }}
selector:
matchLabels:
{{- include "pulsar.matchLabels" . | nindent 6 }}
component: {{ .Values.prometheus.component }}
template:
metadata:
labels:
{{- include "pulsar.template.labels" . | nindent 8 }}
component: {{ .Values.prometheus.component }}
annotations:
{{- if .Values.prometheus.restartPodsOnConfigMapChange }}
checksum/config: {{ include (print $.Template.BasePath "/prometheus-configmap.yaml") . | sha256sum }}
{{- end }}
{{ toYaml .Values.prometheus.annotations | indent 8 }}
spec:
{{- if .Values.prometheus.nodeSelector }}
nodeSelector:
{{ toYaml .Values.prometheus.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.prometheus.tolerations }}
tolerations:
{{ toYaml .Values.prometheus.tolerations | indent 8 }}
{{- end }}
{{- if or .Values.prometheus.rbac.enabled .Values.prometheus_rbac }}
serviceAccount: "{{ template "pulsar.fullname" . }}-{{ .Values.prometheus.component }}"
{{- end }}
terminationGracePeriodSeconds: {{ .Values.prometheus.gracePeriod }}
containers:
- name: "{{ template "pulsar.fullname" . }}-{{ .Values.prometheus.component }}"
image: "{{ .Values.images.prometheus.repository }}:{{ .Values.images.prometheus.tag }}"
imagePullPolicy: {{ .Values.images.prometheus.pullPolicy }}
{{- if .Values.prometheus.enableAdminApi }}
args:
- --web.enable-admin-api
{{- end }}
{{- if .Values.prometheus.resources }}
resources:
{{ toYaml .Values.prometheus.resources | indent 10 }}
{{- end }}
ports:
- name: server
containerPort: {{ .Values.prometheus.port }}
volumeMounts:
- name: "{{ template "pulsar.fullname" . }}-{{ .Values.prometheus.component }}-config"
mountPath: /etc/prometheus
- name: "{{ template "pulsar.fullname" . }}-{{ .Values.prometheus.component }}-{{ .Values.prometheus.volumes.data.name }}"
mountPath: /prometheus
securityContext:
fsGroup: 65534
runAsGroup: 65534
runAsNonRoot: true
runAsUser: 65534
volumes:
- name: "{{ template "pulsar.fullname" . }}-{{ .Values.prometheus.component }}-config"
configMap:
name: "{{ template "pulsar.fullname" . }}-{{ .Values.prometheus.component }}"
{{- if not (and (and .Values.persistence .Values.volumes.persistence) .Values.prometheus.volumes.persistence) }}
- name: "{{ template "pulsar.fullname" . }}-{{ .Values.prometheus.component }}-{{ .Values.prometheus.volumes.data.name }}"
emptyDir: {}
{{- end }}
{{- if and (and .Values.persistence .Values.volumes.persistence) .Values.prometheus.volumes.persistence }}
- name: "{{ template "pulsar.fullname" . }}-{{ .Values.prometheus.component }}-{{ .Values.prometheus.volumes.data.name }}"
persistentVolumeClaim:
claimName: "{{ template "pulsar.fullname" . }}-{{ .Values.prometheus.component }}-{{ .Values.prometheus.volumes.data.name }}"
{{- end }}
{{- include "pulsar.imagePullSecrets" . | nindent 6}}
{{- end }}

View File

@ -1,40 +0,0 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
{{- if or .Values.monitoring.prometheus .Values.extra.monitoring }}
{{- if and (and .Values.persistence .Values.volumes.persistence) .Values.prometheus.volumes.persistence }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: "{{ template "pulsar.fullname" . }}-{{ .Values.prometheus.component }}-{{ .Values.prometheus.volumes.data.name }}"
namespace: {{ template "pulsar.namespace" . }}
spec:
resources:
requests:
storage: {{ .Values.prometheus.volumes.data.size }}
accessModes: [ "ReadWriteOnce" ]
{{- if .Values.prometheus.volumes.data.storageClassName }}
storageClassName: "{{ .Values.prometheus.volumes.data.storageClassName }}"
{{- else if and (not (and .Values.volumes.local_storage .Values.prometheus.volumes.data.local_storage)) .Values.prometheus.volumes.data.storageClass }}
storageClassName: "{{ template "pulsar.fullname" . }}-{{ .Values.prometheus.component }}-{{ .Values.prometheus.volumes.data.name }}"
{{- else if and .Values.volumes.local_storage .Values.prometheus.volumes.data.local_storage }}
storageClassName: "local-storage"
{{- end }}
{{- end }}
{{- end }}

View File

@ -1,59 +0,0 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
{{- if or .Values.monitoring.prometheus .Values.extra.monitoring }}
{{- if or .Values.prometheus.rbac.enabled .Values.prometheus_rbac }}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: "{{ template "pulsar.fullname" . }}-{{ .Values.prometheus.component }}"
rules:
- apiGroups: [""]
resources:
- nodes
- nodes/proxy
- services
- endpoints
- pods
verbs: ["get", "list", "watch"]
- nonResourceURLs: ["/metrics"]
verbs: ["get"]
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: "{{ template "pulsar.fullname" . }}-{{ .Values.prometheus.component }}"
namespace: {{ template "pulsar.namespace" . }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: "{{ template "pulsar.fullname" . }}-{{ .Values.prometheus.component }}"
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: "{{ template "pulsar.fullname" . }}-{{ .Values.prometheus.component }}"
subjects:
- kind: ServiceAccount
name: "{{ template "pulsar.fullname" . }}-{{ .Values.prometheus.component }}"
namespace: {{ template "pulsar.namespace" . }}
{{- end }}
{{- end }}

View File

@ -1,39 +0,0 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
{{- if or .Values.monitoring.prometheus .Values.extra.monitoring }}
apiVersion: v1
kind: Service
metadata:
name: "{{ template "pulsar.fullname" . }}-{{ .Values.prometheus.component }}"
namespace: {{ template "pulsar.namespace" . }}
labels:
{{- include "pulsar.standardLabels" . | nindent 4 }}
component: {{ .Values.prometheus.component }}
annotations:
{{ toYaml .Values.prometheus.service.annotations | indent 4 }}
spec:
clusterIP: None
ports:
- name: server
port: {{ .Values.prometheus.port }}
selector:
{{- include "pulsar.matchLabels" . | nindent 4 }}
component: {{ .Values.prometheus.component }}
{{- end }}

View File

@ -1,37 +0,0 @@
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
{{- if or .Values.monitoring.prometheus .Values.extra.monitoring }}
{{- if and (and .Values.persistence .Values.volumes.persistence) .Values.prometheus.volumes.persistence }}
{{- if .Values.prometheus.volumes.data.storageClass }}
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: "{{ template "pulsar.fullname" . }}-{{ .Values.prometheus.component }}-{{ .Values.prometheus.volumes.data.name }}"
namespace: {{ template "pulsar.namespace" . }}
labels:
{{- include "pulsar.standardLabels" . | nindent 4 }}
component: {{ .Values.prometheus.component }}
provisioner: {{ .Values.prometheus.volumes.data.storageClass.provisioner }}
parameters:
type: {{ .Values.prometheus.volumes.data.storageClass.type }}
fsType: {{ .Values.prometheus.volumes.data.storageClass.fsType }}
{{- end }}
{{- end }}
{{- end }}

View File

@ -127,19 +127,6 @@ components:
# pulsar manager # pulsar manager
pulsar_manager: false pulsar_manager: false
## Monitoring Components
##
## Control what components of the monitoring stack to deploy for the cluster
monitoring:
# monitoring - prometheus
prometheus: true
# monitoring - grafana
grafana: true
# monitoring - node_exporter
node_exporter: true
# alerting - alert-manager
alert_manager: true
## which extra components to deploy (Deprecated) ## which extra components to deploy (Deprecated)
extra: extra:
# Pulsar proxy # Pulsar proxy
@ -152,8 +139,6 @@ extra:
dashboard: false dashboard: false
# pulsar manager # pulsar manager
pulsar_manager: false pulsar_manager: false
# Monitoring stack (prometheus and grafana)
monitoring: false
# Configure Kubernetes runtime for Functions # Configure Kubernetes runtime for Functions
functionsAsPods: false functionsAsPods: false
@ -194,14 +179,6 @@ images:
repository: apachepulsar/pulsar-all repository: apachepulsar/pulsar-all
# uses defaultPulsarImageTag when unspecified # uses defaultPulsarImageTag when unspecified
tag: tag:
prometheus:
repository: prom/prometheus
tag: v2.17.2
pullPolicy: IfNotPresent
grafana:
repository: streamnative/apache-pulsar-grafana-dashboard-k8s
tag: 0.0.16
pullPolicy: IfNotPresent
pulsar_manager: pulsar_manager:
repository: apachepulsar/pulsar-manager repository: apachepulsar/pulsar-manager
tag: v0.3.0 tag: v0.3.0
@ -304,14 +281,13 @@ zookeeper:
# so the metrics are correctly rendered in grafana dashboard # so the metrics are correctly rendered in grafana dashboard
component: zookeeper component: zookeeper
# the number of zookeeper servers to run. it should be an odd number larger than or equal to 3. # the number of zookeeper servers to run. it should be an odd number larger than or equal to 3.
replicaCount: 3 replicaCount: 1
updateStrategy: updateStrategy:
type: RollingUpdate type: RollingUpdate
podManagementPolicy: Parallel podManagementPolicy: Parallel
# If using Prometheus-Operator enable this PodMonitor to discover zookeeper scrape targets # This is how prometheus discovers this component
# Prometheus-Operator does not add scrape targets based on k8s annotations
podMonitor: podMonitor:
enabled: false enabled: true
interval: 10s interval: 10s
scrapeTimeout: 10s scrapeTimeout: 10s
# True includes annotation for statefulset that contains hash of corresponding configmap, which will cause pods to restart on configmap change # True includes annotation for statefulset that contains hash of corresponding configmap, which will cause pods to restart on configmap change
@ -349,9 +325,7 @@ zookeeper:
# requiredDuringSchedulingIgnoredDuringExecution - rules must be met for pod to be scheduled (hard) requires at least one node per replica # requiredDuringSchedulingIgnoredDuringExecution - rules must be met for pod to be scheduled (hard) requires at least one node per replica
# preferredDuringSchedulingIgnoredDuringExecution - scheduler will try to enforce but not guranentee # preferredDuringSchedulingIgnoredDuringExecution - scheduler will try to enforce but not guranentee
type: requiredDuringSchedulingIgnoredDuringExecution type: requiredDuringSchedulingIgnoredDuringExecution
annotations: annotations: {}
prometheus.io/scrape: "true"
prometheus.io/port: "8000"
tolerations: [] tolerations: []
gracePeriod: 30 gracePeriod: 30
resources: resources:
@ -447,10 +421,9 @@ bookkeeper:
updateStrategy: updateStrategy:
type: RollingUpdate type: RollingUpdate
podManagementPolicy: Parallel podManagementPolicy: Parallel
# If using Prometheus-Operator enable this PodMonitor to discover bookie scrape targets # This is how prometheus discovers this component
# Prometheus-Operator does not add scrape targets based on k8s annotations
podMonitor: podMonitor:
enabled: false enabled: true
interval: 10s interval: 10s
scrapeTimeout: 10s scrapeTimeout: 10s
# True includes annotation for statefulset that contains hash of corresponding configmap, which will cause pods to restart on configmap change # True includes annotation for statefulset that contains hash of corresponding configmap, which will cause pods to restart on configmap change
@ -620,10 +593,9 @@ autorecovery:
# so the metrics are correctly rendered in grafana dashboard # so the metrics are correctly rendered in grafana dashboard
component: recovery component: recovery
replicaCount: 1 replicaCount: 1
# If using Prometheus-Operator enable this PodMonitor to discover autorecovery scrape targets # This is how prometheus discovers this component
# # Prometheus-Operator does not add scrape targets based on k8s annotations
podMonitor: podMonitor:
enabled: false enabled: true
interval: 10s interval: 10s
scrapeTimeout: 10s scrapeTimeout: 10s
# True includes annotation for statefulset that contains hash of corresponding configmap, which will cause pods to restart on configmap change # True includes annotation for statefulset that contains hash of corresponding configmap, which will cause pods to restart on configmap change
@ -696,10 +668,9 @@ broker:
minReplicas: 1 minReplicas: 1
maxReplicas: 3 maxReplicas: 3
metrics: ~ metrics: ~
# If using Prometheus-Operator enable this PodMonitor to discover broker scrape targets # This is how prometheus discovers this component
# Prometheus-Operator does not add scrape targets based on k8s annotations
podMonitor: podMonitor:
enabled: false enabled: true
interval: 10s interval: 10s
scrapeTimeout: 10s scrapeTimeout: 10s
# True includes annotation for statefulset that contains hash of corresponding configmap, which will cause pods to restart on configmap change # True includes annotation for statefulset that contains hash of corresponding configmap, which will cause pods to restart on configmap change
@ -783,9 +754,9 @@ broker:
-XX:-ResizePLAB -XX:-ResizePLAB
-XX:+ExitOnOutOfMemoryError -XX:+ExitOnOutOfMemoryError
-XX:+PerfDisableSharedMem -XX:+PerfDisableSharedMem
managedLedgerDefaultEnsembleSize: "2" managedLedgerDefaultEnsembleSize: "1"
managedLedgerDefaultWriteQuorum: "2" managedLedgerDefaultWriteQuorum: "1"
managedLedgerDefaultAckQuorum: "2" managedLedgerDefaultAckQuorum: "1"
## Add a custom command to the start up process of the broker pods (e.g. update-ca-certificates, jvm commands, etc) ## Add a custom command to the start up process of the broker pods (e.g. update-ca-certificates, jvm commands, etc)
additionalCommand: additionalCommand:
## Broker service ## Broker service
@ -823,10 +794,9 @@ proxy:
minReplicas: 1 minReplicas: 1
maxReplicas: 3 maxReplicas: 3
metrics: ~ metrics: ~
# If using Prometheus-Operator enable this PodMonitor to discover proxy scrape targets # This is how prometheus discovers this component
# Prometheus-Operator does not add scrape targets based on k8s annotations
podMonitor: podMonitor:
enabled: false enabled: true
interval: 10s interval: 10s
scrapeTimeout: 10s scrapeTimeout: 10s
# True includes annotation for statefulset that contains hash of corresponding configmap, which will cause pods to restart on configmap change # True includes annotation for statefulset that contains hash of corresponding configmap, which will cause pods to restart on configmap change
@ -1026,109 +996,22 @@ toolset:
additionalCommand: additionalCommand:
############################################################# #############################################################
### Monitoring Stack : Prometheus / Grafana ### Monitoring Stack : kube-prometheus-stack chart
############################################################# #############################################################
## Monitoring Stack: Prometheus ## Prometheus, Grafana, and the rest of the kube-prometheus-stack are managed by the dependent chart here:
## templates/prometheus-deployment.yaml ## https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack
## ## For sample values, please see their documentation.
kube-prometheus-stack:
## Deprecated in favor of using `prometheus.rbac.enabled` enabled: true
prometheus_rbac: false prometheus:
prometheus:
component: prometheus
rbac:
enabled: true enabled: true
replicaCount: 1 grafana:
# True includes annotation for statefulset that contains hash of corresponding configmap, which will cause pods to restart on configmap change enabled: true
restartPodsOnConfigMapChange: false prometheus-node-exporter:
# nodeSelector: enabled: true
# cloud.google.com/gke-nodepool: default-pool alertmanager:
annotations: {}
tolerations: []
gracePeriod: 5
port: 9090
enableAdminApi: false
resources:
requests:
memory: 256Mi
cpu: 0.1
volumes:
# use a persistent volume or emptyDir
persistence: true
data:
name: data
size: 10Gi
local_storage: true
## If you already have an existent storage class and want to reuse it, you can specify its name with the option below
##
# storageClassName: existent-storage-class
#
## Instead if you want to create a new storage class define it below
## If left undefined no storage class will be defined along with PVC
##
# storageClass:
# type: pd-standard
# fsType: xfs
# provisioner: kubernetes.io/gce-pd
## Prometheus service
## templates/prometheus-service.yaml
##
service:
annotations: {}
## Monitoring Stack: Grafana
## templates/grafana-deployment.yaml
##
grafana:
component: grafana
replicaCount: 1
# True includes annotation for statefulset that contains hash of corresponding configmap, which will cause pods to restart on configmap change
restartPodsOnConfigMapChange: false
# nodeSelector:
# cloud.google.com/gke-nodepool: default-pool
annotations: {}
tolerations: []
gracePeriod: 30
resources:
requests:
memory: 250Mi
cpu: 0.1
## Grafana service
## templates/grafana-service.yaml
##
service:
type: LoadBalancer
port: 3000
targetPort: 3000
annotations: {}
plugins: []
## Grafana configMap
## templates/grafana-configmap.yaml
##
configData: {}
## Grafana ingress
## templates/grafana-ingress.yaml
##
ingress:
enabled: false enabled: false
annotations: {}
labels: {}
tls: []
## Optional. Leave it blank if your Ingress Controller can provide a default certificate.
## - secretName: ""
## Extra paths to prepend to every host configuration. This is useful when working with annotation based services.
extraPaths: []
hostname: ""
protocol: http
path: /grafana
port: 80
admin:
user: pulsar
password: pulsar
## Components Stack: pulsar_manager ## Components Stack: pulsar_manager
## templates/pulsar-manager.yaml ## templates/pulsar-manager.yaml