From f5beef0ad5326b7d8f8f30adbc27be5bf012c00b Mon Sep 17 00:00:00 2001 From: v_connliu Date: Mon, 21 Feb 2022 17:03:03 +0800 Subject: [PATCH] mysql-cluster custom service --- CHANGELOG.md | 1 + .../mysql-cluster/templates/service.yml | 25 +++++++++++++++++++ deploy/charts/mysql-cluster/values.yaml | 11 ++++++++ 3 files changed, 37 insertions(+) create mode 100644 deploy/charts/mysql-cluster/templates/service.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 76d931ecf..06c44993a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] ### Added + * Allow using custom service in `mysql-cluster` chart. ### Changed ### Removed ### Fixed diff --git a/deploy/charts/mysql-cluster/templates/service.yml b/deploy/charts/mysql-cluster/templates/service.yml new file mode 100644 index 000000000..0abba245c --- /dev/null +++ b/deploy/charts/mysql-cluster/templates/service.yml @@ -0,0 +1,25 @@ +{{- if .Values.service }} +apiVersion: v1 +kind: List +items: +{{- range $key, $value := .Values.service }} +- apiVersion: v1 + kind: Service + metadata: + labels: + mysql.presslabs.org/cluster: {{ include "mysql-cluster.clusterName" $ }} + {{- with $value.labels }} + {{- toYaml . | nindent 6 }} + {{- end }} + name: {{ $value.name }} + spec: + ports: {{- toYaml $value.ports | nindent 4 }} + selector: + mysql.presslabs.org/cluster: {{ include "mysql-cluster.clusterName" $ }} + {{- with $value.selector }} + {{- toYaml . | nindent 6 }} + {{- end }} + type: {{ $value.type }} +{{- end }} +{{- end }} + diff --git a/deploy/charts/mysql-cluster/values.yaml b/deploy/charts/mysql-cluster/values.yaml index 2abc3d0a4..026f3b43c 100644 --- a/deploy/charts/mysql-cluster/values.yaml +++ b/deploy/charts/mysql-cluster/values.yaml @@ -22,6 +22,17 @@ podSpec: mysqlConf: volumeSpec: +service: + # - name: test-prometheus + # labels: {} + # ports: + # - name: prometheus + # port: 9125 + # protocol: TCP + # targetPort: 9125 + # selector: {} + # type: ClusterIP + serverIDOffset: initBucketURL: