@@ -31,12 +31,59 @@ spec:
3131 app.kubernetes.io/component : management
3232 {{- include "nts-pool.selectorLabels" . | nindent 8 }}
3333 spec :
34- {{- if .Values.management.databaseCertificate.cert }}
3534 volumes :
35+ - name : geolocation-script
36+ configMap :
37+ name : {{ include "nts-pool.fullname" . }}-geolocation-loader
38+ items :
39+ - key : " geolocation-loader.sh"
40+ path : " geolocation-loader.sh"
41+ mode : 0755
42+ - name : geolocation
43+ emptyDir : {}
44+ {{- if .Values.management.databaseCertificate.cert }}
3645 - name : db-cert-volume
3746 configMap :
3847 name : {{ include "nts-pool.fullname" . }}-management-db-cert
39- {{- end }}
48+ {{- end }}
49+ initContainers :
50+ - name : geolocation
51+ imagePullPolicy : " {{ default .Values.image.pullPolicy .Values.management.image.pullPolicy }}"
52+ {{- with default .Values.image.pullSecrets .Values.management.image.pullSecrets }}
53+ imagePullSecrets :
54+ {{- toYaml . | nindent 10 }}
55+ {{- end }}
56+ image : " {{ default .Values.image.repository .Values.management.image.repository }}:{{ default .Values.image.tag .Values.management.image.tag }}"
57+ command : ["/opt/geodb/geolocation-loader.sh"]
58+ workingDir : " /opt/geodb/"
59+ volumeMounts :
60+ - name : geolocation
61+ mountPath : " /opt/geodb"
62+ - name : geolocation-script
63+ mountPath : " /opt/geodb/scripts/"
64+ readonly : true
65+ restartPolicy : always
66+ startupProbe :
67+ exec :
68+ command :
69+ - sh
70+ - -c
71+ - test -e /opt/geodb/geodb.mmdb
72+ env :
73+ - name : USERID
74+ valueFrom :
75+ secretKeyRef :
76+ {{- toYaml .Values.geolocation.maxmindUserIdSecretRef | nindent 16 }}
77+ - name : LICENSE_KEY
78+ valueFrom :
79+ secretKeyRef :
80+ {{- toYaml .Values.geolocation.maxmindLicenseKeySecretRef | nindent 16 }}
81+ - name : URL
82+ value : {{ .Values.geolocation.maxmindDatabaseUrl }}
83+ - name : TARGET
84+ value : " /opt/geodb/geodb.mmdb"
85+ - name : PERIOD
86+ value : " 24h"
4087 containers :
4188 - name : management
4289 imagePullPolicy : " {{ default .Values.image.pullPolicy .Values.management.image.pullPolicy }}"
4794 image : " {{ default .Values.image.repository .Values.management.image.repository }}:{{ default .Values.image.tag .Values.management.image.tag }}"
4895 command : ["/usr/local/bin/nts-pool-management"]
4996 workingDir : " /opt/nts-pool-management"
50- {{- if .Values.management.databaseCertificate.cert }}
5197 volumeMounts :
98+ - name : geolocation
99+ mountPath : " /opt/geodb"
100+ {{- if .Values.management.databaseCertificate.cert }}
52101 - name : db-cert-volume
53102 mountPath : {{ .Values.management.databaseCertificate.mountPath }}
54103 subPath : db.pem
@@ -102,4 +151,4 @@ spec:
102151 - name : RESTART_BUMP
103152 value : " {{ default 1 .Values.management.restartBump}}"
104153 - name : NTSPOOL_GEOLOCATION_DB
105- value : " /opt/nts-pool-management/GeoLite2-Country-Test .mmdb" # Temporary, until proper loading of geolocation database is implemented
154+ value : " /opt/geodb/geodb .mmdb"
0 commit comments