Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 13 additions & 5 deletions charts/crowdsec/templates/appsec-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -148,19 +148,29 @@ spec:
- name: INSECURE_SKIP_VERIFY
value: {{ quote .Values.tls.insecureSkipVerify }}
{{- end }}

{{- with .Values.appsec.env }}
{{- toYaml . | nindent 10 }}
{{- end }}
resources:
{{- toYaml .Values.appsec.resources | nindent 10 }}
{{- if or (len .Values.appsec.acquisitions) (.Values.appsec.metrics.enabled) }}
ports:
- name: appsec
containerPort: 7422
protocol: TCP
{{- if .Values.appsec.metrics.enabled }}
- name: metrics
containerPort: 6060
protocol: TCP
{{- end }}
{{- range .Values.appsec.acquisitions }}
{{- if and (hasKey . "listen_addr") (not (contains "127.0.0.1:" .listen_addr)) }}
{{- $url := printf "http://%s/" .listen_addr | urlParse }}
{{- $port := .listen_addr | replace (printf "%s:" $url.hostname) "" }}
- name: appsec{{ if ne $port "7422" }}-{{ $port }}{{ end }}
containerPort: {{ $port }}
protocol: TCP
{{- end }}
{{- end }}
{{- end }}

{{/* Probes depend on the metrics port, there is no other service on the log processor */}}

Expand All @@ -177,8 +187,6 @@ spec:
{{ toYaml .Values.appsec.startupProbe | indent 10 }}
{{ end }}

{{ end }}

securityContext:
{{- toYaml .Values.appsec.securityContext | nindent 10 }}

Expand Down
16 changes: 13 additions & 3 deletions charts/crowdsec/templates/appsec-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,25 @@ spec:
{{- if or (eq .Values.appsec.service.type "LoadBalancer") (eq .Values.appsec.service.type "NodePort") }}
externalTrafficPolicy: {{ .Values.appsec.service.externalTrafficPolicy | quote }}
{{- end }}
{{- if or (len .Values.appsec.acquisitions) (.Values.appsec.metrics.enabled) }}
ports:
{{- if .Values.appsec.metrics.enabled }}
- port: 6060
targetPort: 6060
protocol: TCP
name: metrics
- port: 7422
targetPort: 7422
{{- end }}
{{- range .Values.appsec.acquisitions }}
{{- if and (hasKey . "listen_addr") (not (contains "127.0.0.1:" .listen_addr)) }}
{{- $url := printf "http://%s/" .listen_addr | urlParse }}
{{- $port := .listen_addr | replace (printf "%s:" $url.hostname) "" }}
- port: {{ $port }}
targetPort: {{ $port }}
protocol: TCP
name: appsec
name: appsec{{ if ne $port "7422" }}-{{ $port }}{{ end }}
{{- end }}
{{- end }}
{{- end }}
selector:
k8s-app: {{ .Release.Name }}
type: appsec
Expand Down
Loading