Skip to content

Commit

Permalink
add support and specific values file for waf deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
phoenix-henri committed Dec 2, 2024
1 parent 640fe51 commit 4696b57
Show file tree
Hide file tree
Showing 4 changed files with 503 additions and 0 deletions.
36 changes: 36 additions & 0 deletions templates/modsecurity-crs-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{{- if and .Values.waf .Values.waf.enabled -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: modsecurity-crs
annotations: {{ toYaml .Values.waf.annotations | nindent 4 }}
labels: {{ toYaml .Values.waf.labels | nindent 4 }}
spec:
replicas: {{ .Values.waf.replicas | default 1 }}
selector:
matchLabels:
app: modsecurity-crs
template:
metadata:
labels:
app: modsecurity-crs
spec:
containers:
- name: modsecurity-crs
image: {{ .Values.waf.image.repository }}:{{ .Values.waf.image.tag }}
imagePullPolicy: {{ .Values.waf.image.pullPolicy | default "Always" }}
resources: {{ toYaml .Values.waf.resources | nindent 12 }}
readinessProbe: {{ toYaml .Values.waf.readinessProbe | nindent 12 }}
livenessProbe: {{ toYaml .Values.waf.livenessProbe | nindent 12 }}
startupProbe: {{ toYaml .Values.waf.startupProbe | nindent 12 }}
ports:
- containerPort: 8080
name: http
readinessProbe: {{ toYaml .Values.waf.readinessProbe | nindent 12 }}
livenessProbe: {{ toYaml .Values.waf.livenessProbe | nindent 12 }}
env:
- name: PORT
value: "8080"
{{ toYaml .Values.waf.env | nindent 12 }}
dnsPolicy: ClusterFirst
{{- end -}}
15 changes: 15 additions & 0 deletions templates/modsecurity-crs-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- if and .Values.waf .Values.waf.enabled -}}
apiVersion: v1
kind: Service
metadata:
name: modsecurity-crs
spec:
type: ClusterIP
clusterIP: None
selector:
app: modsecurity-crs
ports:
- name: http
port: 8080
targetPort: http
{{- end -}}
38 changes: 38 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,44 @@ imgproxy:
fallbackImage:
httpCode: 404

waf:
enabled: false
#replicas: 1

Check failure on line 848 in values.yaml

View workflow job for this annotation

GitHub Actions / lint-test

848:4 [comments] missing starting space in comment
#annotations: {}

Check failure on line 849 in values.yaml

View workflow job for this annotation

GitHub Actions / lint-test

849:4 [comments] missing starting space in comment
#labels: {}

Check failure on line 850 in values.yaml

View workflow job for this annotation

GitHub Actions / lint-test

850:4 [comments] missing starting space in comment
#image:

Check failure on line 851 in values.yaml

View workflow job for this annotation

GitHub Actions / lint-test

851:4 [comments] missing starting space in comment
# repository: phoenixmedia/modsecurity-crs
# tag: main
# pullPolicy: Always
#env:

Check failure on line 855 in values.yaml

View workflow job for this annotation

GitHub Actions / lint-test

855:4 [comments] missing starting space in comment
# # see more configuration options here: https://github.com/coreruleset/modsecurity-crs-docker/blob/main/README.md
# # keep in mind that this is a nginx image...
# - name: BACKEND
# value: "http://magento.${NAMESPACE}.svc.cluster.local:80" # Forward traffic to magento
#resources:

Check failure on line 860 in values.yaml

View workflow job for this annotation

GitHub Actions / lint-test

860:4 [comments] missing starting space in comment
# requests:
# memory: 512Mi
# cpu: 300m

Check failure on line 864 in values.yaml

View workflow job for this annotation

GitHub Actions / lint-test

864:1 [trailing-spaces] trailing spaces
#readinessProbe:

Check failure on line 865 in values.yaml

View workflow job for this annotation

GitHub Actions / lint-test

865:4 [comments] missing starting space in comment
# httpGet:
# path: /healthz
# port: 8080
# # if the probe fails 2 times within 10 secondary, the pod is considered as "not ready"
# periodSeconds: 5
# timeoutSeconds: 1
# successThreshold: 2
# failureThreshold: 2

#livenessProbe:

Check failure on line 875 in values.yaml

View workflow job for this annotation

GitHub Actions / lint-test

875:4 [comments] missing starting space in comment
# httpGet:
# path: /healthz
# port: 8080
# # if the probe fails 3 times within 30 seconds, the pod will get restarted
# periodSeconds: 10
# timeoutSeconds: 1
# failureThreshold: 3


persistence:
enabled: true
Expand Down
Loading

0 comments on commit 4696b57

Please sign in to comment.