You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a number of services exist as helm charts which require a configuration file that I want to mount as a file inside a pod. I would like to keep the configuration file as a standalone file in my git repo for ease of version control and editing. I would rather not add the file contents to the HelmRelease.spec.values.
I'm sure this has been done many times, but cannot find many examples. I have found a way to make it work, but it looks more complex and requires more files than I expected.
I assume the best way is to create a configmap from the configuration file, then mount that as a volume in the pod. Below is my attempt at doing it using an nginx helm chart, though I am using this only as an example, which is why I am not using the defaultBackend.serverBlockConfig parameters.
# Shortened for sake of example
worker_processes 1;
events {
worker_connections 1024;
}
http {
server {
listen 80;
location / {
return 200 "OK\n";
}
}
}
I want to keep all of the helm charts in individual repos (some are not my charts either), and have a single repo that Flux uses to deploy everything from.
Am I going about this in the right way? Is there a better strategy?
I am currently deploying this by running kubectl apply -k . - will this work the same way when I put it into a git repo and let flux manage it?
Is it possible to simplify the configuration or merge the kustomize files into the nginx.yaml file?
Thanks for your help!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have a number of services exist as helm charts which require a configuration file that I want to mount as a file inside a pod. I would like to keep the configuration file as a standalone file in my git repo for ease of version control and editing. I would rather not add the file contents to the HelmRelease.spec.values.
I'm sure this has been done many times, but cannot find many examples. I have found a way to make it work, but it looks more complex and requires more files than I expected.
I assume the best way is to create a configmap from the configuration file, then mount that as a volume in the pod. Below is my attempt at doing it using an nginx helm chart, though I am using this only as an example, which is why I am not using the
defaultBackend.serverBlockConfig
parameters.kustomization.yaml
kustomizeconfig.yaml
nginx.yaml
nginx.conf
I want to keep all of the helm charts in individual repos (some are not my charts either), and have a single repo that Flux uses to deploy everything from.
kubectl apply -k .
- will this work the same way when I put it into a git repo and let flux manage it?Thanks for your help!
Beta Was this translation helpful? Give feedback.
All reactions