0

Our nginx controller does not support the SSL from windows 7 systems. We updated the cipher suites in the nginx.conf file in Kubernetes Nginx pods, and it started to work.

Now the issue is whenever the service restarts or the pod restarts the nginx.conf file resets to the default one.

How can we set the nginx.conf file permanently?

Daniel Lenz
  • 3,334
  • 17
  • 36
  • create a custom nginx image using the same nginx currently being used and then replace the nginx.conf with the nginx.conf having your changes. Save the custom image to your docker registry and use that image instead of the default nginx image. – abhishek phukan Jun 14 '21 at 07:05

1 Answers1

1

Create a config map for your nginx.conf and attached it to your pod in specific location.

Create config map by running the bellow command.

kubectl create configmap nginx-conf --from-file=nginx.conf

And attached it in specific directory.

apiVersion: v1
kind: Pod
metadata:
  name: test
spec:
  containers:
    - name: test-container
      image: k8s.gcr.io/busybox
      command: [ "/bin/sh", "-c", "ls /etc/config/" ]
      volumeMounts:
      - name: nginx-config
        mountPath: /etc/nginx/
  volumes:
    - name: nginx-config
      configMap:
        # Provide the name of the ConfigMap containing the files you want
        # to add to the container
        name: nginx-config //your config map name here
  restartPolicy: Never
Taybur Rahman
  • 1,347
  • 8
  • 20