You've already forked prometheus-postgres-exporter
							
							fix(deployment): template affinity
This commit is contained in:
		| @@ -21,6 +21,10 @@ spec: | |||||||
|       labels: |       labels: | ||||||
|         {{- include "prometheus-postgres-exporter.pod.labels" . | nindent 8 }} |         {{- include "prometheus-postgres-exporter.pod.labels" . | nindent 8 }} | ||||||
|     spec: |     spec: | ||||||
|  |       {{- with .Values.deployment.affinity }} | ||||||
|  |       affinity: | ||||||
|  |         {{- toYaml . | nindent 8 }} | ||||||
|  |       {{- end }} | ||||||
|       containers: |       containers: | ||||||
|       - name: postgres-exporter |       - name: postgres-exporter | ||||||
|         args: |         args: | ||||||
|   | |||||||
| @@ -30,6 +30,8 @@ tests: | |||||||
|   - equal: |   - equal: | ||||||
|       path: spec.replicas |       path: spec.replicas | ||||||
|       value: 1 |       value: 1 | ||||||
|  |   - notExists: | ||||||
|  |       path: spec.template.spec.affinity | ||||||
|   - contains: |   - contains: | ||||||
|       path: spec.template.spec.containers[0].envFrom |       path: spec.template.spec.containers[0].envFrom | ||||||
|       content: |       content: | ||||||
| @@ -102,6 +104,32 @@ tests: | |||||||
|       path: spec.replicas |       path: spec.replicas | ||||||
|       value: 3 |       value: 3 | ||||||
|  |  | ||||||
|  | - it: Test custom affinity | ||||||
|  |   set: | ||||||
|  |     deployment.affinity: | ||||||
|  |       nodeAffinity: | ||||||
|  |         requiredDuringSchedulingIgnoredDuringExecution: | ||||||
|  |           nodeSelectorTerms: | ||||||
|  |           - matchExpressions: | ||||||
|  |             - key: topology.kubernetes.io/zone | ||||||
|  |               operator: In | ||||||
|  |               values: | ||||||
|  |               - antarctica-east1 | ||||||
|  |               - antarctica-west1 | ||||||
|  |   asserts: | ||||||
|  |   - equal: | ||||||
|  |       path: spec.template.spec.affinity | ||||||
|  |       value: | ||||||
|  |         nodeAffinity: | ||||||
|  |           requiredDuringSchedulingIgnoredDuringExecution: | ||||||
|  |             nodeSelectorTerms: | ||||||
|  |             - matchExpressions: | ||||||
|  |               - key: topology.kubernetes.io/zone | ||||||
|  |                 operator: In | ||||||
|  |                 values: | ||||||
|  |                 - antarctica-east1 | ||||||
|  |                 - antarctica-west1 | ||||||
|  |  | ||||||
| - it: Test additional arguments | - it: Test additional arguments | ||||||
|   set: |   set: | ||||||
|     deployment.postgresExporter.args: |     deployment.postgresExporter.args: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user