Skip to content

Use Kubelet config #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 33 additions & 16 deletions pkg/kubelet/kubelet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,29 @@ done

echo "kubelet.sh: ${await} has arrived" 2>&1

if [ -f "/run/config/kubelet-config.json" ]; then
echo "Found kubelet configuration from /run/config/kubelet-config.json"
else
echo "Generate kubelet configuration to /run/config/kubelet-config.json"
: ${KUBE_CLUSTER_DNS:='"10.96.0.10"'}
cat > /run/config/kubelet-config.json << EOF
{
"kind": "KubeletConfiguration",
"apiVersion": "kubelet.config.k8s.io/v1beta1",
"staticPodPath": "/etc/kubernetes/manifests",
"clusterDNS": [
${KUBE_CLUSTER_DNS}
],
"clusterDomain": "cluster.local",
"cgroupsPerQOS": false,
"enforceNodeAllocatable": [],
"kubeReservedCgroup": "podruntime",
"systemReservedCgroup": "systemreserved",
"cgroupRoot": "kubepods"
}
EOF
fi

mkdir -p /etc/kubernetes/manifests

# If using --cgroups-per-qos then need to use --cgroup-root=/ and not
Expand All @@ -71,19 +94,13 @@ mkdir -p /etc/kubernetes/manifests
# - /usr/bin/kubelet.sh
# - --cgroup-root=/
# - --cgroups-per-qos
exec kubelet --kubeconfig=/etc/kubernetes/kubelet.conf \
--bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf \
--pod-manifest-path=/etc/kubernetes/manifests \
--allow-privileged=true \
--cluster-dns=10.96.0.10 \
--cluster-domain=cluster.local \
--cgroups-per-qos=false \
--enforce-node-allocatable= \
--network-plugin=cni \
--cni-conf-dir=/etc/cni/net.d \
--cni-bin-dir=/opt/cni/bin \
--cadvisor-port=0 \
--kube-reserved-cgroup=podruntime \
--system-reserved-cgroup=systemreserved \
--cgroup-root=kubepods \
$KUBELET_ARGS $@
exec kubelet \
--config=/run/config/kubelet-config.json \
--kubeconfig=/etc/kubernetes/kubelet.conf \
--bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf \
--allow-privileged=true \
--network-plugin=cni \
--cni-conf-dir=/etc/cni/net.d \
--cni-bin-dir=/opt/cni/bin \
--cadvisor-port=0 \
$KUBELET_ARGS $@
2 changes: 1 addition & 1 deletion yml/kube.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ services:
image: linuxkit/sshd:5544de2376475f6685e12bdc10bfe49f4695873a
cgroupsPath: systemreserved/sshd
- name: kubelet
image: linuxkit/kubelet:bcff9a97b3ecaf204ca7ee122f5a071a3dc97d4c
image: linuxkit/kubelet:9aed4553dba72f8424da7b3b3029e3974a5bea7b
cgroupsPath: podruntime/kubelet
files:
- path: etc/linuxkit.yml
Expand Down