-
Notifications
You must be signed in to change notification settings - Fork 10
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
only create /etc/nginx/conf.d/default.nginx.conf if it does not yet exist (fix #4) #49
base: main
Are you sure you want to change the base?
Conversation
…f if it does not yet exist (fix opencost#4) Signed-off-by: Johannes Kastl <[email protected]>
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Hi @kastl-ars, Thank you! Could you help me understand how this change is useful when using OpenShift? With your workaround mentioned in this comment and without this PR change, I see that the OpenCost deployment succeeds, which is great. However, I think I might be missing something. In the original issue conversation, you noted:
Could you clarify why this is a problem we would want to address? Wouldn't the desired behavior be for the |
Thanks for your reply. I'll try to share my thoughts. With this PR, the entrypoint is fine if it finds that Without this PR, the entrypoint will try to write to
In either case, you need to maintain a configMap with the proper contents. But with this PR you would not need the I agree that this does only make the workaround a little easier, but does not solve the underlying problem. Maybe it would be better to remove the "create nginx.conf out of a template" and just have the helm chart create a configMap that gets mounted into the container at the right path. However, that would required changes to both the image and the helm chart. And not erroring out if the configuration file already exists would be one of those changes to the image, I guess. Does this make things a little clearer? |
thank you @kastl-ars.
fully support this ☝️ This will help while installing opencost in openshift environment. @jessegoodier should we take this up? any thoughts on this? |
@mittal-ishaan totally support this effort when you have the time. |
Without this PR, the entrypoint always writes to the conf file. So, you need to create the
Without this PR, what you have is an With this change, you can skip the Either way, you need to maintain the template or config file yourself and keep it in sync with the OpenCost development.
Yes, with this change it is enough to maintain the configuration file as a configMap.
That would be a proper solution and not just a workaround, but involves some more places than just this one script.
|
I have tested this that it has no effect on non-OpenShift users. In an OpenShift environment, creating a ConfigMap of either the template or the final nginx.conf file works as expected. Additionally, when creating a ConfigMap of the configuration file, there is no need to add an extra Now the following can also serves as a workaround for #4 skipping the extra extraVolumeMounts:
- name: empty-var-www
mountPath: /var/www
- name: opencost-ui-nginx-config-volume
mountPath: /etc/nginx/conf.d/default.nginx.conf
subPath: default.nginx.conf
extraVolumes:
- name: empty-var-www
emptyDir: {}
- name: opencost-ui-nginx-config-volume
configMap:
name: opencost-ui-nginx-config Thank you @kastl-ars |
What does this PR change?
The
docker-entrypoint.sh
does not create the/etc/nginx/conf.d/default.nginx.conf
file, if it already exist. This way, people can workaround issue #4 more easily by mounting the configuration file from a configMap. Not nice, but working...Does this PR relate to any other PRs?
No.
How will this PR impact users?
This should have no impact on normal users, other than helping users that want to have
readOnlyRootFilesystem
set to true or are using OpenShift.Does this PR address any GitHub or Zendesk issues?
Allows to workaround #4
How was this PR tested?
I cannot test this unfortunately.
Does this PR require changes to documentation?
If this is the only workaround to #4, then this could be documented in the helm chart.
Have you labeled this PR and its corresponding Issue as "next release" if it should be part of the next OpenCost release? If not, why not?
I have not labelled it, as I am not sure if this is a good idea to have this workaround or if this should be fixed properly...