Skip to content

Commit

Permalink
Add support for k8s 1.12.1
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosnils committed Oct 20, 2018
1 parent 1c6e5a7 commit 1de2ca7
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
3 changes: 2 additions & 1 deletion dockerfiles/k8s/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ COPY ./kubernetes.repo /etc/yum.repos.d/



RUN yum install -y kubectl-1.8.11-0 kubeadm-1.8.11-0 \
RUN yum install -y kubectl-1.12.1-0 kubeadm-1.12.1-0 \
&& mv -f /etc/systemd/system/kubelet.service.d/10-kubeadm.conf /etc/systemd/system/kubelet.service \
&& yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo \
&& yum install -y docker-ce git \
Expand All @@ -21,6 +21,7 @@ COPY ./kube* /etc/systemd/system/
COPY ./wrapkubeadm.sh /usr/local/bin/kubeadm
COPY ./tokens.csv /etc/pki/tokens.csv
COPY ./daemon.json /etc/docker/
COPY ./resolv.conf.override /etc/

COPY motd /etc/motd

Expand Down
3 changes: 1 addition & 2 deletions dockerfiles/k8s/kubelet.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ KUBELET_SYSTEM_PODS_ARGS="--pod-manifest-path=/etc/kubernetes/manifests --allow-
KUBELET_NETWORK_ARGS="--network-plugin=cni --cni-conf-dir=/etc/cni/net.d --cni-bin-dir=/opt/cni/bin"
KUBELET_DNS_ARGS="--cluster-dns=10.96.0.10 --cluster-domain=cluster.local"
KUBELET_AUTHZ_ARGS="--authorization-mode=Webhook --client-ca-file=/etc/kubernetes/pki/ca.crt"
KUBELET_CADVISOR_ARGS="--cadvisor-port=0"
KUBELET_CGROUP_ARGS="--cgroup-driver=cgroupfs"
KUBELET_EXTRA_ARGS="--fail-swap-on=false"
KUBELET_EXTRA_ARGS="--fail-swap-on=false --resolv-conf=/etc/resolv.conf.override"
2 changes: 1 addition & 1 deletion dockerfiles/k8s/kubelet.service
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[Service]
Restart=always
EnvironmentFile=/etc/systemd/system/kubelet.env
ExecStart=/usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_SYSTEM_PODS_ARGS $KUBELET_NETWORK_ARGS $KUBELET_DNS_ARGS $KUBELET_AUTHZ_ARGS $KUBELET_CADVISOR_ARGS $KUBELET_CGROUP_ARGS $KUBELET_EXTRA_ARGS
ExecStart=/usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_SYSTEM_PODS_ARGS $KUBELET_NETWORK_ARGS $KUBELET_DNS_ARGS $KUBELET_AUTHZ_ARGS $KUBELET_CGROUP_ARGS $KUBELET_EXTRA_ARGS
2 changes: 1 addition & 1 deletion dockerfiles/k8s/systemctl
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ function action_restart(){
local UNIT_FILE=$1
local UNIT_INSTANCE=$2
action_start $UNIT_FILE $UNIT_INSTANCE
action_stop $UNIT_FILE $UNIT_INSTANCE
action_start $UNIT_FILE $UNIT_INSTANCE
}
Expand Down
9 changes: 8 additions & 1 deletion dockerfiles/k8s/wrapkubeadm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ function dind::proxy-cidr-and-no-conntrack {
}


# Adds route to defualt eth0 interface so 10.96.x.x can go through
function dind::add-route {
route add 10.96.0.0/16 dev eth0
}



function dind::join-filters {
local IFS="|"
Expand Down Expand Up @@ -118,6 +124,7 @@ function dind::frob-cluster {
dind::frob-apiserver
dind::wait-for-apiserver
dind::frob-proxy
dind::add-route
}

# Weave depends on /etc/machine-id being unique
Expand All @@ -128,7 +135,7 @@ fi

if [[ "$@" == "init"* || "$@" == "join"* ]]; then
# Call kubeadm with params and skip flag
/usr/bin/kubeadm "$@" --skip-preflight-checks
/usr/bin/kubeadm "$@" --ignore-preflight-errors all
else
# Call kubeadm with params
/usr/bin/kubeadm "$@"
Expand Down

0 comments on commit 1de2ca7

Please sign in to comment.