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

Add nodeAffinity for Postgres operator, and add new entry cloud-native-postgresql-v1.22 #2313

Merged
merged 1 commit into from
Nov 22, 2024
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
76 changes: 76 additions & 0 deletions controllers/constant/odlm_operatorconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,16 @@ spec:
- name: edb-keycloak
replicas: placeholder-size
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/arch
operator: In
values:
- amd64
- ppc64le
- s390x
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 90
Expand Down Expand Up @@ -68,6 +78,16 @@ spec:
- name: cloud-native-postgresql
replicas: placeholder-size
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/arch
operator: In
values:
- amd64
- ppc64le
- s390x
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 90
Expand Down Expand Up @@ -104,6 +124,62 @@ spec:
- name: common-service-postgresql
replicas: placeholder-size
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/arch
operator: In
values:
- amd64
- ppc64le
- s390x
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 90
podAffinityTerm:
topologyKey: topology.kubernetes.io/zone
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- cloud-native-postgresql
- weight: 50
podAffinityTerm:
topologyKey: kubernetes.io/hostname
labelSelector:
matchExpressions:
- key: app.kubernetes.io/name
operator: In
values:
- cloud-native-postgresql
topologySpreadConstraints:
- maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
app.kubernetes.io/name: cloud-native-postgresql
- maxSkew: 1
topologyKey: topology.kubernetes.io/region
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
app.kubernetes.io/name: cloud-native-postgresql
- name: cloud-native-postgresql-v1.22
replicas: placeholder-size
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/arch
operator: In
values:
- amd64
- ppc64le
- s390x
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 90
Expand Down
2 changes: 1 addition & 1 deletion controllers/operatorconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (r *CommonServiceReconciler) updateOperatorConfig(ctx context.Context, conf
Namespace: r.Bootstrap.CSData.ServicesNs,
}, operatorConfig); err != nil {
if !apierrors.IsNotFound(err) {
klog.Errorf("failed to get OperandConfig %s/%s: %v", operatorConfig.GetNamespace(), operatorConfig.GetName(), err)
klog.Errorf("failed to get OperatorConfig %s/%s: %v", operatorConfig.GetNamespace(), operatorConfig.GetName(), err)
return true, err
}
}
Expand Down
Loading