MariaDB: Add network policy template for mysql exporter
This adds the network policy template and overrides for the mysql prometheus exporter. Change-Id: I83b526d11fe25f45b02a7e797b785b8ad59c7848
This commit is contained in:
parent
c77dc230f4
commit
a63f3b3662
@ -25,17 +25,17 @@ kind: Deployment
|
|||||||
metadata:
|
metadata:
|
||||||
name: prometheus-mysql-exporter
|
name: prometheus-mysql-exporter
|
||||||
labels:
|
labels:
|
||||||
{{ tuple $envAll "prometheus_mysql_exporter" "exporter" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
|
{{ tuple $envAll "prometheus-mysql-exporter" "exporter" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
|
||||||
spec:
|
spec:
|
||||||
replicas: {{ .Values.pod.replicas.prometheus_mysql_exporter }}
|
replicas: {{ .Values.pod.replicas.prometheus_mysql_exporter }}
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
{{ tuple $envAll "prometheus_mysql_exporter" "exporter" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }}
|
{{ tuple $envAll "prometheus-mysql-exporter" "exporter" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }}
|
||||||
{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }}
|
{{ tuple $envAll | include "helm-toolkit.snippets.kubernetes_upgrades_deployment" | indent 2 }}
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
{{ tuple $envAll "prometheus_mysql_exporter" "exporter" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
|
{{ tuple $envAll "prometheus-mysql-exporter" "exporter" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
|
||||||
namespace: {{ .Values.endpoints.prometheus_mysql_exporter.namespace }}
|
namespace: {{ .Values.endpoints.prometheus_mysql_exporter.namespace }}
|
||||||
spec:
|
spec:
|
||||||
{{ dict "envAll" $envAll "application" "mysql_exporter" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
|
{{ dict "envAll" $envAll "application" "mysql_exporter" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
|
||||||
|
@ -29,7 +29,7 @@ spec:
|
|||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
{{ tuple $envAll "prometheus_mysql_exporter" "create-sql-user" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
|
{{ tuple $envAll "prometheus-mysql-exporter" "create-sql-user" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
|
||||||
spec:
|
spec:
|
||||||
shareProcessNamespace: true
|
shareProcessNamespace: true
|
||||||
serviceAccountName: {{ $serviceAccountName }}
|
serviceAccountName: {{ $serviceAccountName }}
|
||||||
|
@ -0,0 +1,20 @@
|
|||||||
|
{{/*
|
||||||
|
Copyright 2019 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.network_policy_exporter .Values.monitoring.prometheus.enabled -}}
|
||||||
|
{{- $netpol_opts := dict "envAll" . "name" "application" "label" "prometheus-mysql-exporter" -}}
|
||||||
|
{{ $netpol_opts | include "helm-toolkit.manifests.kubernetes_network_policy" }}
|
||||||
|
{{- end -}}
|
@ -23,7 +23,7 @@ kind: Service
|
|||||||
metadata:
|
metadata:
|
||||||
name: {{ tuple "prometheus_mysql_exporter" "internal" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
|
name: {{ tuple "prometheus_mysql_exporter" "internal" . | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
|
||||||
labels:
|
labels:
|
||||||
{{ tuple $envAll "prometheus_mysql_exporter" "metrics" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
|
{{ tuple $envAll "prometheus-mysql-exporter" "metrics" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
|
||||||
annotations:
|
annotations:
|
||||||
{{- if .Values.monitoring.prometheus.enabled }}
|
{{- if .Values.monitoring.prometheus.enabled }}
|
||||||
{{ tuple $prometheus_annotations | include "helm-toolkit.snippets.prometheus_service_annotations" | indent 4 }}
|
{{ tuple $prometheus_annotations | include "helm-toolkit.snippets.prometheus_service_annotations" | indent 4 }}
|
||||||
@ -33,5 +33,5 @@ spec:
|
|||||||
- name: metrics
|
- name: metrics
|
||||||
port: {{ tuple "prometheus_mysql_exporter" "internal" "metrics" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
|
port: {{ tuple "prometheus_mysql_exporter" "internal" "metrics" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
|
||||||
selector:
|
selector:
|
||||||
{{ tuple $envAll "prometheus_mysql_exporter" "exporter" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
|
{{ tuple $envAll "prometheus-mysql-exporter" "exporter" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
@ -392,6 +392,7 @@ manifests:
|
|||||||
job_user_create: true
|
job_user_create: true
|
||||||
secret_etc: true
|
secret_etc: true
|
||||||
service_exporter: true
|
service_exporter: true
|
||||||
|
network_policy_exporter: false
|
||||||
pdb_server: true
|
pdb_server: true
|
||||||
network_policy: false
|
network_policy: false
|
||||||
pod_test: true
|
pod_test: true
|
||||||
|
@ -22,7 +22,19 @@ make mariadb
|
|||||||
tee /tmp/mariadb.yaml <<EOF
|
tee /tmp/mariadb.yaml <<EOF
|
||||||
manifests:
|
manifests:
|
||||||
network_policy: true
|
network_policy: true
|
||||||
|
monitoring:
|
||||||
|
prometheus:
|
||||||
|
network_policy_exporter: true
|
||||||
network_policy:
|
network_policy:
|
||||||
|
prometheus-mysql-exporter:
|
||||||
|
ingress:
|
||||||
|
- from:
|
||||||
|
- podSelector:
|
||||||
|
matchLabels:
|
||||||
|
application: prometheus
|
||||||
|
ports:
|
||||||
|
- protocol: TCP
|
||||||
|
port: 9104
|
||||||
mariadb:
|
mariadb:
|
||||||
ingress:
|
ingress:
|
||||||
- from:
|
- from:
|
||||||
@ -32,6 +44,9 @@ network_policy:
|
|||||||
- podSelector:
|
- podSelector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
application: mariadb
|
application: mariadb
|
||||||
|
- podSelector:
|
||||||
|
matchLabels:
|
||||||
|
application: prometheus-mysql-exporter
|
||||||
ports:
|
ports:
|
||||||
- protocol: TCP
|
- protocol: TCP
|
||||||
port: 3306
|
port: 3306
|
||||||
|
Loading…
Reference in New Issue
Block a user