Kubernetes: save configuration directory outside container

8/30/2018

What is the best way for mounting a configuration directory such as /etc/apache2 as a volume in kubernetes? The pod containing apache2 container may be scheduled in different nodes. I want to persist the configuration files between container restarts.

-- Nimsa
kubernetes
persistent-volumes

1 Answer

8/30/2018

You can use Configmap to achieve this. You can create the Configmap from your apache config directory. This is the official documentation which should cover how you can configure it and add to your Pod: https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#create-configmaps-from-directories

-- Shah Zobair
Source: StackOverflow