diff --git a/charts/queryservice/Chart.yaml b/charts/queryservice/Chart.yaml index caca4b4..2a4cd75 100644 --- a/charts/queryservice/Chart.yaml +++ b/charts/queryservice/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: "1.0" description: A Helm chart for Kubernetes name: queryservice -version: 0.2.1 +version: 0.2.2 home: https://github.com/wbstack maintainers: - name: WBstack diff --git a/charts/queryservice/templates/deployment.yaml b/charts/queryservice/templates/deployment.yaml index df7dcfa..a3b5bbf 100644 --- a/charts/queryservice/templates/deployment.yaml +++ b/charts/queryservice/templates/deployment.yaml @@ -70,6 +70,27 @@ spec: #TODO allow passing value in values - name: WDQS_ENTITY_NAMESPACES value: 120,122 + initContainers: + - name: queryservice-allowlist-nginx-sidecar + image: nginx + restartPolicy: {{ .Values.image.restartPolicy }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + livenessProbe: + httpGet: + path: /allowlist.txt + port: 8080 + initialDelaySeconds: 5 + periodSeconds: 5 + #restart the container if it fails 3 times in 15 seconds + failureThreshold: 3 + volumeMounts: + - mountPath: /wdqs/allowlist.txt + subPath: allowlist.txt + name: allowlist + readOnly: true + - mountPath: /etc/nginx/nginx.conf + subPath: nginx.conf + name: nginx-config volumes: - name: data {{- if .Values.persistence.enabled }} @@ -81,6 +102,9 @@ spec: - name: allowlist configMap: name: {{ include "wdqs.fullname" . }}-allowlist + - name: nginx-config + configMap: + name: nginx-sidecar-config {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/charts/queryservice/templates/nginx-sidecar-config.yaml b/charts/queryservice/templates/nginx-sidecar-config.yaml new file mode 100644 index 0000000..0d0fd91 --- /dev/null +++ b/charts/queryservice/templates/nginx-sidecar-config.yaml @@ -0,0 +1,16 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: nginx-sidecar-config +data: + nginx.conf: | + events {} + http { + server { + listen 8080; + + location /allowlist.txt { + root /wdqs/; + } + } + } diff --git a/charts/queryservice/values.yaml b/charts/queryservice/values.yaml index fab2290..9bcfb7d 100644 --- a/charts/queryservice/values.yaml +++ b/charts/queryservice/values.yaml @@ -9,6 +9,7 @@ image: repository: ghcr.io/wbstack/queryservice tag: "0.3.6_0.6" pullPolicy: IfNotPresent + restartPolicy: Always app: heapSize: 2g