Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: add pod anti affinity to master sts to make HA available #4453

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions charts/jindocache/templates/master/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,22 @@ spec:
{{- toYaml .Values.imagePullSecrets | nindent 8 }}
{{- end }}
hostNetwork: {{ .Values.useHostNetwork }}
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: role
operator: In
values:
- jindofs-master
- key: release
operator: In
values:
- {{ .Release.Name | quote }}
topologyKey: kubernetes.io/hostname
nodeSelector:
{{- if .Values.master.nodeSelector }}
{{ toYaml .Values.master.nodeSelector | trim | indent 8 }}
Expand Down
16 changes: 16 additions & 0 deletions charts/jindofsx/templates/master/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,22 @@ spec:
{{- toYaml .Values.imagePullSecrets | nindent 8 }}
{{- end }}
hostNetwork: {{ .Values.useHostNetwork }}
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: role
operator: In
values:
- jindofs-master
- key: release
operator: In
values:
- {{ .Release.Name | quote }}
topologyKey: kubernetes.io/hostname
nodeSelector:
{{- if .Values.master.nodeSelector }}
{{ toYaml .Values.master.nodeSelector | trim | indent 8 }}
Expand Down
7 changes: 0 additions & 7 deletions pkg/ddc/jindocache/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,13 +247,6 @@ func (e *JindoCacheEngine) transformMaster(runtime *datav1alpha1.JindoRuntime, m
// combine properties together
if len(runtime.Spec.Master.Properties) > 0 {
for k, v := range runtime.Spec.Master.Properties {
// user define master volume eg: pvc to persist metadata, they can use namespace.meta-dir to define, but can't used under 3 master
// because master will shared the same path to save data
if k == "namespace.meta-dir" && runtime.Spec.Master.Replicas == 3 {
err = fmt.Errorf("not support set namespace.meta.dir with %v and replicas = 3", v)
e.Log.Error(err, "namespace.meta-dir", v)
return
}
properties[k] = v
}
}
Expand Down
7 changes: 0 additions & 7 deletions pkg/ddc/jindofsx/transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -227,13 +227,6 @@ func (e *JindoFSxEngine) transformMaster(runtime *datav1alpha1.JindoRuntime, met
// combine properties together
if len(runtime.Spec.Master.Properties) > 0 {
for k, v := range runtime.Spec.Master.Properties {
// user define master volume eg: pvc to persist metadata, they can use namespace.meta-dir to define, but can't used under 3 master
// because master will shared the same path to save data
if k == "namespace.meta-dir" && runtime.Spec.Master.Replicas == 3 {
err = fmt.Errorf("not support set namespace.meta.dir with %v and replicas = 3", v)
e.Log.Error(err, "namespace.meta-dir", v)
return
}
properties[k] = v
}
}
Expand Down
Loading