diff --git a/charts/crowdsec/templates/appsec-deployment.yaml b/charts/crowdsec/templates/appsec-deployment.yaml index 06e1f8d..278a06c 100644 --- a/charts/crowdsec/templates/appsec-deployment.yaml +++ b/charts/crowdsec/templates/appsec-deployment.yaml @@ -154,11 +154,13 @@ spec: {{- end }} resources: {{- toYaml .Values.appsec.resources | nindent 10 }} + {{- if or .Values.appsec.ports .Values.appsec.metrics.enabled }} ports: - - name: appsec - containerPort: 7422 - protocol: TCP - {{- if .Values.appsec.metrics.enabled }} + {{- end }} + {{- with .Values.appsec.ports }} + {{- toYaml . | nindent 10 }} + {{- end }} + {{ if .Values.appsec.metrics.enabled }} - name: metrics containerPort: 6060 protocol: TCP diff --git a/charts/crowdsec/templates/appsec-service.yaml b/charts/crowdsec/templates/appsec-service.yaml index 557351a..9abf3eb 100644 --- a/charts/crowdsec/templates/appsec-service.yaml +++ b/charts/crowdsec/templates/appsec-service.yaml @@ -28,16 +28,15 @@ spec: externalTrafficPolicy: {{ .Values.appsec.service.externalTrafficPolicy | quote }} {{- end }} ports: + {{- with .Values.appsec.service.ports }} + {{- toYaml . | nindent 4 }} + {{- end }} - port: 6060 targetPort: 6060 protocol: TCP name: metrics - - port: 7422 - targetPort: 7422 - protocol: TCP - name: appsec selector: k8s-app: {{ .Release.Name }} type: appsec version: v1 -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/crowdsec/values.yaml b/charts/crowdsec/values.yaml index a6972e7..ed10f57 100644 --- a/charts/crowdsec/values.yaml +++ b/charts/crowdsec/values.yaml @@ -702,6 +702,11 @@ appsec: strategy: type: Recreate + ports: + # -- add your custom ports here, by default we expose port 6060 for metrics if metrics is enabled + - name: appsec + containerPort: 7422 + protocol: TCP # -- Additional acquisitions for AppSec ## @param appsec.acquisitions [array] AppSec acquisitions (datasource listeners), e.g. appsec listener on 7422 acquisitions: [] @@ -882,6 +887,12 @@ appsec: loadBalancerClass: null ## @param appsec.service.externalTrafficPolicy [string] External traffic policy for the AppSec Service externalTrafficPolicy: Cluster + ports: + ## add your custom ports here, for exposing the AppSec component on different ports. See the documentation: https://docs.crowdsec.net/docs/next/appsec/configuration + - port: 7422 + targetPort: 7422 + protocol: TCP + name: appsec # -- wait-for-lapi init container wait_for_lapi: