Skip to content

Commit 6d792e9

Browse files
committed
support K8s Pod affinity configuration for Pod scheduling
1 parent ae8d283 commit 6d792e9

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
apiVersion: apps/v1
3+
kind: Deployment
4+
metadata:
5+
name: postgresql-operator
6+
spec:
7+
template:
8+
spec:
9+
affinity: {}

operator/src/main/resources/application.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,12 @@ quarkus:
103103
value: ${quarkus.kubernetes.image-pull-secrets[0]}
104104
paths:
105105
- (kind == Deployment).spec.template.spec.imagePullSecrets[0].name
106+
description: Kubernetes image pull secret to use if the OCI image is hosted on a private registry
107+
affinity:
108+
property: affinity
109+
value-as-map: {}
110+
path: (kind == Deployment).spec.template.spec.affinity
111+
description: Kubernetes affinity configuration for Pod scheduling
106112
expressions:
107113
release-name-labels:
108114
expression: "{{ .Release.Name }}"
@@ -116,6 +122,9 @@ quarkus:
116122
release-name-deployment-labels:
117123
expression: "{{ .Release.Name }}"
118124
path: (kind == Deployment).spec.template.metadata.labels.'app.kubernetes.io/name'
125+
affinity:
126+
expression: "{{- toYaml (.Values.app.affinity | default dict) | nindent 8 }}"
127+
path: (kind == Deployment).spec.template.spec.affinity
119128
kubernetes:
120129
name: postgresql-operator
121130
version: ${quarkus.application.version}

0 commit comments

Comments
 (0)