Skip to content
Snippets Groups Projects
Commit cec045b1 authored by Guillermo Facundo Colunga's avatar Guillermo Facundo Colunga
Browse files

chart: add defaultNodeSelector for all components

Until now all the components that were not a daemonset and needed to be
deployed on a node contained a config option to indicate a node selector
for the allocation. This commits adds a new global option that allows to
set a node selector that will be applied to all the components that do
not declare one. If any component declares a node selector this last one
will have always more priority.

JIRA Refs:
- MONIT-4003
parent 920ae08f
No related branches found
Tags 1.0.0-rc1
1 merge request!24[MONIT-4003] Add default node selector for all components
Pipeline #8259417 passed
......@@ -37,6 +37,7 @@ At `docs/installation_guide.md` you will find the initial setup and installation
| logs.fluentbit.scrapeInterval | string | `"15s"` | interval used by the local prometheus (if installed) to scrape metrics from logs fluentbits |
| logs.fluentbit.service | string | Daemon mode off listening on port 2020. See `values.yaml`. | fluentbit service configuration options in a multiline string |
| metrics.enabled | bool | `true` | indicates if all metrics components should be enabled or not. If set to false no metrics component will be installed nor configured |
| metrics.defaultNodeSelector | map | `{}` | if set will be used as `nodeSelector` for those components that allow one |
| metrics.fluentbit.enable | bool | `true` | if true fluentbit daemon set will be installed |
| metrics.fluentbit.diskMaxCache | string | `5G` | max size for in-disk storage for fluent-bit |
| metrics.fluentbit.nodeSelector | hash | `"nil"` | fluentbit statefulset node selectors |
......
......@@ -38,10 +38,10 @@ spec:
{{- if .Values.metrics.fluentbit.extraVolumeMounts }}
{{- toYaml .Values.metrics.fluentbit.extraVolumeMounts | nindent 6 }}
{{- end }}
{{- with .Values.metrics.fluentbit.nodeSelector }}
{{- if or (.Values.metrics.defaultNodeSelector) (.Values.metrics.fluentbit.nodeSelector) }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- .Values.metrics.fluentbit.nodeSelector | default .Values.metrics.defaultNodeSelector | toYaml | nindent 8 }}
{{- end }}
volumes:
- name: config
configMap:
......
......@@ -49,8 +49,6 @@ spec:
type: RuntimeDefault
nodeSelector:
kubernetes.io/os: linux
{{- with .Values.metrics.kubeState.nodeSelector }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- .Values.metrics.kubeState.nodeSelector | default .Values.metrics.defaultNodeSelector | toYaml | nindent 8 }}
serviceAccountName: it-monit-metrics-collector-kubestate
{{- end -}}
......@@ -11,10 +11,8 @@ spec:
retention: {{ .Values.metrics.prometheus.server.retention }}
externalLabels:
k8s_cluster_name: {{ .Values.kubernetes.clusterName }}
{{- with .Values.metrics.prometheus.server.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- .Values.metrics.prometheus.server.nodeSelector | default .Values.metrics.defaultNodeSelector | toYaml | nindent 4 }}
serviceAccountName: it-monit-metrics-collector-prometheus
resources:
requests:
......
......@@ -44,9 +44,7 @@ spec:
readOnlyRootFilesystem: true
nodeSelector:
kubernetes.io/os: linux
{{- with .Values.metrics.prometheus.operator.nodeSelector }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- .Values.metrics.prometheus.operator.nodeSelector | default .Values.metrics.defaultNodeSelector | toYaml | nindent 8 }}
securityContext:
runAsNonRoot: true
runAsUser: 65534
......
......@@ -24,6 +24,9 @@ metrics:
# -- indicates if all metrics components should be enabled or not. If set to false no metrics component will be installed nor configured
enabled: true
# -- the default node selector will be applied when possible. In to the following components: metrics collectors (prometheus and fluentbit), metrics exporters (kube state).
defaultNodeSelector: {}
# Node exporter is used to scrape node resources metrics like cpu, memory
# or network.
nodeExporter:
......@@ -42,6 +45,7 @@ metrics:
# Kube state is used to scrape metrics from kubernetes api, like limits
# and resources.
kubeState:
# If set it will override the metrics.defaultNodeSelector.
nodeSelector: {}
# -- if true kube state will be installed together with a service monitor
enabled: true
......@@ -62,6 +66,7 @@ metrics:
enabled: true
# -- specific configuration for the prometheus operator
operator:
# If set it will override the metrics.defaultNodeSelector.
nodeSelector: {}
resources:
requests:
......@@ -71,6 +76,7 @@ metrics:
cpu: "100m"
memory: "100Mi"
server:
# If set it will override the metrics.defaultNodeSelector.
nodeSelector: {}
# -- prometheus version to use by the local cluster prometheus
version: "v2.50.0"
......@@ -118,6 +124,7 @@ metrics:
fluentbit:
# -- if true fluentbit metrics forwarder will be installed
enabled: true
# If set it will override the metrics.defaultNodeSelector.
nodeSelector: {}
resources:
requests:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment