Merge "Add prometheus exporters to osh charts"
This commit is contained in:
commit
f0ab11eabe
@ -0,0 +1,24 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Copyright 2017 The Openstack-Helm Authors.
|
||||||
|
|
||||||
|
Licensed 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.
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
mysql --defaults-file=/etc/mysql/admin_user.cnf -e \
|
||||||
|
"CREATE OR REPLACE USER '${EXPORTER_USER}'@'%' IDENTIFIED BY '${EXPORTER_PASSWORD}'; \
|
||||||
|
GRANT PROCESS, REPLICATION CLIENT, SELECT ON *.* TO '${EXPORTER_USER}'@'%'; \
|
||||||
|
FLUSH PRIVILEGES;"
|
@ -0,0 +1,30 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Copyright 2017 The Openstack-Helm Authors.
|
||||||
|
|
||||||
|
Licensed 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.
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
COMMAND="${@:-start}"
|
||||||
|
|
||||||
|
function start () {
|
||||||
|
exec /bin/mysqld_exporter -config.my-cnf=/etc/mysql/mysql_user.cnf
|
||||||
|
}
|
||||||
|
|
||||||
|
function stop () {
|
||||||
|
kill -TERM 1
|
||||||
|
}
|
||||||
|
|
||||||
|
$COMMAND
|
@ -0,0 +1,29 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright 2017 The Openstack-Helm Authors.
|
||||||
|
|
||||||
|
Licensed 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 and .Values.manifests.monitoring.prometheus.configmap_bin .Values.monitoring.prometheus.enabled }}
|
||||||
|
{{- $envAll := . }}
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: mysql-exporter-bin
|
||||||
|
data:
|
||||||
|
create-mysql-user.sh: |
|
||||||
|
{{ tuple "bin/_create-mysql-user.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
|
||||||
|
mysqld-exporter.sh: |
|
||||||
|
{{ tuple "bin/_mysqld-exporter.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
|
||||||
|
{{- end }}
|
@ -0,0 +1,88 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright 2017 The Openstack-Helm Authors.
|
||||||
|
|
||||||
|
Licensed 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 and .Values.manifests.monitoring.prometheus.deployment_exporter .Values.monitoring.prometheus.enabled }}
|
||||||
|
{{- $envAll := . }}
|
||||||
|
{{- $dependencies := .Values.dependencies.prometheus_mysql_exporter }}
|
||||||
|
|
||||||
|
{{- $serviceAccountName := "prometheus-mysql-exporter"}}
|
||||||
|
{{ tuple $envAll $dependencies $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
|
||||||
|
---
|
||||||
|
apiVersion: extensions/v1beta1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: prometheus-mysql-exporter
|
||||||
|
spec:
|
||||||
|
replicas: {{ .Values.pod.replicas.prometheus_mysql_exporter }}
|
||||||
|
{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
{{ tuple $envAll "prometheus_mysql_exporter" "exporter" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
|
||||||
|
namespace: {{ .Values.endpoints.prometheus_mysql_exporter.namespace }}
|
||||||
|
spec:
|
||||||
|
serviceAccountName: {{ $serviceAccountName }}
|
||||||
|
nodeSelector:
|
||||||
|
{{ .Values.labels.prometheus_mysql_exporter.node_selector_key }}: {{ .Values.labels.prometheus_mysql_exporter.node_selector_value }}
|
||||||
|
terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.prometheus_mysql_exporter.timeout | default "30" }}
|
||||||
|
initContainers:
|
||||||
|
{{ tuple $envAll $dependencies list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
|
||||||
|
containers:
|
||||||
|
- name: mysql-exporter
|
||||||
|
image: {{ .Values.images.tags.prometheus_mysql_exporter }}
|
||||||
|
imagePullPolicy: {{ .Values.images.pull_policy }}
|
||||||
|
{{ tuple $envAll $envAll.Values.pod.resources.prometheus_mysql_exporter | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
|
||||||
|
command:
|
||||||
|
- /tmp/mysqld-exporter.sh
|
||||||
|
- start
|
||||||
|
ports:
|
||||||
|
- name: metrics
|
||||||
|
containerPort: {{ .Values.network.prometheus_mysql_exporter.port }}
|
||||||
|
env:
|
||||||
|
- name: EXPORTER_USER
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: mysql-exporter-secrets
|
||||||
|
key: EXPORTER_USER
|
||||||
|
- name: EXPORTER_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: mysql-exporter-secrets
|
||||||
|
key: EXPORTER_PASSWORD
|
||||||
|
- name: DATA_SOURCE_NAME
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: mysql-exporter-secrets
|
||||||
|
key: DATA_SOURCE_NAME
|
||||||
|
volumeMounts:
|
||||||
|
- name: mysql-exporter-secrets
|
||||||
|
mountPath: /etc/mysql/mysql_user.cnf
|
||||||
|
subPath: mysql_user.cnf
|
||||||
|
readOnly: true
|
||||||
|
- name: mysql-exporter-bin
|
||||||
|
mountPath: /tmp/mysqld-exporter.sh
|
||||||
|
subPath: mysqld-exporter.sh
|
||||||
|
readOnly: true
|
||||||
|
volumes:
|
||||||
|
- name: mysql-exporter-secrets
|
||||||
|
secret:
|
||||||
|
secretName: mysql-exporter-secrets
|
||||||
|
defaultMode: 0444
|
||||||
|
- name: mysql-exporter-bin
|
||||||
|
configMap:
|
||||||
|
name: mysql-exporter-bin
|
||||||
|
defaultMode: 0555
|
||||||
|
{{- end }}
|
@ -0,0 +1,85 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright 2017 The Openstack-Helm Authors.
|
||||||
|
|
||||||
|
Licensed 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 and .Values.manifests.monitoring.prometheus.job_user_create .Values.monitoring.prometheus.enabled }}
|
||||||
|
{{- $envAll := . }}
|
||||||
|
{{- $dependencies := .Values.dependencies.prometheus_create_mysql_user }}
|
||||||
|
|
||||||
|
{{- $serviceAccountName := "exporter-create-sql-user" }}
|
||||||
|
{{ tuple $envAll $dependencies $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
|
||||||
|
---
|
||||||
|
apiVersion: batch/v1
|
||||||
|
kind: Job
|
||||||
|
metadata:
|
||||||
|
name: exporter-create-sql-user
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
{{ tuple $envAll "prometheus_mysql_exporter" "create-sql-user" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
|
||||||
|
spec:
|
||||||
|
serviceAccountName: {{ $serviceAccountName }}
|
||||||
|
restartPolicy: OnFailure
|
||||||
|
nodeSelector:
|
||||||
|
{{ .Values.labels.prometheus_mysql_exporter.node_selector_key }}: {{ .Values.labels.prometheus_mysql_exporter.node_selector_value }}
|
||||||
|
initContainers:
|
||||||
|
{{ tuple $envAll $dependencies list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
|
||||||
|
containers:
|
||||||
|
- name: exporter-create-sql-user
|
||||||
|
image: {{ .Values.images.tags.prometheus_create_mysql_user }}
|
||||||
|
imagePullPolicy: {{ .Values.images.pull_policy }}
|
||||||
|
{{ tuple $envAll $envAll.Values.pod.resources.jobs.prometheus_create_mysql_user | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
|
||||||
|
command:
|
||||||
|
- /tmp/create-mysql-user.sh
|
||||||
|
env:
|
||||||
|
- name: EXPORTER_USER
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: mysql-exporter-secrets
|
||||||
|
key: EXPORTER_USER
|
||||||
|
- name: EXPORTER_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: mysql-exporter-secrets
|
||||||
|
key: EXPORTER_PASSWORD
|
||||||
|
- name: MYSQL_SERVICE
|
||||||
|
value: {{ tuple "oslo_db" "internal" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
|
||||||
|
- name: MYSQL_ROOT_USER
|
||||||
|
value: {{ .Values.endpoints.oslo_db.auth.admin.username }}
|
||||||
|
- name: MYSQL_ROOT_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: mariadb-db-root-password
|
||||||
|
key: MYSQL_ROOT_PASSWORD
|
||||||
|
volumeMounts:
|
||||||
|
- name: mysql-exporter-bin
|
||||||
|
mountPath: /tmp/create-mysql-user.sh
|
||||||
|
subPath: create-mysql-user.sh
|
||||||
|
readOnly: true
|
||||||
|
- name: mariadb-secrets
|
||||||
|
mountPath: /etc/mysql/admin_user.cnf
|
||||||
|
subPath: admin_user.cnf
|
||||||
|
readOnly: true
|
||||||
|
volumes:
|
||||||
|
- name: mysql-exporter-bin
|
||||||
|
configMap:
|
||||||
|
name: mysql-exporter-bin
|
||||||
|
defaultMode: 0555
|
||||||
|
- name: mariadb-secrets
|
||||||
|
secret:
|
||||||
|
secretName: mariadb-secrets
|
||||||
|
defaultMode: 0444
|
||||||
|
{{- end }}
|
@ -0,0 +1,35 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright 2017 The Openstack-Helm Authors.
|
||||||
|
|
||||||
|
Licensed 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 and .Values.manifests.monitoring.prometheus.secret_etc .Values.monitoring.prometheus.enabled }}
|
||||||
|
{{- $envAll := . }}
|
||||||
|
|
||||||
|
{{- $exporter_user := .Values.endpoints.oslo_db.auth.exporter.username }}
|
||||||
|
{{- $exporter_password := .Values.endpoints.oslo_db.auth.exporter.password }}
|
||||||
|
{{- $db_host := tuple "oslo_db" "internal" "mysql" $envAll | include "helm-toolkit.endpoints.host_and_port_endpoint_uri_lookup" }}
|
||||||
|
{{- $data_source_name := printf "%s:%s@(%s)/" $exporter_user $exporter_password $db_host }}
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: mysql-exporter-secrets
|
||||||
|
type: Opaque
|
||||||
|
data:
|
||||||
|
DATA_SOURCE_NAME: {{ $data_source_name | b64enc }}
|
||||||
|
EXPORTER_USER: {{ .Values.endpoints.oslo_db.auth.exporter.username | b64enc }}
|
||||||
|
EXPORTER_PASSWORD: {{ .Values.endpoints.oslo_db.auth.exporter.password | b64enc }}
|
||||||
|
mysql_user.cnf: {{ tuple "secrets/_exporter_user.cnf.tpl" . | include "helm-toolkit.utils.template" | b64enc }}
|
||||||
|
{{- end }}
|
@ -0,0 +1,37 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright 2017 The Openstack-Helm Authors.
|
||||||
|
|
||||||
|
Licensed 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 and .Values.manifests.monitoring.prometheus.service_exporter .Values.monitoring.prometheus.enabled }}
|
||||||
|
{{- $envAll := . }}
|
||||||
|
{{- $prometheus_annotations := $envAll.Values.monitoring.prometheus.mysqld_exporter }}
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: {{ tuple "prometheus_mysql_exporter" "internal" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
|
||||||
|
labels:
|
||||||
|
{{ tuple $envAll "prometheus_mysql_exporter" "metrics" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
|
||||||
|
annotations:
|
||||||
|
{{- if .Values.monitoring.prometheus.enabled }}
|
||||||
|
{{ tuple $prometheus_annotations | include "helm-toolkit.snippets.prometheus_service_annotations" | indent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- name: metrics
|
||||||
|
port: {{ .Values.network.prometheus_mysql_exporter.port }}
|
||||||
|
selector:
|
||||||
|
{{ tuple $envAll "prometheus_mysql_exporter" "exporter" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
|
||||||
|
{{- end }}
|
@ -0,0 +1,21 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright 2017 The Openstack-Helm Authors.
|
||||||
|
|
||||||
|
Licensed 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.
|
||||||
|
*/}}
|
||||||
|
|
||||||
|
[client]
|
||||||
|
user = {{ .Values.endpoints.prometheus_mysql_exporter.auth.user.username }}
|
||||||
|
password = {{ .Values.endpoints.prometheus_mysql_exporter.auth.user.password }}
|
||||||
|
host = {{ tuple "oslo_db" "internal" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
|
||||||
|
port = {{ tuple "oslo_db" "internal" "mysql" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
|
@ -37,7 +37,7 @@ spec:
|
|||||||
affinity:
|
affinity:
|
||||||
{{ tuple $envAll "mariadb" "server" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }}
|
{{ tuple $envAll "mariadb" "server" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }}
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
{{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }}
|
{{ .Values.labels.server.node_selector_key }}: {{ .Values.labels.server.node_selector_value }}
|
||||||
initContainers:
|
initContainers:
|
||||||
{{ tuple $envAll $dependencies list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
|
{{ tuple $envAll $dependencies list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
|
||||||
{{- if .Values.volume.chown_on_start }}
|
{{- if .Values.volume.chown_on_start }}
|
||||||
|
@ -15,12 +15,19 @@
|
|||||||
images:
|
images:
|
||||||
tags:
|
tags:
|
||||||
mariadb: docker.io/mariadb:10.1.23
|
mariadb: docker.io/mariadb:10.1.23
|
||||||
|
prometheus_create_mysql_user: docker.io/mariadb:10.1.23
|
||||||
|
prometheus_mysql_exporter: docker.io/prom/mysqld-exporter:v0.10.0
|
||||||
|
prometheus_mysql_exporter_helm_tests: docker.io/kolla/ubuntu-source-heat-engine:3.0.3
|
||||||
dep_check: quay.io/stackanetes/kubernetes-entrypoint:v0.2.1
|
dep_check: quay.io/stackanetes/kubernetes-entrypoint:v0.2.1
|
||||||
pull_policy: IfNotPresent
|
pull_policy: IfNotPresent
|
||||||
|
|
||||||
labels:
|
labels:
|
||||||
node_selector_key: openstack-control-plane
|
server:
|
||||||
node_selector_value: enabled
|
node_selector_key: openstack-control-plane
|
||||||
|
node_selector_value: enabled
|
||||||
|
prometheus_mysql_exporter:
|
||||||
|
node_selector_key: openstack-control-plane
|
||||||
|
node_selector_value: enabled
|
||||||
|
|
||||||
pod:
|
pod:
|
||||||
affinity:
|
affinity:
|
||||||
@ -31,12 +38,30 @@ pod:
|
|||||||
default: kubernetes.io/hostname
|
default: kubernetes.io/hostname
|
||||||
replicas:
|
replicas:
|
||||||
server: 3
|
server: 3
|
||||||
|
prometheus_mysql_exporter: 1
|
||||||
lifecycle:
|
lifecycle:
|
||||||
|
upgrades:
|
||||||
|
deployments:
|
||||||
|
revision_history: 3
|
||||||
|
pod_replacement_strategy: RollingUpdate
|
||||||
|
rolling_update:
|
||||||
|
max_unavailable: 1
|
||||||
|
max_surge: 3
|
||||||
|
termination_grace_period:
|
||||||
|
prometheus_mysql_exporter:
|
||||||
|
timeout: 30
|
||||||
disruption_budget:
|
disruption_budget:
|
||||||
mariadb:
|
mariadb:
|
||||||
min_available: 0
|
min_available: 0
|
||||||
resources:
|
resources:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
prometheus_mysql_exporter:
|
||||||
|
limits:
|
||||||
|
memory: "1024Mi"
|
||||||
|
cpu: "2000m"
|
||||||
|
requests:
|
||||||
|
memory: "128Mi"
|
||||||
|
cpu: "500m"
|
||||||
server:
|
server:
|
||||||
requests:
|
requests:
|
||||||
memory: "128Mi"
|
memory: "128Mi"
|
||||||
@ -44,11 +69,42 @@ pod:
|
|||||||
limits:
|
limits:
|
||||||
memory: "1024Mi"
|
memory: "1024Mi"
|
||||||
cpu: "2000m"
|
cpu: "2000m"
|
||||||
|
jobs:
|
||||||
|
tests:
|
||||||
|
limits:
|
||||||
|
memory: "1024Mi"
|
||||||
|
cpu: "2000m"
|
||||||
|
requests:
|
||||||
|
memory: "128Mi"
|
||||||
|
cpu: "100m"
|
||||||
|
prometheus_create_mysql_user:
|
||||||
|
limits:
|
||||||
|
memory: "1024Mi"
|
||||||
|
cpu: "2000m"
|
||||||
|
requests:
|
||||||
|
memory: "128Mi"
|
||||||
|
cpu: "100m"
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
mariadb:
|
mariadb:
|
||||||
jobs: null
|
jobs: null
|
||||||
services: null
|
services: null
|
||||||
|
prometheus_mysql_exporter:
|
||||||
|
services:
|
||||||
|
- service: oslo_db
|
||||||
|
endpoint: internal
|
||||||
|
jobs:
|
||||||
|
- exporter-create-sql-user
|
||||||
|
prometheus_mysql_exporter_tests:
|
||||||
|
services:
|
||||||
|
- service: prometheus_mysql_exporter
|
||||||
|
endpoint: internal
|
||||||
|
- service: monitoring
|
||||||
|
endpoint: internal
|
||||||
|
prometheus_create_mysql_user:
|
||||||
|
services:
|
||||||
|
- service: oslo_db
|
||||||
|
endpoint: internal
|
||||||
|
|
||||||
force_bootstrap: false
|
force_bootstrap: false
|
||||||
|
|
||||||
@ -65,16 +121,63 @@ database:
|
|||||||
# [mysqld]
|
# [mysqld]
|
||||||
# wsrep_slave_threads=1
|
# wsrep_slave_threads=1
|
||||||
|
|
||||||
|
monitoring:
|
||||||
|
prometheus:
|
||||||
|
enabled: false
|
||||||
|
mysqld_exporter:
|
||||||
|
scrape: true
|
||||||
|
|
||||||
|
network:
|
||||||
|
prometheus_mysql_exporter:
|
||||||
|
port: 9104
|
||||||
|
|
||||||
# typically overriden by environmental
|
# typically overriden by environmental
|
||||||
# values, but should include all endpoints
|
# values, but should include all endpoints
|
||||||
# required by this chart
|
# required by this chart
|
||||||
endpoints:
|
endpoints:
|
||||||
cluster_domain_suffix: cluster.local
|
cluster_domain_suffix: cluster.local
|
||||||
|
monitoring:
|
||||||
|
name: prometheus
|
||||||
|
namespace: null
|
||||||
|
hosts:
|
||||||
|
default: prom-metrics
|
||||||
|
public: prometheus
|
||||||
|
host_fqdn_override:
|
||||||
|
default: null
|
||||||
|
path:
|
||||||
|
default: null
|
||||||
|
scheme:
|
||||||
|
default: 'http'
|
||||||
|
port:
|
||||||
|
api:
|
||||||
|
default: 9090
|
||||||
|
public: 80
|
||||||
|
prometheus_mysql_exporter:
|
||||||
|
namespace: null
|
||||||
|
auth:
|
||||||
|
user:
|
||||||
|
username: exporter
|
||||||
|
password: password
|
||||||
|
hosts:
|
||||||
|
default: mysql-exporter
|
||||||
|
host_fqdn_override:
|
||||||
|
default: null
|
||||||
|
path:
|
||||||
|
default: /metrics
|
||||||
|
scheme:
|
||||||
|
default: 'http'
|
||||||
|
port:
|
||||||
|
metrics:
|
||||||
|
default: 9104
|
||||||
oslo_db:
|
oslo_db:
|
||||||
|
namespace: null
|
||||||
auth:
|
auth:
|
||||||
admin:
|
admin:
|
||||||
username: root
|
username: root
|
||||||
password: password
|
password: password
|
||||||
|
exporter:
|
||||||
|
username: exporter
|
||||||
|
password: password
|
||||||
hosts:
|
hosts:
|
||||||
default: mariadb
|
default: mariadb
|
||||||
discovery: mariadb-discovery
|
discovery: mariadb-discovery
|
||||||
@ -92,6 +195,13 @@ manifests:
|
|||||||
configmap_bin: true
|
configmap_bin: true
|
||||||
configmap_etc: true
|
configmap_etc: true
|
||||||
pdb_server: true
|
pdb_server: true
|
||||||
|
monitoring:
|
||||||
|
prometheus:
|
||||||
|
configmap_bin: true
|
||||||
|
deployment_exporter: true
|
||||||
|
job_user_create: true
|
||||||
|
secret_etc: true
|
||||||
|
service_exporter: true
|
||||||
secret_db: true
|
secret_db: true
|
||||||
secret_etc: true
|
secret_etc: true
|
||||||
service_discovery: true
|
service_discovery: true
|
||||||
|
@ -0,0 +1,66 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright 2017 The Openstack-Helm Authors.
|
||||||
|
|
||||||
|
Licensed 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 and .Values.manifests.monitoring.prometheus.deployment_exporter .Values.monitoring.prometheus.enabled }}
|
||||||
|
{{- $envAll := . }}
|
||||||
|
{{- $dependencies := .Values.dependencies.prometheus_rabbitmq_exporter }}
|
||||||
|
|
||||||
|
{{- $rcControllerName := printf "%s-%s" $envAll.Release.Name "rabbitmq-exporter" }}
|
||||||
|
{{ tuple $envAll $dependencies $rcControllerName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
|
||||||
|
---
|
||||||
|
apiVersion: extensions/v1beta1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: {{ $rcControllerName | quote }}
|
||||||
|
spec:
|
||||||
|
replicas: {{ .Values.pod.replicas.prometheus_rabbitmq_exporter }}
|
||||||
|
{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
{{ tuple $envAll "prometheus_rabbitmq_exporter" "exporter" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
|
||||||
|
namespace: {{ .Values.endpoints.prometheus_rabbitmq_exporter.namespace }}
|
||||||
|
spec:
|
||||||
|
serviceAccountName: {{ $rcControllerName | quote }}
|
||||||
|
nodeSelector:
|
||||||
|
{{ .Values.labels.prometheus_rabbitmq_exporter.node_selector_key }}: {{ .Values.labels.prometheus_rabbitmq_exporter.node_selector_value }}
|
||||||
|
terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.prometheus_rabbitmq_exporter.timeout | default "30" }}
|
||||||
|
initContainers:
|
||||||
|
{{ tuple $envAll $dependencies list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
|
||||||
|
containers:
|
||||||
|
- name: rabbitmq-exporter
|
||||||
|
image: {{ .Values.images.tags.prometheus_rabbitmq_exporter }}
|
||||||
|
imagePullPolicy: {{ .Values.images.pull_policy }}
|
||||||
|
{{ tuple $envAll $envAll.Values.pod.resources.prometheus_rabbitmq_exporter | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
|
||||||
|
ports:
|
||||||
|
- name: metrics
|
||||||
|
containerPort: {{ .Values.network.prometheus_rabbitmq_exporter.port }}
|
||||||
|
env:
|
||||||
|
- name: RABBIT_URL
|
||||||
|
value: http://{{ tuple "oslo_messaging" "internal" . | include "helm-toolkit.endpoints.hostname_fqdn_endpoint_lookup" }}:15672
|
||||||
|
- name: RABBIT_USER
|
||||||
|
value: {{ .Values.endpoints.oslo_messaging.auth.user.username | quote }}
|
||||||
|
- name: RABBIT_PASSWORD
|
||||||
|
value: {{ .Values.endpoints.oslo_messaging.auth.user.password | quote }}
|
||||||
|
- name: RABBIT_CAPABILITIES
|
||||||
|
value: {{ tuple .Values.conf.prometheus_exporter.capabilities $envAll | include "helm-toolkit.utils.joinListWithComma" | quote }}
|
||||||
|
- name: PUBLISH_PORT
|
||||||
|
value: {{ .Values.network.prometheus_rabbitmq_exporter.port | quote }}
|
||||||
|
- name: LOG_LEVEL
|
||||||
|
value: {{ .Values.conf.prometheus_exporter.log_level | quote }}
|
||||||
|
- name: SKIPVERIFY
|
||||||
|
value: {{ .Values.conf.prometheus_exporter.skipverify | quote }}
|
||||||
|
{{- end }}
|
@ -0,0 +1,37 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright 2017 The Openstack-Helm Authors.
|
||||||
|
|
||||||
|
Licensed 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 and .Values.manifests.monitoring.prometheus.service_exporter .Values.monitoring.prometheus.enabled }}
|
||||||
|
{{- $envAll := . }}
|
||||||
|
{{- $prometheus_annotations := $envAll.Values.monitoring.prometheus.rabbitmq_exporter }}
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: {{ tuple "prometheus_rabbitmq_exporter" "internal" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
|
||||||
|
labels:
|
||||||
|
{{ tuple $envAll "prometheus_rabbitmq_exporter" "metrics" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
|
||||||
|
annotations:
|
||||||
|
{{- if .Values.monitoring.prometheus.enabled }}
|
||||||
|
{{ tuple $prometheus_annotations | include "helm-toolkit.snippets.prometheus_service_annotations" | indent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
- name: metrics
|
||||||
|
port: {{ .Values.network.prometheus_rabbitmq_exporter.port }}
|
||||||
|
selector:
|
||||||
|
{{ tuple $envAll "prometheus_rabbitmq_exporter" "exporter" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
|
||||||
|
{{- end }}
|
@ -72,7 +72,7 @@ spec:
|
|||||||
affinity:
|
affinity:
|
||||||
{{ tuple $envAll "rabbitmq" "server" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }}
|
{{ tuple $envAll "rabbitmq" "server" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }}
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
{{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }}
|
{{ .Values.labels.server.node_selector_key }}: {{ .Values.labels.server.node_selector_value }}
|
||||||
initContainers:
|
initContainers:
|
||||||
{{ tuple $envAll $dependencies list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 9 }}
|
{{ tuple $envAll $dependencies list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 9 }}
|
||||||
containers:
|
containers:
|
||||||
|
@ -18,11 +18,17 @@
|
|||||||
# name: value
|
# name: value
|
||||||
|
|
||||||
labels:
|
labels:
|
||||||
node_selector_key: openstack-control-plane
|
server:
|
||||||
node_selector_value: enabled
|
node_selector_key: openstack-control-plane
|
||||||
|
node_selector_value: enabled
|
||||||
|
prometheus_rabbitmq_exporter:
|
||||||
|
node_selector_key: openstack-control-plane
|
||||||
|
node_selector_value: enabled
|
||||||
|
|
||||||
images:
|
images:
|
||||||
tags:
|
tags:
|
||||||
|
prometheus_rabbitmq_exporter: docker.io/kbudde/rabbitmq-exporter:v0.21.0
|
||||||
|
prometheus_rabbitmq_exporter_helm_tests: docker.io/kolla/ubuntu-source-heat-engine:3.0.3
|
||||||
rabbitmq: docker.io/rabbitmq:3.7
|
rabbitmq: docker.io/rabbitmq:3.7
|
||||||
dep_check: quay.io/stackanetes/kubernetes-entrypoint:v0.2.1
|
dep_check: quay.io/stackanetes/kubernetes-entrypoint:v0.2.1
|
||||||
pull_policy: "IfNotPresent"
|
pull_policy: "IfNotPresent"
|
||||||
@ -36,8 +42,30 @@ pod:
|
|||||||
default: kubernetes.io/hostname
|
default: kubernetes.io/hostname
|
||||||
replicas:
|
replicas:
|
||||||
server: 3
|
server: 3
|
||||||
|
prometheus_rabbitmq_exporter: 1
|
||||||
|
lifecycle:
|
||||||
|
upgrades:
|
||||||
|
deployments:
|
||||||
|
revision_history: 3
|
||||||
|
pod_replacement_strategy: RollingUpdate
|
||||||
|
rolling_update:
|
||||||
|
max_unavailable: 1
|
||||||
|
max_surge: 3
|
||||||
|
termination_grace_period:
|
||||||
|
prometheus_rabbitmq_exporter:
|
||||||
|
timeout: 30
|
||||||
|
disruption_budget:
|
||||||
|
mariadb:
|
||||||
|
min_available: 0
|
||||||
resources:
|
resources:
|
||||||
enabled: false
|
enabled: false
|
||||||
|
prometheus_rabbitmq_exporter:
|
||||||
|
limits:
|
||||||
|
memory: "1024Mi"
|
||||||
|
cpu: "2000m"
|
||||||
|
requests:
|
||||||
|
memory: "128Mi"
|
||||||
|
cpu: "500m"
|
||||||
server:
|
server:
|
||||||
limits:
|
limits:
|
||||||
memory: "128Mi"
|
memory: "128Mi"
|
||||||
@ -45,11 +73,24 @@ pod:
|
|||||||
requests:
|
requests:
|
||||||
memory: "128Mi"
|
memory: "128Mi"
|
||||||
cpu: "500m"
|
cpu: "500m"
|
||||||
|
jobs:
|
||||||
|
tests:
|
||||||
|
limits:
|
||||||
|
memory: "1024Mi"
|
||||||
|
cpu: "2000m"
|
||||||
|
requests:
|
||||||
|
memory: "128Mi"
|
||||||
|
cpu: "100m"
|
||||||
|
|
||||||
conf:
|
conf:
|
||||||
enabled_plugins:
|
enabled_plugins:
|
||||||
- rabbitmq_management
|
- rabbitmq_management
|
||||||
- rabbitmq_peer_discovery_k8s
|
- rabbitmq_peer_discovery_k8s
|
||||||
|
prometheus_exporter:
|
||||||
|
capabilities:
|
||||||
|
- no_sort
|
||||||
|
log_level: info
|
||||||
|
skipverify: 1
|
||||||
rabbitmq:
|
rabbitmq:
|
||||||
listeners:
|
listeners:
|
||||||
tcp:
|
tcp:
|
||||||
@ -69,12 +110,48 @@ conf:
|
|||||||
dependencies:
|
dependencies:
|
||||||
rabbitmq:
|
rabbitmq:
|
||||||
jobs: null
|
jobs: null
|
||||||
|
prometheus_rabbitmq_exporter:
|
||||||
|
services:
|
||||||
|
- service: oslo_messaging
|
||||||
|
endpoint: internal
|
||||||
|
prometheus_rabbitmq_exporter_tests:
|
||||||
|
services:
|
||||||
|
- service: prometheus_rabbitmq_exporter
|
||||||
|
endpoint: internal
|
||||||
|
- service: monitoring
|
||||||
|
endpoint: internal
|
||||||
|
|
||||||
|
monitoring:
|
||||||
|
prometheus:
|
||||||
|
enabled: false
|
||||||
|
rabbitmq_exporter:
|
||||||
|
scrape: true
|
||||||
|
|
||||||
|
network:
|
||||||
|
prometheus_rabbitmq_exporter:
|
||||||
|
port: 9095
|
||||||
|
|
||||||
# typically overriden by environmental
|
# typically overriden by environmental
|
||||||
# values, but should include all endpoints
|
# values, but should include all endpoints
|
||||||
# required by this chart
|
# required by this chart
|
||||||
endpoints:
|
endpoints:
|
||||||
cluster_domain_suffix: cluster.local
|
cluster_domain_suffix: cluster.local
|
||||||
|
monitoring:
|
||||||
|
name: prometheus
|
||||||
|
namespace: null
|
||||||
|
hosts:
|
||||||
|
default: prom-metrics
|
||||||
|
public: prometheus
|
||||||
|
host_fqdn_override:
|
||||||
|
default: null
|
||||||
|
path:
|
||||||
|
default: null
|
||||||
|
scheme:
|
||||||
|
default: 'http'
|
||||||
|
port:
|
||||||
|
api:
|
||||||
|
default: 9090
|
||||||
|
public: 80
|
||||||
oslo_messaging:
|
oslo_messaging:
|
||||||
auth:
|
auth:
|
||||||
erlang_cookie: openstack-cookie
|
erlang_cookie: openstack-cookie
|
||||||
@ -92,9 +169,27 @@ endpoints:
|
|||||||
default: 5672
|
default: 5672
|
||||||
http:
|
http:
|
||||||
default: 15672
|
default: 15672
|
||||||
|
prometheus_rabbitmq_exporter:
|
||||||
|
namespace: null
|
||||||
|
hosts:
|
||||||
|
default: rabbitmq-exporter
|
||||||
|
host_fqdn_override:
|
||||||
|
default: null
|
||||||
|
path:
|
||||||
|
default: /metrics
|
||||||
|
scheme:
|
||||||
|
default: 'http'
|
||||||
|
port:
|
||||||
|
metrics:
|
||||||
|
default: 9095
|
||||||
|
|
||||||
manifests:
|
manifests:
|
||||||
configmap_bin: true
|
configmap_bin: true
|
||||||
configmap_etc: true
|
configmap_etc: true
|
||||||
|
monitoring:
|
||||||
|
prometheus:
|
||||||
|
configmap_bin: true
|
||||||
|
deployment_exporter: true
|
||||||
|
service_exporter: true
|
||||||
service: true
|
service: true
|
||||||
statefulset: true
|
statefulset: true
|
||||||
|
Loading…
Reference in New Issue
Block a user