Skip to content

Commit 3596139

Browse files
authored
fix: add nodeselector for sim (#1094)
1 parent f5897d2 commit 3596139

File tree

5 files changed

+40
-0
lines changed

5 files changed

+40
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
- add metrics dashboard
77
- add support for IPv6 polling and traps for kubernetes deployment
88
- add support for IPv6 polling and traps for docker deployment
9+
- add nodeSelector and podAntiAffinity to sim chart
910

1011
### Fixed
1112

charts/splunk-connect-for-snmp/templates/sim/deployment.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,29 @@ spec:
6060
- name: config
6161
mountPath: "/config"
6262
readOnly: true
63+
{{- with .Values.sim.nodeSelector }}
64+
nodeSelector:
65+
{{- toYaml . | nindent 8 }}
66+
{{- end }}
67+
{{- if eq .Values.sim.podAntiAffinity "hard" }}
68+
affinity:
69+
podAntiAffinity:
70+
requiredDuringSchedulingIgnoredDuringExecution:
71+
- topologyKey: "kubernetes.io/hostname"
72+
labelSelector:
73+
matchLabels:
74+
{{- include "splunk-connect-for-snmp.sim.selectorLabels" . | nindent 22 }}
75+
{{- else if eq .Values.sim.podAntiAffinity "soft" }}
76+
affinity:
77+
podAntiAffinity:
78+
preferredDuringSchedulingIgnoredDuringExecution:
79+
- weight: 1
80+
podAffinityTerm:
81+
topologyKey: kubernetes.io/hostname
82+
labelSelector:
83+
matchLabels:
84+
{{- include "splunk-connect-for-snmp.sim.selectorLabels" . | nindent 22 }}
85+
{{- end }}
6386
volumes:
6487
- name: config
6588
configMap:

charts/splunk-connect-for-snmp/values.schema.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,15 @@
247247
"type": "boolean"
248248
}
249249
}
250+
},
251+
"podAnnotations": {
252+
"type": "object"
253+
},
254+
"podAntiAffinity": {
255+
"type": "string"
256+
},
257+
"nodeSelector": {
258+
"type": "object"
250259
}
251260
}
252261
},

charts/splunk-connect-for-snmp/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ sim:
126126
autoscaling:
127127
enabled: false
128128

129+
podAnnotations: { }
130+
podAntiAffinity: soft
131+
nodeSelector: { }
132+
129133
################################################################################
130134
# SC4SNMP components settings
131135
################################################################################

docs/configuration/values-params-description.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ Detailed documentation about configuring sim can be found in [Splunk Infrastruct
6363
| `autoscaling.maxReplicas` | Maximum number of running pods when autoscaling is enabled | |
6464
| `autoscaling.targetCPUUtilizationPercentage` | CPU % threshold that must be exceeded on pods to spawn another replica | |
6565
| `autoscaling.targetMemoryUtilizationPercentage` | Memory % threshold that must be exceeded on pods to spawn another replica | |
66+
| `podAntiAffinity` | [Kubernetes documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) | `soft` |
67+
| `nodeSelector` | [Kubernetes documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector) | |
68+
6669

6770
## Scheduler
6871

0 commit comments

Comments
 (0)