github.com/verrazzano/verrazzano@v1.7.0/platform-operator/thirdparty/charts/thanos/templates/storegateway/pdb-sharded.yaml (about) 1 {{- if and .Values.storegateway.enabled .Values.storegateway.pdb.create .Values.storegateway.sharded.enabled }} 2 3 {{- $shards := int 0 }} 4 {{- if .Values.storegateway.sharded.hashPartitioning.shards }} 5 {{- $shards = int .Values.storegateway.sharded.hashPartitioning.shards }} 6 {{- else }} 7 {{- $shards = len .Values.storegateway.sharded.timePartitioning }} 8 {{- end }} 9 10 {{- range $index, $_ := until $shards }} 11 apiVersion: {{ include "common.capabilities.policy.apiVersion" $ }} 12 kind: PodDisruptionBudget 13 metadata: 14 name: {{ printf "%s-storegateway-%s" (include "common.names.fullname" $) (toString $index) | trunc 63 | trimSuffix "-" }} 15 namespace: {{ $.Release.Namespace | quote }} 16 labels: {{- include "common.labels.standard" $ | nindent 4 }} 17 app.kubernetes.io/component: storegateway 18 shard: {{ $index | quote }} 19 {{- if $.Values.commonLabels }} 20 {{- include "common.tplvalues.render" ( dict "value" $.Values.commonLabels "context" $ ) | nindent 4 }} 21 {{- end }} 22 {{- if $.Values.commonAnnotations }} 23 annotations: {{- include "common.tplvalues.render" ( dict "value" $.Values.commonAnnotations "context" $ ) | nindent 4 }} 24 {{- end }} 25 spec: 26 {{- if $.Values.storegateway.pdb.minAvailable }} 27 minAvailable: {{ $.Values.storegateway.pdb.minAvailable }} 28 {{- end }} 29 {{- if $.Values.storegateway.pdb.maxUnavailable }} 30 maxUnavailable: {{ $.Values.storegateway.pdb.maxUnavailable }} 31 {{- end }} 32 selector: 33 matchLabels: {{- include "common.labels.matchLabels" $ | nindent 6 }} 34 app.kubernetes.io/component: storegateway 35 shard: {{ $index | quote }} 36 --- 37 {{- end }} 38 {{- end }}