This repository was archived by the owner on Mar 13, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +55
-7
lines changed
deployment/charts/presidio Expand file tree Collapse file tree 5 files changed +55
-7
lines changed Original file line number Diff line number Diff line change 1
1
import axios , { AxiosRequestConfig } from 'axios'
2
+ import https from 'https'
3
+
4
+ const httpsAgent = new https . Agent ( { rejectUnauthorized : false } )
2
5
3
6
/**
4
7
* Presidio Analyze Response item
@@ -26,8 +29,12 @@ export async function identifyPII (dataString: string): Promise<PresidioRes> {
26
29
data : {
27
30
text : dataString ,
28
31
language : 'en'
29
- }
32
+ } ,
33
+ headers : {
34
+ Host : 'tcx-presidio.svc'
35
+ } ,
36
+ httpsAgent
30
37
}
31
- const res = await axios ( requestConfig )
32
- return res . data as PresidioRes
38
+ const res = await axios . request < PresidioRes > ( requestConfig )
39
+ return res . data
33
40
}
Original file line number Diff line number Diff line change @@ -24,6 +24,12 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
24
24
{ {- define " presidio.anonymizerimage.fullname" -} }
25
25
{ { include " presidio.fullname" . | printf " %s-image-redactor" } }
26
26
{ {- end -} }
27
+ { {- define " presidio.ingress.fullname" -} }
28
+ { { include " presidio.fullname" . | printf " %s-ingress" } }
29
+ { {- end -} }
30
+ { {- define " presidio.ingress.cert.secretname" -} }
31
+ { { include " presidio.fullname" . | printf " %s-ingress-cert" } }
32
+ { {- end -} }
27
33
28
34
{ {- define " presidio.analyzer.address" -} }
29
35
{ {template " presidio.analyzer.fullname" .} }:{ {.Values.analyzer.service.externalPort} }
@@ -37,4 +43,13 @@ We truncate at 63 chars because some Kubernetes name fields are limited to this
37
43
{ {template " presidio.anonymizerimage.fullname" .} }:{ {.Values.anonymizerimage.service.externalPort} }
38
44
{ {- end -} }
39
45
40
- { {- define " presidio.rbac.version" } }rbac.authorization.k8s.io/v1{ { end -} }
46
+ { {- define " presidio.rbac.version" } }rbac.authorization.k8s.io/v1{ { end -} }
47
+
48
+ { {/* Generate certificates for custom-metrics api server */} }
49
+ { {- define " tcx-presidio.gen-certs" -} }
50
+ { {- $ca := genCA (.Values.caCommonName) 365 -} }
51
+ { {- $altNames := list (.Values.certDomainName) -} }
52
+ { {- $cert := genSignedCert (.Values.certDomainName) nil $altNames 365 $ca -} }
53
+ tls.crt: { { $cert .Cert | b64enc } }
54
+ tls.key: { { $cert .Key | b64enc } }
55
+ { {- end -} }
Original file line number Diff line number Diff line change
1
+ {{- $ingressCertSecretName := include "presidio.ingress.cert.secretname" . -}}
2
+ apiVersion : v1
3
+ kind : Secret
4
+ type : kubernetes.io/tls
5
+ metadata :
6
+ name : {{ $ingressCertSecretName }}
7
+ labels :
8
+ app : {{ $ingressCertSecretName }}
9
+ chart : {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
10
+ release : {{ .Release.Name }}
11
+ heritage : {{ .Release.Service }}
12
+ annotations :
13
+ " helm.sh/hook " : " pre-install"
14
+ " helm.sh/hook-delete-policy " : " before-hook-creation"
15
+ data :
16
+ {{ ( include "tcx-presidio.gen-certs" . ) | indent 2 }}
Original file line number Diff line number Diff line change 1
1
{{- if and (.Values.ingress.enabled) (eq .Values.ingress.class "nginx") -}}
2
+ {{- $ingressName := include "presidio.ingress.fullname" . -}}
3
+ {{- $ingressCertSecretName := include "presidio.ingress.cert.secretname" . -}}
2
4
{{- $analyzerfullname := include "presidio.analyzer.fullname" . -}}
3
5
{{- $anonymizerfullname := include "presidio.anonymizer.fullname" . -}}
4
6
{{- $anonymizerimagefullname := include "presidio.anonymizerimage.fullname" . -}}
5
7
apiVersion : networking.k8s.io/v1beta1
6
8
kind : Ingress
7
9
metadata :
8
- name : presidio-ingress
10
+ name : {{ $ingressName }}
9
11
labels :
10
- app : presidio-ingress
12
+ app : {{ $ingressName }}
11
13
chart : {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
12
14
release : {{ .Release.Name }}
13
15
heritage : {{ .Release.Service }}
14
16
annotations :
15
17
kubernetes.io/ingress.class : {{ .Values.ingress.class }}
16
18
nginx.ingress.kubernetes.io/rewrite-target : " /$2"
17
19
spec :
20
+ tls :
21
+ - hosts :
22
+ - " {{ .Values.certDomainName }}"
23
+ secretName : {{ $ingressCertSecretName }}
18
24
rules :
19
- - http :
25
+ - host : " {{ .Values.certDomainName }}"
26
+ http :
20
27
paths :
21
28
- backend :
22
29
serviceName : {{ $analyzerfullname }}
Original file line number Diff line number Diff line change @@ -66,3 +66,6 @@ anonymizerimage:
66
66
externalPort : 80
67
67
internalPort : 8080
68
68
name : http
69
+
70
+ certDomainName : tcx-presidio.svc
71
+ caCommonName : tcx-presidio.ca
You can’t perform that action at this time.
0 commit comments