diff --git a/helm/vitess/templates/_etcd.tpl b/helm/vitess/templates/_etcd.tpl index b30ce7c09c9..ad701cc6123 100644 --- a/helm/vitess/templates/_etcd.tpl +++ b/helm/vitess/templates/_etcd.tpl @@ -7,6 +7,7 @@ {{- $replicas := index . 1 -}} {{- $version := index . 2 -}} {{- $resources := index . 3 }} +{{- $clusterWide := index . 4 }} ################################### # EtcdCluster @@ -15,6 +16,12 @@ apiVersion: "etcd.database.coreos.com/v1beta2" kind: "EtcdCluster" metadata: name: "etcd-{{ $name }}" + ## Adding this annotation make this cluster managed by clusterwide operators + ## namespaced operators ignore it + annotations: + {{ if $clusterWide }} + etcd.database.coreos.com/scope: clusterwide + {{ end }} spec: size: {{ $replicas }} version: {{ $version | quote }} diff --git a/helm/vitess/templates/vitess.yaml b/helm/vitess/templates/vitess.yaml index 67afbd43fc7..7c3d36aac25 100644 --- a/helm/vitess/templates/vitess.yaml +++ b/helm/vitess/templates/vitess.yaml @@ -29,8 +29,9 @@ {{- $replicas := $.Values.topology.globalCell.replicas | default $.Values.etcd.replicas -}} {{- $version := $.Values.topology.globalCell.version | default $.Values.etcd.version -}} {{- $resources := $.Values.topology.globalCell.resources | default $.Values.etcd.resources -}} +{{- $clusterWide := $.Values.topology.globalCell.resources | default $.Values.etcd.clusterWide -}} -{{ include "etcd" (tuple "global" $replicas $version $resources) }} +{{ include "etcd" (tuple "global" $replicas $version $resources $clusterWide) }} # Create requested resources in each cell. {{ range $cell := $.Values.topology.cells }} @@ -41,8 +42,9 @@ {{- $replicas := $cell.etcd.replicas | default $.Values.etcd.replicas -}} {{- $version := $cell.etcd.version | default $.Values.etcd.version -}} {{- $resources := $cell.etcd.resources | default $.Values.etcd.resources -}} +{{- $clusterWide := $cell.etcd.clusterWide | default $.Values.etcd.clusterWide -}} -{{ include "etcd" (tuple $cellClean $replicas $version $resources) }} +{{ include "etcd" (tuple $cellClean $replicas $version $resources $clusterWide) }} --- # create one controller per cell {{ include "vtctld" (tuple $.Values.topology $cell $.Values.vtctld $.Release.Namespace $.Values.config) }} diff --git a/helm/vitess/values.yaml b/helm/vitess/values.yaml index c4e5563a464..9ad16ad0825 100644 --- a/helm/vitess/values.yaml +++ b/helm/vitess/values.yaml @@ -173,6 +173,9 @@ etcd: requests: cpu: 200m memory: 100Mi + # If clusterWide is set to true, will add an annotation to EtcdCluster + # to make this cluster managed by clusterwide operators + # clusterWide: true # Default values for vtctld resources defined in 'topology' vtctld: