1
0
mirror of https://github.com/rancher/rke.git synced 2025-06-25 06:53:02 +00:00
rke/package/kubectl/entrypoint.sh
moelsayed babe95f183 add network plugin support
add template configration through env variables

add kubedns addon
2017-11-08 01:59:12 +02:00

23 lines
532 B
Bash
Executable File

#!/bin/bash -x
# Set template configration
for i in $(env | grep -o RKE_.*=); do
key=$(echo "$i" | cut -f1 -d"=")
value=$(echo "${!key}")
for f in /network/*.yaml /addons/*.yaml; do
sed -i "s|${key}|${value}|g" ${f}
done
done
for i in $(env | grep -o KUBECFG_.*=); do
name="$(echo "$i" | cut -f1 -d"=" | tr '[:upper:]' '[:lower:]' | tr '_' '-').yaml"
env=$(echo "$i" | cut -f1 -d"=")
value=$(echo "${!env}")
if [ ! -f $SSL_CRTS_DIR/$name ]; then
echo "$value" > /root/.kube/config
fi
done
kubectl ${@}