mount nginx.conf as subpath of /etc/nginx/nginx.conf

This change avoids the nginx-config volume mount being mounted as a directory into
/etc/nginx dir inside the pod container.
parent 95b7c62d
Pipeline #54692221 failed with stages
in 2 minutes and 4 seconds
......@@ -23,6 +23,9 @@ const (
// Mount path where nginx.conf will be placed
configMountPath = "/etc/nginx"
// Default configuration filename of nginx
configFileName = "nginx.conf"
// Mount path where certificate and key pair will be placed
certMountPath = configMountPath + "/certs"
......@@ -189,7 +192,8 @@ func setupConfig(conf *v1alpha1.ConfigRef, dep *appv1.Deployment) {
}
dep.Spec.Template.Spec.Containers[0].VolumeMounts = append(dep.Spec.Template.Spec.Containers[0].VolumeMounts, corev1.VolumeMount{
Name: "nginx-config",
MountPath: configMountPath,
MountPath: fmt.Sprintf("%s/%s", configMountPath, configFileName),
SubPath: configFileName,
})
switch conf.Kind {
case v1alpha1.ConfigKindConfigMap:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment