The procedure of GITOPS methodology : update a Nginx config file ,leverage Open Shift ConfigMap - unix1998/technical_notes GitHub Wiki
Procedure Clone the configuration file repository to the local file system on the worker node:
shell command list : step 1 git clone https://github.com/your-repo/nginx-config.git cd nginx-config Update the ConfigMap in OpenShift with the new nginx.conf:
step2
oc delete configmap nginx-config
oc create configmap nginx-config --from-file=nginx.conf=./nginx.conf ( nginx.conf is new check-out file from github )
step 3 Restart the NGINX pods to apply the new configuration:
oc delete pod -l app=nginx
Explanation Step 1: Clone the repository containing the NGINX configuration file (nginx.conf) to the local file system on the worker node that have Nginx Pod and Container
Step 2: Update the ConfigMap in OpenShift with the new nginx.conf. This involves deleting the old ConfigMap and creating a new one with the updated file.
Step 3: Delete the NGINX pods to force them to restart. The Deployment controller will automatically recreate the pods, and the new pods will use the updated ConfigMap.
By following these steps, you ensure that your NGINX configuration in OpenShift is updated and applied correctly.