mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-22 10:31:35 +00:00
kubernetes: allow yaml to be provided via metadata
Previously the network policy yaml had to be hard-coded in the image. This patch allows the policy to be added via the metadata directories: - /var/config/cni/etc/net.d/ - /var/config/kube-system.init/ Signed-off-by: David Scott <dave.scott@docker.com>
This commit is contained in:
parent
815d8da2ed
commit
eb7eff8ad7
@ -10,7 +10,13 @@ if [ -f /etc/kubeadm/kubeadm.yaml ]; then
|
|||||||
else
|
else
|
||||||
kubeadm init --skip-preflight-checks --kubernetes-version @KUBERNETES_VERSION@ $@
|
kubeadm init --skip-preflight-checks --kubernetes-version @KUBERNETES_VERSION@ $@
|
||||||
fi
|
fi
|
||||||
for i in /etc/kubeadm/kube-system.init/*.yaml ; do
|
|
||||||
|
if [ -d /var/config/cni/etc/net.d ]; then
|
||||||
|
cp /var/config/cni/etc/net.d/* /var/lib/cni/etc/net.d/
|
||||||
|
fi
|
||||||
|
# sorting by basename relies on the dirnames having the same number of directories
|
||||||
|
YAML=$(ls -1 /var/config/kube-system.init/*.yaml /etc/kubeadm/kube-system.init/*.yaml 2>/dev/null | sort --field-separator=/ --key=5)
|
||||||
|
for i in ${YAML}; do
|
||||||
n=$(basename "$i")
|
n=$(basename "$i")
|
||||||
if [ -e "$i" ] ; then
|
if [ -e "$i" ] ; then
|
||||||
if [ ! -s "$i" ] ; then # ignore zero sized files
|
if [ ! -s "$i" ] ; then # ignore zero sized files
|
||||||
|
Loading…
Reference in New Issue
Block a user