Kubernetes:保存容器外的配置目录

问题描述 投票:0回答:1

将配置目录(如/ etc / apache2)作为卷添加到kubernetes中的最佳方法是什么?包含apache2容器的pod可以在不同的节点中调度。我想在容器重启之间保留配置文件。

kubernetes persistent-volumes
1个回答
0
投票

您可以使用Configmap来实现此目的。您可以从apache config目录创建Configmap。这是官方文档,应该包括如何配置它并添加到您的Pod:https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#create-configmaps-from-directories

© www.soinside.com 2019 - 2024. All rights reserved.