Use podManagementPolicy OrderedReady for Broker sts when Functions are enabled (#474)
* Use podManagementPolicy OrderedReady for Broker sts when Functions are enabled * Don't change podManagementPolicy when the sts already exists * Fix template issue * Fix apiVersion
This commit is contained in:
parent
9929b80b3c
commit
fdec9c69ef
@ -21,8 +21,10 @@
|
|||||||
apiVersion: apps/v1
|
apiVersion: apps/v1
|
||||||
kind: StatefulSet
|
kind: StatefulSet
|
||||||
metadata:
|
metadata:
|
||||||
name: "{{ template "pulsar.fullname" . }}-{{ .Values.broker.component }}"
|
{{- $stsName := printf "%s-%s" (include "pulsar.fullname" .) .Values.broker.component }}
|
||||||
namespace: {{ template "pulsar.namespace" . }}
|
name: {{ $stsName | quote }}
|
||||||
|
{{- $namespace := include "pulsar.namespace" . }}
|
||||||
|
namespace: {{ $namespace | quote }}
|
||||||
labels:
|
labels:
|
||||||
{{- include "pulsar.standardLabels" . | nindent 4 }}
|
{{- include "pulsar.standardLabels" . | nindent 4 }}
|
||||||
component: {{ .Values.broker.component }}
|
component: {{ .Values.broker.component }}
|
||||||
@ -37,7 +39,21 @@ spec:
|
|||||||
component: {{ .Values.broker.component }}
|
component: {{ .Values.broker.component }}
|
||||||
updateStrategy:
|
updateStrategy:
|
||||||
type: RollingUpdate
|
type: RollingUpdate
|
||||||
|
{{- /*
|
||||||
|
When functions are enabled, podManagementPolicy must be OrderedReady to ensure that other started brokers are available via DNS
|
||||||
|
for the function worker to connect to.
|
||||||
|
Since podManagementPolicy is immutable, this rule is only applied when the broker is first installed.
|
||||||
|
*/}}
|
||||||
|
{{- $stsObj := lookup "apps/v1" "StatefulSet" $namespace $stsName }}
|
||||||
|
{{- if $stsObj }}
|
||||||
|
podManagementPolicy: {{ $stsObj.spec.podManagementPolicy }}
|
||||||
|
{{- else }}
|
||||||
|
{{- if not .Values.components.functions }}
|
||||||
podManagementPolicy: Parallel
|
podManagementPolicy: Parallel
|
||||||
|
{{- else }}
|
||||||
|
podManagementPolicy: OrderedReady
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user