4141 {{- toYaml . | nindent 8 }}
4242 {{- end }}
4343 serviceAccountName : {{ include "nvsentinel.serviceAccountName" . }}
44+ {{- if and .Values.global.datastore (eq .Values.global.datastore.provider "postgresql") }}
45+ initContainers :
46+ - name : fix-cert-permissions
47+ image : " docker.io/bitnamilegacy/os-shell:12-debian-12-r30"
48+ imagePullPolicy : IfNotPresent
49+ securityContext :
50+ runAsUser : 0
51+ command :
52+ - sh
53+ - -c
54+ - |
55+ echo "Copying PostgreSQL client certificates with correct permissions..."
56+ cp /etc/ssl/client-certs-original/tls.crt /etc/ssl/client-certs-fixed/
57+ cp /etc/ssl/client-certs-original/ca.crt /etc/ssl/client-certs-fixed/
58+ cp /etc/ssl/client-certs-original/tls.key /etc/ssl/client-certs-fixed/
59+ chmod 644 /etc/ssl/client-certs-fixed/tls.crt
60+ chmod 644 /etc/ssl/client-certs-fixed/ca.crt
61+ chmod 600 /etc/ssl/client-certs-fixed/tls.key
62+ echo "Certificate permissions fixed:"
63+ ls -la /etc/ssl/client-certs-fixed/
64+ volumeMounts :
65+ - name : postgresql-client-cert-original
66+ mountPath : /etc/ssl/client-certs-original
67+ readOnly : true
68+ - name : client-certs-fixed
69+ mountPath : /etc/ssl/client-certs-fixed
70+ {{- end }}
4471 containers :
4572 - name : platform-connector
73+ image : " {{ .Values.platformConnector.image.repository }}:{{ .Values.platformConnector.image.tag | default .Values.global.image.tag | default .Chart.AppVersion }}"
74+ imagePullPolicy : {{ .Values.platformConnector.image.pullPolicy }}
75+ securityContext :
76+ runAsUser : 0
77+ capabilities :
78+ drop :
79+ - ALL
4680 ports :
4781 - name : metrics
4882 containerPort : {{ .Values.global.metricsPort }}
@@ -62,17 +96,14 @@ spec:
6296 periodSeconds : 10
6397 timeoutSeconds : 3
6498 failureThreshold : 3
65- securityContext :
66- runAsUser : 0
67- capabilities :
68- drop :
69- - ALL
70- image : " {{ .Values.platformConnector.image.repository }}:{{ .Values.platformConnector.image.tag | default .Values.global.image.tag | default .Chart.AppVersion }}"
71- imagePullPolicy : {{ .Values.platformConnector.image.pullPolicy }}
7299 args :
73100 - " --config=/etc/config/config.json"
74101 - " --metrics-port={{ .Values.global.metricsPort }}"
75- - " --mongo-client-cert-mount-path=/etc/ssl/mongo-client"
102+ {{- if and .Values.global.datastore (eq .Values.global.datastore.provider "postgresql") }}
103+ - " --database-client-cert-mount-path={{ .Values.platformConnector.postgresqlStore.clientCertMountPath }}"
104+ {{- else }}
105+ - " --mongo-client-cert-mount-path={{ .Values.platformConnector.mongodbStore.clientCertMountPath }}"
106+ {{- end }}
76107 - " --socket={{ .Values.socketPath }}"
77108 resources :
78109 {{- toYaml .Values.platformConnector.resources | nindent 12 }}
@@ -81,9 +112,15 @@ spec:
81112 mountPath : /var/run
82113 - name : platform-connector-configmap
83114 mountPath : /etc/config/
115+ {{- if and .Values.global.datastore (eq .Values.global.datastore.provider "postgresql") }}
116+ - name : client-certs-fixed
117+ mountPath : {{ .Values.platformConnector.postgresqlStore.clientCertMountPath }}
118+ readOnly : true
119+ {{- else }}
84120 - name : mongo-app-client-cert
85- mountPath : /etc/ssl/mongo-client
121+ mountPath : {{ .Values.platformConnector.mongodbStore.clientCertMountPath }}
86122 readOnly : true
123+ {{- end }}
87124 env :
88125 - name : NODE_NAME
89126 valueFrom :
@@ -92,8 +129,13 @@ spec:
92129 fieldPath : spec.nodeName
93130 - name : LOG_LEVEL
94131 value : " {{ .Values.platformConnector.logLevel }}"
132+ {{- if and .Values.global.datastore (eq .Values.global.datastore.provider "postgresql") }}
133+ - name : POSTGRESQL_CLIENT_CERT_MOUNT_PATH
134+ value : {{ .Values.platformConnector.postgresqlStore.clientCertMountPath }}
135+ {{- else }}
95136 - name : MONGODB_CLIENT_CERT_MOUNT_PATH
96137 value : {{ .Values.platformConnector.mongodbStore.clientCertMountPath }}
138+ {{- end }}
97139 envFrom :
98140 - configMapRef :
99141 name : {{ if .Values.global.datastore }}{{ .Release.Name }}-datastore-config{{ else }}mongodb-config{{ end }}
@@ -106,10 +148,19 @@ spec:
106148 - name : platform-connector-configmap
107149 configMap :
108150 name : {{ include "nvsentinel.fullname" . }}
151+ {{- if and .Values.global.datastore (eq .Values.global.datastore.provider "postgresql") }}
152+ - name : postgresql-client-cert-original
153+ secret :
154+ secretName : postgresql-client-cert
155+ optional : false
156+ - name : client-certs-fixed
157+ emptyDir : {}
158+ {{- else }}
109159 - name : mongo-app-client-cert
110160 secret :
111161 secretName : mongo-app-client-cert-secret
112162 optional : true
163+ {{- end }}
113164 {{- with (.Values.global.tolerations | default .Values.platformConnector.tolerations) }}
114165 tolerations :
115166 {{- toYaml . | nindent 8 }}
0 commit comments