diff --git a/charts/crowdsec/Chart.yaml b/charts/crowdsec/Chart.yaml index afb39e9..d54ddc5 100644 --- a/charts/crowdsec/Chart.yaml +++ b/charts/crowdsec/Chart.yaml @@ -39,14 +39,15 @@ description: | # Configure external DB (https://docs.crowdsec.net/docs/configuration/crowdsec_configuration/#configuration-example) config: - config-override.yaml: | + config.yaml.local: | db_config: - type: "postgresql" - user: "crowdsec" - password: "${DB_PASSWORD}" - db_name: "crowdsec" - host: "192.168.0.2" - port: "5432" + type: postgresql + user: crowdsec + password: ${DB_PASSWORD} + db_name: crowdsec + host: 192.168.0.2 + port: 5432 + sslmode: require lapi: # 2 or more replicas for HA diff --git a/charts/crowdsec/README.md b/charts/crowdsec/README.md index e4532d9..bb72c8a 100644 --- a/charts/crowdsec/README.md +++ b/charts/crowdsec/README.md @@ -46,7 +46,7 @@ helm delete crowdsec -n crowdsec | config."console.yaml" | string | `""` | | | config."capi_whitelists.yaml" | string | `""` | | | config."profiles.yaml" | string | `""` | Profiles configuration (https://docs.crowdsec.net/docs/next/profiles/format/#profile-configuration-example) | -| config."config-override.yaml" | string | `""` | General configuration (https://docs.crowdsec.net/docs/configuration/crowdsec_configuration/#configuration-example) | +| config."config.yaml.local" | string | `""` | General configuration (https://docs.crowdsec.net/docs/configuration/crowdsec_configuration/#configuration-example) | | config.notifications | object | `{}` | notifications configuration (https://docs.crowdsec.net/docs/next/notification_plugins/intro) | | tls.enabled | bool | `false` | | | tls.caBundle | bool | `true` | | @@ -86,7 +86,7 @@ helm delete crowdsec -n crowdsec | lapi.nodeSelector | object | `{}` | nodeSelector for lapi | | lapi.tolerations | object | `{}` | tolerations for lapi | | lapi.affinity | object | `{}` | affinity for lapi | -| lapi.topologySpreadConstraints | object | `{}` | topologySpreadConstraints for lapi | +| lapi.topologySpreadConstraints | object | `[]` | topologySpreadConstraints for lapi | | lapi.metrics | object | `{"enabled":false,"serviceMonitor":{"enabled":false}}` | Enable service monitoring (exposes "metrics" port "6060" for Prometheus) | | lapi.metrics.serviceMonitor | object | `{"enabled":false}` | See also: https://github.com/prometheus-community/helm-charts/issues/106#issuecomment-700847774 | | lapi.strategy.type | string | `"RollingUpdate"` | | diff --git a/charts/crowdsec/templates/_helpers.tpl b/charts/crowdsec/templates/_helpers.tpl index 20e9407..6aba98b 100644 --- a/charts/crowdsec/templates/_helpers.tpl +++ b/charts/crowdsec/templates/_helpers.tpl @@ -78,7 +78,7 @@ true lapi custom config check */}} {{ define "lapiCustomConfigIsNotEmpty" }} -{{- if or (index .Values.config "profiles.yaml") (index .Values.config "config-override.yaml") ((include "notificationsIsNotEmpty" .)) }} +{{- if or (index .Values.config "profiles.yaml") (index .Values.config "config.yaml.local") ((include "notificationsIsNotEmpty" .)) }} true {{- end -}} {{- end -}} diff --git a/charts/crowdsec/templates/lapi-configmap.yaml b/charts/crowdsec/templates/lapi-configmap.yaml index 76f94ee..250caec 100644 --- a/charts/crowdsec/templates/lapi-configmap.yaml +++ b/charts/crowdsec/templates/lapi-configmap.yaml @@ -29,15 +29,15 @@ data: capi_whitelists.yaml: | {{ printf "%+v" (index .Values.config "capi_whitelists.yaml") | indent 4 }} {{ end }} -{{- if index .Values.config "config-override.yaml" }} +{{- if index .Values.config "config.yaml.local" }} --- apiVersion: v1 kind: ConfigMap metadata: - name: crowdsec-config-override + name: crowdsec-config-local data: config.yaml.local: | -{{ printf "%+v" (index .Values.config "config-override.yaml") | indent 4 }} +{{ printf "%+v" (index .Values.config "config.yaml.local") | indent 4 }} {{ end }} {{ if (include "notificationsIsNotEmpty" .) }} --- diff --git a/charts/crowdsec/templates/lapi-deployment.yaml b/charts/crowdsec/templates/lapi-deployment.yaml index a499e98..9391882 100644 --- a/charts/crowdsec/templates/lapi-deployment.yaml +++ b/charts/crowdsec/templates/lapi-deployment.yaml @@ -188,8 +188,8 @@ spec: mountPath: {{ $crowdsecConfig }}/capi_whitelists.yaml subPath: capi_whitelists.yaml {{ end }} - {{ if index .Values.config "config-override.yaml" }} - - name: crowdsec-config-override-volume + {{ if index .Values.config "config.yaml.local" }} + - name: crowdsec-config-local-volume mountPath: {{ $crowdsecConfig }}/config.yaml.local subPath: config.yaml.local {{ end }} @@ -305,10 +305,10 @@ spec: configMap: name: crowdsec-capi-whitelists {{- end }} - {{ if index .Values.config "config-override.yaml" }} - - name: crowdsec-config-override-volume + {{ if index .Values.config "config.yaml.local" }} + - name: crowdsec-config-local-volume configMap: - name: crowdsec-config-override + name: crowdsec-config-local {{- end }} {{- if (include "notificationsIsNotEmpty" .) -}} {{ range $fileName, $content := .Values.config.notifications -}} diff --git a/charts/crowdsec/values.schema.json b/charts/crowdsec/values.schema.json index 0d0b25d..a582fe2 100644 --- a/charts/crowdsec/values.schema.json +++ b/charts/crowdsec/values.schema.json @@ -123,7 +123,7 @@ "capi_whitelists.yaml": { "type": "string" }, - "config-override.yaml": { + "config.yaml.local": { "type": "string" } }, diff --git a/charts/crowdsec/values.yaml b/charts/crowdsec/values.yaml index 1350c38..da92d6c 100644 --- a/charts/crowdsec/values.yaml +++ b/charts/crowdsec/values.yaml @@ -72,15 +72,16 @@ config: # - Alert.Remediation == true && Alert.GetScope() == "Ip" # ... # -- General configuration (https://docs.crowdsec.net/docs/configuration/crowdsec_configuration/#configuration-example) - config-override.yaml: "" + config.yaml.local: "" # | # db_config: - # type: "postgresql" - # user: "crowdsec" - # password: "${DB_PASSWORD}" - # db_name: "crowdsec" - # host: "192.168.0.2" - # port: "5432" + # type: postgresql + # user: crowdsec + # password: ${DB_PASSWORD} + # db_name: crowdsec + # host: 192.168.0.2 + # port: 5432 + # sslmode: require # -- notifications configuration (https://docs.crowdsec.net/docs/next/notification_plugins/intro) notifications: {} # email.yaml: | @@ -213,7 +214,7 @@ lapi: # -- affinity for lapi affinity: {} # -- topologySpreadConstraints for lapi - topologySpreadConstraints: {} + topologySpreadConstraints: [] # -- Enable service monitoring (exposes "metrics" port "6060" for Prometheus) metrics: