MariaDB: Clean up values file and exporter start script

This PS cleans up the default values file, and also allows some
aspects of the mysql exporter's operation to be configured.

Change-Id: I577e3237ca0bfe3665e7a57cf2a9364baea7c24a
Signed-off-by: Pete Birley <pete@port.direct>
This commit is contained in:
Pete Birley 2019-04-06 15:08:27 -04:00 committed by Pete Birley
parent 1a81952929
commit 75b823e875
5 changed files with 22 additions and 28 deletions

View File

@ -14,4 +14,4 @@ See the License for the specific language governing permissions and
limitations under the License.
*/}}
{{ .Values.database.config_override }}
{{ .Values.conf.database.config_override }}

View File

@ -17,14 +17,8 @@ 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
exec /bin/mysqld_exporter \
-config.my-cnf=/etc/mysql/mysql_user.cnf \
-web.listen-address="${POD_IP}:${LISTEN_PORT}" \
-web.telemetry-path="$TELEMETRY_PATH"

View File

@ -54,10 +54,9 @@ spec:
{{ 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 }}
containerPort: {{ tuple "prometheus_mysql_exporter" "internal" "metrics" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
env:
- name: EXPORTER_USER
valueFrom:
@ -74,6 +73,14 @@ spec:
secretKeyRef:
name: mysql-exporter-secrets
key: DATA_SOURCE_NAME
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: LISTEN_PORT
value: {{ tuple "prometheus_mysql_exporter" "internal" "metrics" . | include "helm-toolkit.endpoints.endpoint_port_lookup" | quote }}
- name: TELEMETRY_PATH
value: {{ tuple "prometheus_mysql_exporter" "internal" "metrics" . | include "helm-toolkit.endpoints.keystone_endpoint_path_lookup" | quote }}
volumeMounts:
- name: mysql-exporter-secrets
mountPath: /etc/mysql/mysql_user.cnf

View File

@ -31,7 +31,7 @@ metadata:
spec:
ports:
- name: metrics
port: {{ .Values.network.prometheus_mysql_exporter.port }}
port: {{ tuple "prometheus_mysql_exporter" "internal" "metrics" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}
selector:
{{ tuple $envAll "prometheus_mysql_exporter" "exporter" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
{{- end }}

View File

@ -226,8 +226,6 @@ dependencies:
- endpoint: internal
service: oslo_db
force_bootstrap: false
volume:
chown_on_start: true
enabled: true
@ -271,24 +269,19 @@ conf:
--single-transaction --quick --skip-opt
--add-drop-database --add-drop-table --databases
days_of_backup_to_keep: 3
database:
config_override: null
# Any configuration here will override the base config.
# config_override: |-
# [mysqld]
# wsrep_slave_threads=1
database:
config_override: null
# Any configuration here will override the base config.
# config_override: |-
# [mysqld]
# wsrep_slave_threads=1
monitoring:
prometheus:
enabled: false
enabled: true
mysqld_exporter:
scrape: true
network:
prometheus_mysql_exporter:
port: 9104
# typically overridden by environmental
# values, but should include all endpoints
# required by this chart