-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mount nginx.conf as a volume to the frontend container #244
Open
mittal-ishaan
wants to merge
12
commits into
opencost:main
Choose a base branch
from
mittal-ishaan:add_frontend_config_to_helm_chart
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
33372d6
mount nginx.conf as a volume to the frontend container
mittal-ishaan 9ec4ddf
lint
mittal-ishaan c31dcbb
chart bump
mittal-ishaan 1c6a569
correct after testing
mittal-ishaan 0e24ebf
add to a subpath instead of overwriting the compelete directory
mittal-ishaan 6e15561
mount nginx.conf as a volume to the frontend container
mittal-ishaan 8d2de9c
lint
mittal-ishaan 69cb03e
correct after testing
mittal-ishaan 6f7d4aa
add to a subpath instead of overwriting the compelete directory
mittal-ishaan 3d6d10f
naming configmap
mittal-ishaan 5a7c9d2
Merge branch 'add_frontend_config_to_helm_chart' of https://github.co…
mittal-ishaan 7c358c8
Merge branch 'main' into add_frontend_config_to_helm_chart
mittal-ishaan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
{{- if .Values.opencost.ui.enabled }} | ||
{{- $serviceName := include "opencost.fullname" . -}} | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: opencost-ui-nginx-conf | ||
namespace: {{ .Release.Namespace }} | ||
data: | ||
nginx.conf: | | ||
gzip_static on; | ||
gzip on; | ||
gzip_min_length 50000; | ||
gzip_proxied expired no-cache no-store private auth; | ||
gzip_types | ||
application/atom+xml | ||
application/geo+json | ||
application/javascript | ||
application/x-javascript | ||
application/json | ||
application/ld+json | ||
application/manifest+json | ||
application/rdf+xml | ||
application/rss+xml | ||
application/vnd.ms-fontobject | ||
application/wasm | ||
application/x-web-app-manifest+json | ||
application/xhtml+xml | ||
application/xml | ||
font/eot | ||
font/otf | ||
font/ttf | ||
image/bmp | ||
image/svg+xml | ||
text/cache-manifest | ||
text/calendar | ||
text/css | ||
text/javascript | ||
text/markdown | ||
text/plain | ||
text/xml | ||
text/x-component | ||
text/x-cross-domain-policy; | ||
|
||
upstream model { | ||
{{- if .Values.opencost.ui.useDefaultFqdn }} | ||
server {{ $serviceName }}.{{ .Release.Namespace }}.svc.cluster.local:9003; | ||
{{- else if .Values.opencost.ui.modelFqdn }} | ||
server {{ .Values.opencost.ui.modelFqdn }}; | ||
{{- else }} | ||
server {{ $serviceName }}.{{ .Release.Namespace }}:9003; | ||
{{- end }} | ||
} | ||
|
||
server { | ||
server_name _; | ||
root /var/www; | ||
index index.html; | ||
large_client_header_buffers 4 32k; | ||
add_header Cache-Control "must-revalidate"; | ||
|
||
error_page 504 /custom_504.html; | ||
location = /custom_504.html { | ||
internal; | ||
} | ||
|
||
add_header Cache-Control "max-age=300"; | ||
location / { | ||
root /var/www; | ||
index index.html index.htm; | ||
try_files $uri /index.html; | ||
} | ||
|
||
add_header ETag "1.96.0"; | ||
listen {{ .Values.opencost.ui.uiPort }}; | ||
listen [::]:{{ .Values.opencost.ui.uiPort }}; | ||
resolver 127.0.0.1 valid=5s; | ||
location /healthz { | ||
access_log /dev/null; | ||
return 200 'OK'; | ||
} | ||
location /model/ { | ||
proxy_connect_timeout 180; | ||
proxy_send_timeout 180; | ||
proxy_read_timeout 180; | ||
proxy_pass http://model/; | ||
proxy_redirect off; | ||
proxy_http_version 1.1; | ||
proxy_set_header Connection ""; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
} | ||
} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this specific configmap always necessary if opencost ui is enabled? My initial reaction is this should be a separate setting, but as long as its not going to be a breaking change for users I'm ok enabling it by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This configmap is added during runtime in
opencost-ui
image. Which has write permission issues in openshift environment. This change will not break with opencost-uiv1.114.0
in which @kastl-ars added an if condition in the entrypoint script there. We can get this in after bumping opencost-ui image to 1.114.0 . But as it can break for lower versions, should we keep it under a separate setting, considering that we can release it with ui image bump.