Skip to content

Commit

Permalink
Add configmap for policies
Browse files Browse the repository at this point in the history
  • Loading branch information
JessieAMorris committed Dec 9, 2024
1 parent 849d5d7 commit af407d8
Show file tree
Hide file tree
Showing 6 changed files with 132 additions and 10 deletions.
2 changes: 1 addition & 1 deletion charts/philter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.9
version: 0.1.10

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
2 changes: 1 addition & 1 deletion charts/philter/templates/ph-eye/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: Deployment
metadata:
name: {{ include "philter.phEyeFullname" . }}
labels:
{{- include "philter.labels" . | nindent 4 }}
{{- include "philter.phEyeLabels" . | nindent 4 }}
spec:
{{- if not .Values.phEye.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
Expand Down
16 changes: 16 additions & 0 deletions charts/philter/templates/philter-api/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{- if .Values.policies.createConfigMap }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "philter.fullname" . }}-policies
labels:
{{- include "philter.labels" . | nindent 4 }}
{{- if .Values.policies.configMapAnnotations }}
annotations:
{{- with .Values.policies.configMapAnnotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
data:
{{- toYaml .Values.policies.data | nindent 2 }}
{{- end }}
28 changes: 21 additions & 7 deletions charts/philter/templates/philter-api/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ kind: Deployment
metadata:
name: {{ include "philter.apiFullname" . }}
labels:
{{- include "philter.labels" . | nindent 4 }}
{{- include "philter.apiLabels" . | nindent 4 }}
spec:
{{- if not .Values.api.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
Expand All @@ -13,10 +13,14 @@ spec:
{{- include "philter.apiSelectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.api.podAnnotations }}
annotations:
{{- if .Values.policies.createConfigMap }}
checksum/policies-json-config: {{ include (print $.Template.BasePath "/philter-api/configmap.yaml") . | sha256sum }}
{{- end }}

{{- with .Values.api.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
labels:
{{- include "philter.apiLabels" . | nindent 8 }}
{{- with .Values.api.podLabels }}
Expand Down Expand Up @@ -50,14 +54,24 @@ spec:
{{- toYaml .Values.api.readinessProbe | nindent 12 }}
resources:
{{- toYaml .Values.api.resources | nindent 12 }}
{{- with .Values.api.volumeMounts }}
volumeMounts:
{{- if .Values.policies.createConfigMap }}
- name: {{ include "philter.fullname" . }}-policies
mountPath: "/opt/philter/policies/"
{{- end }}

{{- with .Values.api.volumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.api.volumes }}
{{- end }}
volumes:
{{- if .Values.policies.createConfigMap }}
- name: policies
configMap:
name: {{ include "philter.fullname" . }}-policies
{{- end }}
{{- with .Values.api.volumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- with .Values.api.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
2 changes: 1 addition & 1 deletion charts/philter/templates/philter-ui/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ kind: Deployment
metadata:
name: {{ include "philter.uiFullname" . }}
labels:
{{- include "philter.labels" . | nindent 4 }}
{{- include "philter.uiLabels" . | nindent 4 }}
spec:
{{- if not .Values.ui.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
Expand Down
92 changes: 92 additions & 0 deletions charts/philter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,98 @@ ingress:
# hosts:
# - chart-example.local

policies:
createConfigMap: true

configMapAnnotations: {}

data:
default.json: |
{
"name": "default",
"config": {
"splitting": {
"enabled": true,
"threshold": 384,
"method": "width"
}
},
"ignored": [],
"identifiers": {
"dictionaries": [],
"person": {
"phEyeConfiguration": {
"endpoint": "http://philter-ph-eye:5000"
},
"personFilterStrategies": [{
"strategy": "REDACT",
"redactionFormat": "{{{REDACTED-%t}}}"
}]
},
"age": {
"ageFilterStrategies": [{
"strategy": "REDACT",
"redactionFormat": "{{{REDACTED-%t}}}"
}]
},
"creditCard": {
"creditCardFilterStrategies": [{
"strategy": "REDACT",
"redactionFormat": "{{{REDACTED-%t}}}"
}]
},
"date": {
"dateFilterStrategies": [{
"strategy": "REDACT",
"redactionFormat": "{{{REDACTED-%t}}}"
}]
},
"emailAddress": {
"emailAddressFilterStrategies": [{
"strategy": "REDACT",
"redactionFormat": "{{{REDACTED-%t}}}"
}]
},
"ipAddress": {
"ipAddressFilterStrategies": [{
"strategy": "REDACT",
"redactionFormat": "{{{REDACTED-%t}}}"
}]
},
"phoneNumber": {
"phoneNumberFilterStrategies": [{
"strategy": "REDACT",
"redactionFormat": "{{{REDACTED-%t}}}"
}]
},
"ssn": {
"ssnFilterStrategies": [{
"strategy": "REDACT",
"redactionFormat": "{{{REDACTED-%t}}}"
}]
},
"url": {
"urlFilterStrategies": [{
"strategy": "REDACT",
"redactionFormat": "{{{REDACTED-%t}}}"
}]
},
"vin": {
"vinFilterStrategies": [{
"strategy": "REDACT",
"redactionFormat": "{{{REDACTED-%t}}}"
}]
},
"zipCode": {
"zipCodeFilterStrategy": [{
"strategy": "REDACT",
"redactionFormat": "{{{REDACTED-%t}}}"
}]
}
}
}
# This block is for setting up an HTTPRoute for more information can be found here: https://gateway-api.sigs.k8s.io/api-types/httproute/
httpRoute:
enabled: false
Expand Down

0 comments on commit af407d8

Please sign in to comment.