diff --git a/.changelog/3462.added.txt b/.changelog/3462.added.txt new file mode 100644 index 0000000000..0d933a3eab --- /dev/null +++ b/.changelog/3462.added.txt @@ -0,0 +1 @@ +feat: add global affinity option \ No newline at end of file diff --git a/deploy/helm/sumologic/README.md b/deploy/helm/sumologic/README.md index 27a2680f8a..806bdb5dac 100644 --- a/deploy/helm/sumologic/README.md +++ b/deploy/helm/sumologic/README.md @@ -161,6 +161,7 @@ The following table lists the configurable parameters of the Sumo Logic chart an | `sumologic.podAnnotations` | Additional annotations for the pods. | `{}` | | `sumologic.nodeSelector` | Default node selector for Kubernetes objects created by this chart. This can be overriden for specific components. | `{}` | | `sumologic.tolerations` | Default tolerations for Kubernetes objects created by this chart. This can be overriden for specific components. | `[]` | +| `sumologic.affinity` | Default affinity for Kubernetes objects created by this chart. This can be overriden for specific components. | `{}` | | `sumologic.scc.create` | Create OpenShift's Security Context Constraint | `false` | | `sumologic.serviceAccount.annotations` | Add custom annotations to sumologic serviceAccounts | `{}` | | `sumologic.setup.job.pullSecrets` | Optional list of secrets that will be used for pulling images for Sumo Logic's setup job. | `Nil` | diff --git a/deploy/helm/sumologic/templates/_helpers/_common.tpl b/deploy/helm/sumologic/templates/_helpers/_common.tpl index 21cf8dce3c..b6d11bb40a 100644 --- a/deploy/helm/sumologic/templates/_helpers/_common.tpl +++ b/deploy/helm/sumologic/templates/_helpers/_common.tpl @@ -470,6 +470,19 @@ Example: {{- end -}} {{- end -}} +{{/* +Returns default affinity for all objects. + +Example: + +{{ include "kubernetes.defaultAffinity" . }} +*/}} +{{- define "kubernetes.defaultAffinity" -}} +{{- if .Values.sumologic.affinity -}} +{{- toYaml .Values.sumologic.affinity -}} +{{- end -}} +{{- end -}} + {{/* Environment variables used to configure the HTTP proxy for programs using Go's net/http. See: https://pkg.go.dev/net/http#RoundTripper @@ -585,3 +598,11 @@ Example usage: {{- template "kubernetes.defaultTolerations" . -}} {{- end -}} {{- end -}} + +{{- define "pvcCleaner.job.affinity" -}} +{{- if .Values.pvcCleaner.job.affinity -}} +{{- toYaml .Values.pvcCleaner.job.affinity -}} +{{- else -}} +{{- template "kubernetes.defaultAffinity" . -}} +{{- end -}} +{{- end -}} diff --git a/deploy/helm/sumologic/templates/_helpers/_logs.tpl b/deploy/helm/sumologic/templates/_helpers/_logs.tpl index 5c7d59c3b3..d3e910a6e8 100644 --- a/deploy/helm/sumologic/templates/_helpers/_logs.tpl +++ b/deploy/helm/sumologic/templates/_helpers/_logs.tpl @@ -319,3 +319,11 @@ Example Usage: {{- template "kubernetes.defaultTolerations" . -}} {{- end -}} {{- end -}} + +{{- define "metadata.logs.statefulset.affinity" -}} +{{- if .Values.metadata.logs.statefulset.affinity -}} +{{- toYaml .Values.metadata.logs.statefulset.affinity -}} +{{- else -}} +{{- template "kubernetes.defaultAffinity" . -}} +{{- end -}} +{{- end -}} diff --git a/deploy/helm/sumologic/templates/_helpers/_metrics.tpl b/deploy/helm/sumologic/templates/_helpers/_metrics.tpl index 2507fd4cce..baea2e3514 100644 --- a/deploy/helm/sumologic/templates/_helpers/_metrics.tpl +++ b/deploy/helm/sumologic/templates/_helpers/_metrics.tpl @@ -75,6 +75,14 @@ Example Usage: {{- end -}} {{- end -}} +{{- define "metrics.remoteWriteProxy.affinity" -}} +{{- if .Values.sumologic.metrics.remoteWriteProxy.affinity -}} +{{- toYaml .Values.sumologic.metrics.remoteWriteProxy.affinity -}} +{{- else -}} +{{- template "kubernetes.defaultAffinity" . -}} +{{- end -}} +{{- end -}} + {{- define "metrics.collector.otelcol.nodeSelector" -}} {{- if .Values.sumologic.metrics.collector.otelcol.nodeSelector -}} {{- toYaml .Values.sumologic.metrics.collector.otelcol.nodeSelector -}} @@ -91,6 +99,14 @@ Example Usage: {{- end -}} {{- end -}} +{{- define "metrics.collector.otelcol.affinity" -}} +{{- if .Values.sumologic.metrics.collector.otelcol.affinity -}} +{{- toYaml .Values.sumologic.metrics.collector.otelcol.affinity -}} +{{- else -}} +{{- template "kubernetes.defaultAffinity" . -}} +{{- end -}} +{{- end -}} + {{- define "metadata.metrics.statefulset.nodeSelector" -}} {{- if .Values.metadata.metrics.statefulset.nodeSelector -}} {{- toYaml .Values.metadata.metrics.statefulset.nodeSelector -}} @@ -107,6 +123,14 @@ Example Usage: {{- end -}} {{- end -}} +{{- define "metadata.metrics.statefulset.affinity" -}} +{{- if .Values.metadata.metrics.statefulset.affinity -}} +{{- toYaml .Values.metadata.metrics.statefulset.affinity -}} +{{- else -}} +{{- template "kubernetes.defaultAffinity" . -}} +{{- end -}} +{{- end -}} + {{- define "sumologic.labels.app.metrics" -}} {{ template "sumologic.labels.app.otelcol" . }}-metrics {{- end -}} diff --git a/deploy/helm/sumologic/templates/_helpers/_setup.tpl b/deploy/helm/sumologic/templates/_helpers/_setup.tpl index ceb7ef82dc..ca34aef7dc 100644 --- a/deploy/helm/sumologic/templates/_helpers/_setup.tpl +++ b/deploy/helm/sumologic/templates/_helpers/_setup.tpl @@ -310,3 +310,11 @@ Example Usage: {{- template "kubernetes.defaultTolerations" . -}} {{- end -}} {{- end -}} + +{{- define "setup.job.affinity" -}} +{{- if .Values.sumologic.setup.job.affinity -}} +{{- toYaml .Values.sumologic.setup.job.affinity -}} +{{- else -}} +{{- template "kubernetes.defaultAffinity" . -}} +{{- end -}} +{{- end -}} diff --git a/deploy/helm/sumologic/templates/_helpers/_traces.tpl b/deploy/helm/sumologic/templates/_helpers/_traces.tpl index 8d7169af6b..d364c0b44d 100644 --- a/deploy/helm/sumologic/templates/_helpers/_traces.tpl +++ b/deploy/helm/sumologic/templates/_helpers/_traces.tpl @@ -266,6 +266,14 @@ Example Usage: {{- end -}} {{- end -}} +{{- define "otelcolInstrumentation.statefulset.affinity" -}} +{{- if .Values.otelcolInstrumentation.statefulset.affinity -}} +{{- toYaml .Values.otelcolInstrumentation.statefulset.affinity -}} +{{- else -}} +{{- template "kubernetes.defaultAffinity" . -}} +{{- end -}} +{{- end -}} + {{/* Check if autoscaling for traces gateway is enabled. diff --git a/deploy/helm/sumologic/templates/instrumentation/otelcol-instrumentation/statefulset.yaml b/deploy/helm/sumologic/templates/instrumentation/otelcol-instrumentation/statefulset.yaml index c294eccccb..c2f0a76d87 100644 --- a/deploy/helm/sumologic/templates/instrumentation/otelcol-instrumentation/statefulset.yaml +++ b/deploy/helm/sumologic/templates/instrumentation/otelcol-instrumentation/statefulset.yaml @@ -54,10 +54,10 @@ spec: tolerations: {{ include "otelcolInstrumentation.statefulset.tolerations" . | indent 8 }} {{- end }} -{{- if or $otelcolInstrumentation.statefulset.affinity $otelcolInstrumentation.statefulset.podAntiAffinity }} +{{- if or (not (empty (include "otelcolInstrumentation.statefulset.affinity" .))) $otelcolInstrumentation.statefulset.podAntiAffinity }} affinity: -{{- if $otelcolInstrumentation.statefulset.affinity }} -{{ toYaml $otelcolInstrumentation.statefulset.affinity | indent 8 }} +{{- if not (empty (include "otelcolInstrumentation.statefulset.affinity" .)) }} +{{ include "otelcolInstrumentation.statefulset.affinity" . | indent 8 }} {{- end }} {{- if eq $otelcolInstrumentation.statefulset.podAntiAffinity "hard"}} {{ include "pod-anti-affinity-hard" . | indent 8 }} diff --git a/deploy/helm/sumologic/templates/logs/collector/otelcol/daemonset.yaml b/deploy/helm/sumologic/templates/logs/collector/otelcol/daemonset.yaml index 767701e1e0..0a58cdf53b 100644 --- a/deploy/helm/sumologic/templates/logs/collector/otelcol/daemonset.yaml +++ b/deploy/helm/sumologic/templates/logs/collector/otelcol/daemonset.yaml @@ -3,6 +3,7 @@ {{- $instance := "" -}} {{- $defaultNodeSelector := (include "kubernetes.defaultNodeSelector" .) }} {{- $defaultTolerations := (include "kubernetes.defaultTolerations" .) }} +{{- $defaultAffinity := (include "kubernetes.defaultAffinity" .) }} {{- $daemonsets := dict "" $.Values.otellogs.daemonset -}} {{- $daemonsets = deepCopy $daemonsets | merge $.Values.otellogs.additionalDaemonSets -}} {{- range $name, $value := $daemonsets }} @@ -22,6 +23,12 @@ {{- else if $defaultTolerations }} {{- $tolerations = $defaultTolerations }} {{- end }} +{{- $affinity := "" }} +{{- if .affinity }} +{{- $affinity = (toYaml .affinity) }} +{{- else if $defaultAffinity }} +{{- $affinity = $defaultAffinity }} +{{- end }} --- apiVersion: apps/v1 kind: DaemonSet @@ -67,9 +74,9 @@ spec: nodeSelector: {{ $nodeSelector | indent 8 }} {{- end }} -{{- if or .affinity }} +{{- if $affinity }} affinity: -{{ toYaml .affinity | indent 8 }} +{{ $affinity | indent 8 }} {{- end }} {{- if $tolerations }} tolerations: diff --git a/deploy/helm/sumologic/templates/logs/otelcol/statefulset.yaml b/deploy/helm/sumologic/templates/logs/otelcol/statefulset.yaml index 8608e09e61..5b60d50b81 100644 --- a/deploy/helm/sumologic/templates/logs/otelcol/statefulset.yaml +++ b/deploy/helm/sumologic/templates/logs/otelcol/statefulset.yaml @@ -53,8 +53,8 @@ spec: {{- end }} {{- if .Values.metadata.logs.statefulset.affinity }} affinity: -{{- if .Values.metadata.logs.statefulset.affinity }} -{{ toYaml .Values.metadata.logs.statefulset.affinity | indent 8 }} +{{- if not (empty (include "metadata.logs.statefulset.affinity" .)) }} +{{ include "metadata.logs.statefulset.affinity" . | indent 8 }} {{- end }} {{- if eq .Values.metadata.logs.statefulset.podAntiAffinity "hard"}} {{ include "pod-anti-affinity-hard" . | indent 8 }} diff --git a/deploy/helm/sumologic/templates/metrics/collector/otelcol/opentelemetrycollector.yaml b/deploy/helm/sumologic/templates/metrics/collector/otelcol/opentelemetrycollector.yaml index efdd3106a1..01417455cc 100644 --- a/deploy/helm/sumologic/templates/metrics/collector/otelcol/opentelemetrycollector.yaml +++ b/deploy/helm/sumologic/templates/metrics/collector/otelcol/opentelemetrycollector.yaml @@ -60,9 +60,9 @@ spec: tolerations: {{ include "metrics.collector.otelcol.tolerations" . | indent 6 }} {{- end }} -{{- if .Values.sumologic.metrics.collector.otelcol.affinity }} +{{- if not (empty (include "metrics.collector.otelcol.affinity" .)) }} affinity: -{{ toYaml .Values.sumologic.metrics.collector.otelcol.affinity | indent 6 }} +{{ include "metrics.collector.otelcol.affinity" . | indent 6 }} {{- end }} {{- if not (empty (include "metrics.collector.otelcol.nodeSelector" .)) }} nodeSelector: @@ -72,9 +72,9 @@ spec: tolerations: {{ include "metrics.collector.otelcol.tolerations" . | indent 6 }} {{- end }} -{{- if .Values.sumologic.metrics.collector.otelcol.affinity }} +{{- if not (empty (include "metrics.collector.otelcol.affinity" .)) }} affinity: -{{ toYaml .Values.sumologic.metrics.collector.otelcol.affinity | indent 4 }} +{{ include "metrics.collector.otelcol.affinity" . | indent 6 }} {{- end }} {{- if .Values.sumologic.metrics.collector.otelcol.priorityClassName }} priorityClassName: {{ .Values.sumologic.metrics.collector.otelcol.priorityClassName | quote }} diff --git a/deploy/helm/sumologic/templates/metrics/otelcol/statefulset.yaml b/deploy/helm/sumologic/templates/metrics/otelcol/statefulset.yaml index 87fd373947..99b4e05495 100644 --- a/deploy/helm/sumologic/templates/metrics/otelcol/statefulset.yaml +++ b/deploy/helm/sumologic/templates/metrics/otelcol/statefulset.yaml @@ -51,10 +51,10 @@ spec: tolerations: {{ include "metadata.metrics.statefulset.tolerations" . | indent 8 }} {{- end }} -{{- if or .Values.metadata.metrics.statefulset.affinity .Values.metadata.metrics.statefulset.podAntiAffinity }} +{{- if or (not (empty (include "metadata.metrics.statefulset.affinity" .))) .Values.metadata.metrics.statefulset.podAntiAffinity }} affinity: -{{- if .Values.metadata.metrics.statefulset.affinity }} -{{ toYaml .Values.metadata.metrics.statefulset.affinity | indent 8 }} +{{- if not (empty (include "metadata.metrics.statefulset.affinity" .)) }} +{{ include "metadata.metrics.statefulset.affinity" . | indent 8 }} {{- end }} {{- if eq .Values.metadata.metrics.statefulset.podAntiAffinity "hard"}} {{ include "pod-anti-affinity-hard" . | indent 8 }} diff --git a/deploy/helm/sumologic/templates/metrics/remote-write-proxy/deployment.yaml b/deploy/helm/sumologic/templates/metrics/remote-write-proxy/deployment.yaml index ffa35f2a5c..b036cb402b 100644 --- a/deploy/helm/sumologic/templates/metrics/remote-write-proxy/deployment.yaml +++ b/deploy/helm/sumologic/templates/metrics/remote-write-proxy/deployment.yaml @@ -40,11 +40,11 @@ spec: nodeSelector: {{ include "metrics.remoteWriteProxy.nodeSelector" . | nindent 8 }} {{- end }} -{{- if or .Values.sumologic.metrics.remoteWriteProxy.affinity }} +{{- if not (empty (include "metrics.remoteWriteProxy.affinity" .)) }} affinity: -{{ toYaml .Values.sumologic.metrics.remoteWriteProxy.affinity | indent 8 }} +{{ include "metrics.remoteWriteProxy.affinity" . | nindent 8 }} {{- end }} -{{- if not (empty (include "metrics.remoteWriteProxy.nodeSelector" .)) }} +{{- if not (empty (include "metrics.remoteWriteProxy.tolerations" .)) }} tolerations: {{ include "metrics.remoteWriteProxy.tolerations" . | nindent 8 }} {{- end }} diff --git a/deploy/helm/sumologic/templates/pvc-cleaner/cron-job-logs.yaml b/deploy/helm/sumologic/templates/pvc-cleaner/cron-job-logs.yaml index e943c57be0..66e0651c4d 100644 --- a/deploy/helm/sumologic/templates/pvc-cleaner/cron-job-logs.yaml +++ b/deploy/helm/sumologic/templates/pvc-cleaner/cron-job-logs.yaml @@ -39,9 +39,9 @@ spec: tolerations: {{ include "pvcCleaner.job.tolerations" . | indent 12 }} {{- end }} -{{- with .Values.pvcCleaner.job.affinity }} +{{- if not (empty (include "pvcCleaner.job.affinity" .)) }} affinity: -{{ toYaml . | indent 12 }} +{{ include "pvcCleaner.job.affinity" . | indent 12 }} {{- end }} {{- with .Values.pvcCleaner.job.securityContext }} securityContext: diff --git a/deploy/helm/sumologic/templates/pvc-cleaner/cron-job-metrics.yaml b/deploy/helm/sumologic/templates/pvc-cleaner/cron-job-metrics.yaml index f87787af43..4b37d360b6 100644 --- a/deploy/helm/sumologic/templates/pvc-cleaner/cron-job-metrics.yaml +++ b/deploy/helm/sumologic/templates/pvc-cleaner/cron-job-metrics.yaml @@ -39,9 +39,9 @@ spec: tolerations: {{ include "pvcCleaner.job.tolerations" . | indent 12 }} {{- end }} -{{- with .Values.pvcCleaner.job.affinity }} +{{- if not (empty (include "pvcCleaner.job.affinity" .)) }} affinity: -{{ toYaml . | indent 12 }} +{{ include "pvcCleaner.job.affinity" . | indent 12 }} {{- end }} {{- with .Values.pvcCleaner.job.securityContext }} securityContext: diff --git a/deploy/helm/sumologic/templates/setup/job.yaml b/deploy/helm/sumologic/templates/setup/job.yaml index c47d37d986..830d29c48d 100644 --- a/deploy/helm/sumologic/templates/setup/job.yaml +++ b/deploy/helm/sumologic/templates/setup/job.yaml @@ -37,9 +37,9 @@ spec: tolerations: {{ include "setup.job.tolerations" . | indent 8 }} {{- end }} -{{- if .Values.sumologic.setup.job.affinity }} +{{- if not (empty (include "setup.job.affinity" .)) }} affinity: -{{ toYaml .Values.sumologic.setup.job.affinity | indent 8 }} +{{ include "setup.job.affinity" . | indent 8 }} {{- end }} volumes: - name: setup diff --git a/deploy/helm/sumologic/values.yaml b/deploy/helm/sumologic/values.yaml index 075f26dbaf..05e27461ac 100644 --- a/deploy/helm/sumologic/values.yaml +++ b/deploy/helm/sumologic/values.yaml @@ -99,6 +99,9 @@ sumologic: ## Global configuration of tolerations tolerations: [] + ## Global configuration of affinity + affinity: {} + ## Add custom annotations to sumologic serviceAccounts serviceAccount: annotations: {} diff --git a/tests/helm/common_test.go b/tests/helm/common_test.go index 13181a6c11..6f7465bdd0 100644 --- a/tests/helm/common_test.go +++ b/tests/helm/common_test.go @@ -3,6 +3,7 @@ package helm import ( "fmt" "path" + "reflect" "strings" "testing" @@ -230,6 +231,53 @@ func TestTolerations(t *testing.T) { } } +func TestAffinities(t *testing.T) { + t.Parallel() + valuesFilePath := path.Join(testDataDirectory, "node-selector.yaml") + renderedYamlString := RenderTemplate( + t, + &helm.Options{ + ValuesFiles: []string{valuesFilePath}, + SetStrValues: map[string]string{ + "sumologic.accessId": "accessId", + "sumologic.accessKey": "accessKey", + }, + Logger: logger.Discard, // the log output is noisy and doesn't help much + }, + chartDirectory, + releaseName, + []string{}, + true, + "--namespace", + defaultNamespace, + ) + + // split the rendered Yaml into individual documents and unmarshal them into K8s objects + // we could use the yaml decoder directly, but we'd have to implement our own unmarshaling logic then + renderedObjects := UnmarshalMultipleFromYaml[unstructured.Unstructured](t, renderedYamlString) + + for _, renderedObject := range renderedObjects { + aff, err := GetAffinity(renderedObject) + require.NoError(t, err) + // Objects that are not subject to global settings: + excluded := map[string]bool{ + "col-test-sumologic-otelcol-events": true, + } + // Check only node affinity, to avoid checking anti affinities + if _, ok := excluded[renderedObject.GetName()]; !ok && aff != nil { + assert.NotNil(t, aff.NodeAffinity, "%s", renderedObject.GetName()) + assert.True( + t, + reflect.DeepEqual(*aff.NodeAffinity, *affinity.NodeAffinity), + "%s should have node affinity set to %s, found %s instead", + renderedObject.GetName(), + affinity, + aff, + ) + } + } +} + func TestNameAndLabelLength(t *testing.T) { // object kinds whose names are limited to 63 characters instead of K8s default of 253 // not all of these are strictly required, but it's a good practice to limit them regardless @@ -384,6 +432,16 @@ func GetNodeSelector(object unstructured.Unstructured) (map[string]string, error return nil, nil } +func GetAffinity(object unstructured.Unstructured) (*corev1.Affinity, error) { + podSpec, err := GetPodSpec(object) + if err != nil { + return nil, err + } else if podSpec != nil { + return podSpec.Affinity, nil + } + + return nil, nil +} func GetTolerations(object unstructured.Unstructured) ([]corev1.Toleration, error) { podSpec, err := GetPodSpec(object) diff --git a/tests/helm/const.go b/tests/helm/const.go index 10a6f94f7c..c8d17a48d8 100644 --- a/tests/helm/const.go +++ b/tests/helm/const.go @@ -42,3 +42,33 @@ var toleration = corev1.Toleration{ // operator: Exists // effect: "NoSchedule" } + +var affinity = corev1.Affinity{ + // affinity: + // nodeAffinity: + // requiredDuringSchedulingIgnoredDuringExecution: + // nodeSelectorTerms: + // - matchExpressions: + // - key: kubernetes.io/os + // operator: NotIn + // values: + // - linux + NodeAffinity: &corev1.NodeAffinity{ + RequiredDuringSchedulingIgnoredDuringExecution: &corev1.NodeSelector{ + NodeSelectorTerms: []corev1.NodeSelectorTerm{ + { + MatchExpressions: []corev1.NodeSelectorRequirement{ + { + Key: "kubernetes.io/os", + Operator: corev1.NodeSelectorOpNotIn, + Values: []string{"linux"}, + }, + }, + MatchFields: nil, + }, + }, + }, + }, + PodAffinity: nil, + PodAntiAffinity: nil, +} diff --git a/tests/helm/testdata/goldenfile/metrics_collector_otc/custom.input.yaml b/tests/helm/testdata/goldenfile/metrics_collector_otc/custom.input.yaml index 5596d810f6..89b4c506f8 100644 --- a/tests/helm/testdata/goldenfile/metrics_collector_otc/custom.input.yaml +++ b/tests/helm/testdata/goldenfile/metrics_collector_otc/custom.input.yaml @@ -5,6 +5,15 @@ sumologic: - key: null operator: NotExists effect: "FailTest" + affinity: + nodeAffinity: + requiredSomethingDuringSomethingElse: + nodeSelectorTerms: + - matchExpressions: + - key: definitely_not + operator: In + values: + - a-correct-affinity metrics: collector: otelcol: diff --git a/tests/helm/testdata/goldenfile/pvc-cleaner/full_config_logs.input.yaml b/tests/helm/testdata/goldenfile/pvc-cleaner/full_config_logs.input.yaml index 6a401dbcc9..2cbbadfae4 100644 --- a/tests/helm/testdata/goldenfile/pvc-cleaner/full_config_logs.input.yaml +++ b/tests/helm/testdata/goldenfile/pvc-cleaner/full_config_logs.input.yaml @@ -9,6 +9,15 @@ sumologic: - key: null operator: NotExists effect: "TestFail" + affinity: + nodeAffinity: + requiredSomethingDuringSomethingElse: + nodeSelectorTerms: + - matchExpressions: + - key: definitely_not + operator: In + values: + - a-correct-affinity pvcCleaner: metrics: diff --git a/tests/helm/testdata/goldenfile/pvc-cleaner/full_config_metrics.input.yaml b/tests/helm/testdata/goldenfile/pvc-cleaner/full_config_metrics.input.yaml index 6a401dbcc9..2cbbadfae4 100644 --- a/tests/helm/testdata/goldenfile/pvc-cleaner/full_config_metrics.input.yaml +++ b/tests/helm/testdata/goldenfile/pvc-cleaner/full_config_metrics.input.yaml @@ -9,6 +9,15 @@ sumologic: - key: null operator: NotExists effect: "TestFail" + affinity: + nodeAffinity: + requiredSomethingDuringSomethingElse: + nodeSelectorTerms: + - matchExpressions: + - key: definitely_not + operator: In + values: + - a-correct-affinity pvcCleaner: metrics: diff --git a/tests/helm/testdata/goldenfile/remote_write_proxy/full_config.input.yaml b/tests/helm/testdata/goldenfile/remote_write_proxy/full_config.input.yaml index e7dcd798ac..e9576ee827 100644 --- a/tests/helm/testdata/goldenfile/remote_write_proxy/full_config.input.yaml +++ b/tests/helm/testdata/goldenfile/remote_write_proxy/full_config.input.yaml @@ -6,6 +6,15 @@ sumologic: operator: "NotEqual" value: "value5" effect: "FailTest" + affinity: + nodeAffinity: + requiredSomethingDuringSomethingElse: + nodeSelectorTerms: + - matchExpressions: + - key: definitely_not + operator: In + values: + - a-correct-affinity pullSecrets: - name: sumo-pull podLabels: diff --git a/tests/helm/testdata/node-selector.yaml b/tests/helm/testdata/node-selector.yaml index bc9f11fc04..da42edac46 100644 --- a/tests/helm/testdata/node-selector.yaml +++ b/tests/helm/testdata/node-selector.yaml @@ -6,6 +6,15 @@ sumologic: value: "value" operator: Exists effect: "NoSchedule" + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/os + operator: NotIn + values: + - linux # Override these to satisfy the tests otellogs: