Skip to content

Commit

Permalink
add nginx sidecar
Browse files Browse the repository at this point in the history
  • Loading branch information
mjasion committed Nov 14, 2023
1 parent b5b7dee commit adf7b2b
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
28 changes: 28 additions & 0 deletions charts/studio/nginx/ui-sidecar.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
server {
listen 80;
access_log /dev/stdout;
error_log /dev/stdout debug;

location / {
proxy_set_header Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://ui;
}
}

upstream ui {
server 127.0.0.1:3000;
}

# Health check endpoint
server {
access_log /dev/null main;
error_log /dev/null info;

listen 8080;
location / {
return 200 'OK';
}
}
29 changes: 29 additions & 0 deletions charts/studio/templates/deployment-studio-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ spec:
metadata:
annotations:
checksum/configmap-studio-ui: {{ include (print $.Template.BasePath "/configmap-studio-ui.yaml") . | sha256sum }}
checksum/configmap-studio-nginx: {{ include (print $.Template.BasePath "/configmap-studio-nginx.yaml") . | sha256sum }}
{{- include "studio.checksum" . | indent 8 }}
{{- with .Values.studioUi.podAnnotations }}
{{- toYaml . | nindent 8 }}
Expand All @@ -36,6 +37,31 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: nginx-sidecar
image: "{{ .Values.studioBlobvault.image.repository }}:{{ .Values.studioBlobvault.image.tag }}"
ports:
- containerPort: 80
protocol: TCP
name: nginx-http
livenessProbe:
tcpSocket:
port: 80
periodSeconds: 10
readinessProbe:
httpGet:
path: /
port: 8080
initialDelaySeconds: 5
periodSeconds: 10
successThreshold: 3
timeoutSeconds: 10
volumeMounts:
- name: nginx-sidecar
mountPath: /etc/nginx/nginx.conf
subPath: nginx.conf
- name: nginx-sidecar
mountPath: /etc/nginx/conf.d/default.conf
subPath: ui-sidecar.conf
- name: studio-ui
securityContext:
{{- toYaml .Values.studioUi.securityContext | nindent 12 }}
Expand Down Expand Up @@ -93,6 +119,9 @@ spec:
- name: studio-ca-certificates
configMap:
name: studio-ca-certificates
- name: nginx-sidecar
configMap:
name: {{ .Release.Name }}-nginx
{{- with .Values.studioUi.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
4 changes: 4 additions & 0 deletions charts/studio/templates/service-ui.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,9 @@ spec:
targetPort: http
protocol: TCP
name: http
- port: 80
targetPort: http
protocol: TCP
name: nginx-http
selector:
{{- include "studio-ui.selectorLabels" . | nindent 4 }}

0 comments on commit adf7b2b

Please sign in to comment.