Mounting Single File From Configuration Map In Kubernetes/Openshift Pod
Background
1. Create A Configuration Map
yudhi@Yudhis-MacBook-Pro ~ % oc project apifinance
Now using project "apifinance" on server "https://lb.osh.telkom.co.id:8443".
yudhi@Yudhis-MacBook-Pro ~ % oc get po
NAME READY STATUS RESTARTS AGE
finance-2-chm5g 1/1 Running 0 211d
finance-3-build 0/1 Completed 0 248d
financeapi-46-8wmfh 1/1 Running 0 30d
proxy-finest-10-1btmq 1/1 Running 0 58d
yudhi@Yudhis-MacBook-Pro ~ % oc rsh proxy-finest-10-1btmq
sh-4.4$ cd /etc/httpd
sh-4.4$ ls
conf conf.d conf.modules.d logs modules run state
sh-4.4$ cd conf.d
sh-4.4$ ls
README autoindex.conf php.conf ssl.conf userdir.conf welcome.conf
sh-4.4$ cat ssl.conf
#
# When we also provide SSL we have to listen to the
# standard HTTPS port in addition.
#
Listen 0.0.0.0:8443 https
##
## SSL Global Context
##
## All SSL configuration in this context applies both to
2. Mount the file from the configuration map into the original path.
3. Edit the deployment yaml to add subpath
volumeMounts:- mountPath: /etc/httpd/conf.d/ssl.confname: volume-38kso
volumeMounts:- mountPath: /etc/httpd/conf.d/ssl.confname: volume-38ksosubPath: ssl.conf
Thus these are the steps needed to mount a single file into an existing file in an existing directory in the pods.
Comments