mirror of https://github.com/k3s-io/k3s
Fix some settings of trusty nodes
It fixes kubelet and kube-proxy command line options, fixes a typo, and adds installation of nsenter package if it is not present.pull/6/head
parent
f21a6e9a93
commit
11c823abd8
|
@ -43,17 +43,21 @@ script
|
||||||
|
|
||||||
# Create the kubelet kubeconfig file.
|
# Create the kubelet kubeconfig file.
|
||||||
. /etc/kube-env
|
. /etc/kube-env
|
||||||
|
if [ -z "${KUBELET_CA_CERT}" ]; then
|
||||||
|
KUBELET_CA_CERT="${CA_CERT}"
|
||||||
|
fi
|
||||||
cat > /var/lib/kubelet/kubeconfig << EOF
|
cat > /var/lib/kubelet/kubeconfig << EOF
|
||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Config
|
kind: Config
|
||||||
users:
|
users:
|
||||||
- name: kubelet
|
- name: kubelet
|
||||||
user:
|
user:
|
||||||
token: ${KUBELET_TOKEN}
|
client-certificate-data: ${KUBELET_CERT}
|
||||||
|
client-key-data: ${KUBELET_KEY}
|
||||||
clusters:
|
clusters:
|
||||||
- name: local
|
- name: local
|
||||||
cluster:
|
cluster:
|
||||||
insecure-skip-tls-verify: true
|
certificate-authority-data: ${KUBELET_CA_CERT}
|
||||||
contexts:
|
contexts:
|
||||||
- context:
|
- context:
|
||||||
cluster: local
|
cluster: local
|
||||||
|
@ -73,7 +77,7 @@ users:
|
||||||
clusters:
|
clusters:
|
||||||
- name: local
|
- name: local
|
||||||
cluster:
|
cluster:
|
||||||
insecure-skip-tls-verify: true
|
certificate-authority-data: ${CA_CERT}
|
||||||
contexts:
|
contexts:
|
||||||
- context:
|
- context:
|
||||||
cluster: local
|
cluster: local
|
||||||
|
@ -113,6 +117,31 @@ script
|
||||||
fi
|
fi
|
||||||
end script
|
end script
|
||||||
|
|
||||||
|
--===============6024533374511606659==
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/upstart-job; charset="us-ascii"
|
||||||
|
Content-Transfer-Encoding: 7bit
|
||||||
|
Content-Disposition: attachment; filename="kube-install-additional-packages.conf"
|
||||||
|
|
||||||
|
#upstart-job
|
||||||
|
|
||||||
|
description "Install additional packages used by kubernetes"
|
||||||
|
|
||||||
|
start on started docker
|
||||||
|
|
||||||
|
script
|
||||||
|
# Installation of nsenter through a docker container may be slow. We move it
|
||||||
|
# here to be in parallel with instllation of other packages, so as to reduce
|
||||||
|
# the cluster creation time.
|
||||||
|
if ! which nsenter > /dev/null; then
|
||||||
|
echo "Do not find nsenter. Install it."
|
||||||
|
# Note: this is an easy way to install nsenter, but may not be the fastest way.
|
||||||
|
# In addition, this may not be a trusted source. So, replace it if we have a
|
||||||
|
# better solution.
|
||||||
|
docker run --rm -v /usr/local/bin:/target jpetazzo/nsenter
|
||||||
|
fi
|
||||||
|
end script
|
||||||
|
|
||||||
--===============6024533374511606659==
|
--===============6024533374511606659==
|
||||||
MIME-Version: 1.0
|
MIME-Version: 1.0
|
||||||
Content-Type: text/upstart-job; charset="us-ascii"
|
Content-Type: text/upstart-job; charset="us-ascii"
|
||||||
|
@ -127,7 +156,7 @@ start on stopped kube-env
|
||||||
|
|
||||||
script
|
script
|
||||||
. /etc/kube-env
|
. /etc/kube-env
|
||||||
# If kubelet or kube-proxy is not stalled in the image, pull release binaries and put them in /usr/bin.
|
# If kubelet or kube-proxy is not installed in the image, pull release binaries and put them in /usr/bin.
|
||||||
if ! which kubelet > /dev/null || ! which kube-proxy > /dev/null; then
|
if ! which kubelet > /dev/null || ! which kube-proxy > /dev/null; then
|
||||||
cd /tmp
|
cd /tmp
|
||||||
k8s_sha1="${SERVER_BINARY_TAR_URL##*/}.sha1"
|
k8s_sha1="${SERVER_BINARY_TAR_URL##*/}.sha1"
|
||||||
|
@ -196,8 +225,8 @@ script
|
||||||
--config=/etc/kubernetes/manifests \
|
--config=/etc/kubernetes/manifests \
|
||||||
--allow-privileged=false \
|
--allow-privileged=false \
|
||||||
--v=2 \
|
--v=2 \
|
||||||
--cluster-dns=10.0.0.10 \
|
--cluster-dns=${DNS_SERVER_IP} \
|
||||||
--cluster-domain=cluster.local \
|
--cluster-domain=${DNS_DOMAIN} \
|
||||||
--configure-cbr0=true \
|
--configure-cbr0=true \
|
||||||
--cgroup-root=/ \
|
--cgroup-root=/ \
|
||||||
--system-container=/system
|
--system-container=/system
|
||||||
|
@ -241,7 +270,10 @@ Content-Disposition: attachment; filename="kube-docker.conf"
|
||||||
|
|
||||||
description "Restart docker daemon"
|
description "Restart docker daemon"
|
||||||
|
|
||||||
start on started kubelet
|
# The condition "stopped kube-install-additional-packages" is to avoid
|
||||||
|
# breaking nsenter installation, which is through a docker container.
|
||||||
|
# It can be removed if we find a better way to install nsenter.
|
||||||
|
start on started kubelet and stopped kube-install-additional-packages
|
||||||
|
|
||||||
script
|
script
|
||||||
. /etc/kube-env
|
. /etc/kube-env
|
||||||
|
|
Loading…
Reference in New Issue