Skip to content

Commit

Permalink
Rename new config file to stay consistent with doc
Browse files Browse the repository at this point in the history
  • Loading branch information
erwanval committed Apr 2, 2024
1 parent b44eb3c commit 477aedb
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 26 deletions.
15 changes: 8 additions & 7 deletions charts/crowdsec/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion charts/crowdsec/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,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` | |
Expand Down Expand Up @@ -94,6 +94,7 @@ helm delete crowdsec -n crowdsec
| lapi.tolerations | list | `[]` | tolerations for lapi |
| lapi.dnsConfig | object | `{}` | dnsConfig for lapi |
| lapi.affinity | object | `{}` | affinity 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 | `"Recreate"` | |
Expand Down
2 changes: 1 addition & 1 deletion charts/crowdsec/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
Expand Down
6 changes: 3 additions & 3 deletions charts/crowdsec/templates/lapi-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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" .) }}
---
Expand Down
10 changes: 5 additions & 5 deletions charts/crowdsec/templates/lapi-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,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 }}
Expand Down Expand Up @@ -324,10 +324,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 -}}
Expand Down
2 changes: 1 addition & 1 deletion charts/crowdsec/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
"capi_whitelists.yaml": {
"type": "string"
},
"config-override.yaml": {
"config.yaml.local": {
"type": "string"
}
},
Expand Down
17 changes: 9 additions & 8 deletions charts/crowdsec/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,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: |
Expand Down Expand Up @@ -236,7 +237,7 @@ lapi:
# -- affinity for lapi
affinity: {}
# -- topologySpreadConstraints for lapi
topologySpreadConstraints: {}
topologySpreadConstraints: []

# -- Enable service monitoring (exposes "metrics" port "6060" for Prometheus)
metrics:
Expand Down

0 comments on commit 477aedb

Please sign in to comment.