bump pwk to kube 1.27.2

Signed-off-by: Marcos Lilljedahl <marcosnils@gmail.com>
This commit is contained in:
Marcos Lilljedahl
2023-05-30 01:36:31 -03:00
parent a327b1926c
commit edd1ec41e4
8 changed files with 37 additions and 24 deletions

2
dockerfiles/k8s/.bashrc Normal file
View File

@@ -0,0 +1,2 @@
export PS1="[\h \W]$ "
cat /etc/motd

View File

@@ -5,7 +5,7 @@ COPY ./kubernetes.repo /etc/yum.repos.d/
RUN yum install -y kubectl-1.20.1 kubeadm-1.20.1 kubelet-1.20.1 \
RUN yum install -y kubectl-1.27.2 kubeadm-1.27.2 kubelet-1.27.2 \
#&& 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 bash-completion \
@@ -14,7 +14,7 @@ RUN yum install -y kubectl-1.20.1 kubeadm-1.20.1 kubelet-1.20.1 \
RUN curl -Lf -o /usr/bin/jq https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 \
&& curl -Lf -o /usr/bin/docker-compose https://github.com/docker/compose/releases/download/1.21.0/docker-compose-$(uname -s)-$(uname -m) \
&& chmod +x /usr/bin/jq /usr/bin/docker-compose
&& chmod +x /usr/bin/jq /usr/bin/docker-compose
VOLUME ["/var/lib/kubelet"]
@@ -25,11 +25,10 @@ COPY ./tokens.csv /etc/pki/tokens.csv
COPY ./daemon.json /etc/docker/
COPY ./resolv.conf.override /etc/
COPY ./docker.service /usr/lib/systemd/system/
COPY ./.bashrc /root/
COPY motd /etc/motd
RUN echo $'cat /etc/motd \n\
export PS1="[\h \W]$ "' >> /root/.bash_profile
RUN echo 'source <(kubectl completion bash)' >>~/.bashrc \
&& kubectl completion bash >> /etc/bash_completion.d/kubectl
@@ -39,5 +38,7 @@ RUN mkdir -p /root/.kube && ln -s /etc/kubernetes/admin.conf /root/.kube/config
WORKDIR /root
CMD mount --make-shared / && systemctl start docker && systemctl start kubelet \
&& while true; do bash -l; done
CMD mount --make-shared / \
&& systemctl start docker \
&& systemctl start kubelet \
&& while true; do script -q -c "/bin/bash -l" /dev/null; done

View File

@@ -1,8 +1,14 @@
{
"experimental": true,
"debug": true,
"log-level": "info",
"storage-driver": "vfs",
"insecure-registries": ["127.0.0.1"],
"hosts": ["unix:///var/run/docker.sock", "tcp://0.0.0.0:2375"]
"experimental": true,
"debug": true,
"cri-containerd": true,
"log-level": "info",
"tls": false,
"insecure-registries": [
"127.0.0.1"
],
"hosts": [
"unix:///var/run/docker.sock",
"tcp://0.0.0.0:2375"
]
}

View File

@@ -1,7 +1,6 @@
KUBELET_KUBECONFIG_ARGS=" --bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf"
KUBELET_SYSTEM_PODS_ARGS="--pod-manifest-path=/etc/kubernetes/manifests --pod-infra-container-image=k8s.gcr.io/pause:3.2"
KUBELET_NETWORK_ARGS="--network-plugin=cni --cni-conf-dir=/etc/cni/net.d --cni-bin-dir=/opt/cni/bin"
KUBELET_KUBECONFIG_ARGS="--bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf --kubeconfig=/etc/kubernetes/kubelet.conf"
KUBELET_SYSTEM_PODS_ARGS="--pod-manifest-path=/etc/kubernetes/manifests"
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_CGROUP_ARGS="--cgroup-driver=cgroupfs"
KUBELET_EXTRA_ARGS="--fail-swap-on=false --resolv-conf=/etc/resolv.conf.override"
KUBELET_EXTRA_ARGS="--fail-swap-on=false --resolv-conf=/etc/resolv.conf.override --container-runtime-endpoint /run/docker/containerd/containerd.sock "

View File

@@ -10,11 +10,11 @@
1. Initializes cluster master node:
kubeadm init --apiserver-advertise-address $(hostname -i) --pod-network-cidr 10.5.0.0/16
2. Initialize cluster networking:
kubectl apply -f https://raw.githubusercontent.com/cloudnativelabs/kube-router/master/daemonset/kubeadm-kuberouter.yaml
kubectl apply -f https://raw.githubusercontent.com/cloudnativelabs/kube-router/master/daemonset/kubeadm-kuberouter.yaml
3. (Optional) Create an nginx deployment:

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/bash
# Copyright 2017 Mirantis
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -138,10 +138,10 @@ fi
if [[ "$@" == "init"* || "$@" == "join"* ]]; then
# Call kubeadm with params and skip flag
/usr/bin/kubeadm "$@" --ignore-preflight-errors all
/usr/bin/kubeadm "$@" --ignore-preflight-errors all --cri-socket /run/docker/containerd/containerd.sock
else
# Call kubeadm with params
/usr/bin/kubeadm "$@"
/usr/bin/kubeadm "$@"
fi
# Frob cluster