Skip to content
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

Update kubeadm config version to v1beta3 #51

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
13 changes: 7 additions & 6 deletions auto-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,20 @@ sudo chmod +x version.sh download.sh && export kube_install_version="$k8s_versio
./download.sh "${cri}"

sudo chmod +x amd64/bin/kube* && sudo chmod +x arm64/bin/kube*
#download v0.9.1 sealer
sudo wget https://github.com/sealerio/sealer/releases/download/v0.9.1/sealer-v0.9.1-linux-amd64.tar.gz && tar -xvf sealer-v0.9.1-linux-amd64.tar.gz -C /usr/bin
#download v0.9.2 sealer
sudo wget https://github.com/sealerio/sealer/releases/download/v0.9.2/sealer-v0.9.2-linux-amd64.tar.gz && tar -xvf sealer-v0.9.2-linux-amd64.tar.gz -C /usr/bin
sudo sed -i "s/v1.19.8/$k8s_version/g" rootfs/etc/kubeadm.yml ##change k8s_version
sudo sed -i "s/v1.19.8/$k8s_version/g" rootfs/etc/kubeadm.yml.tmpl ##change k8s_version
if [[ "$cri" == "containerd" ]]; then sudo sed -i "s/\/var\/run\/dockershim.sock/\/run\/containerd\/containerd.sock/g" rootfs/etc/kubeadm.yml; fi
if [[ "$cri" == "containerd" ]]; then sudo sed -i "s/\/var\/run\/dockershim.sock/\/run\/containerd\/containerd.sock/g" rootfs/etc/kubeadm.yml.tmpl; fi
sudo sed -i "s/kubeadm.k8s.io\/v1beta2/$kubeadmApiVersion/g" rootfs/etc/kubeadm.yml
sudo sed -i "s/kubeadm.k8s.io\/v1beta2/$kubeadmApiVersion/g" rootfs/etc/kubeadm.yml.tmpl
sudo sed -i "s/kubeadm.k8s.io\/v1beta3/$kubeadmApiVersion/g" rootfs/etc/kubeadm.yml
sudo sed -i "s/kubeadm.k8s.io\/v1beta3/$kubeadmApiVersion/g" rootfs/etc/kubeadm.yml.tmpl
sudo ./"${ARCH}"/bin/kubeadm config images list --config "rootfs/etc/kubeadm.yml"
sudo mkdir -p rootfs/manifests
sudo ./"${ARCH}"/bin/kubeadm config images list --config "rootfs/etc/kubeadm.yml" 2>/dev/null | sed "/WARNING/d" >>imageList
if [ "$(sudo ./"${ARCH}"/bin/kubeadm config images list --config rootfs/etc/kubeadm.yml 2>/dev/null | grep -c "coredns/coredns")" -gt 0 ]; then sudo sed -i "s/#imageRepository/imageRepository/g" rootfs/etc/kubeadm.yml.tmpl; fi
sudo sed -i "s/k8s.gcr.io/sea.hub:5000/g" rootfs/etc/kubeadm.yml.tmpl
#if [ "$(sudo ./"${ARCH}"/bin/kubeadm config images list --config rootfs/etc/kubeadm.yml 2>/dev/null | grep -c "coredns/coredns")" -gt 0 ]; then sudo sed -i "s/#imageRepository/imageRepository/g" rootfs/etc/kubeadm.yml; fi
sudo sed -i "s/registry.k8s.io/sea.hub:5000/g" rootfs/etc/kubeadm.yml.tmpl
pauseImage=$(./"${ARCH}"/bin/kubeadm config images list --config "rootfs/etc/kubeadm.yml" 2>/dev/null | sed "/WARNING/d" | grep pause)
if [ -f "rootfs/etc/dump-config.toml" ]; then sudo sed -i "s/sea.hub:5000\/pause:3.6/$(echo "$pauseImage" | sed 's/\//\\\//g')/g" rootfs/etc/dump-config.toml; fi
sudo sealer build -t "docker.io/sealerio/kubernetes:${k8s_version}" -f Kubefile
Expand All @@ -108,4 +109,4 @@ if [[ "$push" == "true" ]]; then
sudo sealer login "$(echo "docker.io" | cut -d "/" -f1)" -u "${username}" -p "${password}"
fi
sudo sealer push "docker.io/sealerio/kubernetes:${k8s_version}"
fi
fi
10 changes: 5 additions & 5 deletions context/rootfs/etc/kubeadm.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: kubeadm.k8s.io/v1beta2
apiVersion: kubeadm.k8s.io/v1beta3
kind: InitConfiguration
localAPIEndpoint:
bindPort: 6443
Expand Down Expand Up @@ -31,7 +31,7 @@ apiServer:
name: localtime
pathType: File
readOnly: true
apiVersion: kubeadm.k8s.io/v1beta2
apiVersion: kubeadm.k8s.io/v1beta3
controllerManager:
extraArgs:
experimental-cluster-signing-duration: 876000h
Expand All @@ -44,13 +44,13 @@ controllerManager:
readOnly: true
dns:
type: ""
#imageRepository: sea.hub:5000/coredns
imageRepository: registry.k8s.io/coredns
etcd:
local:
dataDir: ""
extraArgs:
listen-metrics-urls: http://0.0.0.0:2381
imageRepository: k8s.gcr.io
imageRepository: registry.k8s.io
kind: ClusterConfiguration
kubernetesVersion: v1.19.8
networking:
Expand All @@ -66,7 +66,7 @@ scheduler:
pathType: File
readOnly: true
---
apiVersion: kubeadm.k8s.io/v1beta2
apiVersion: kubeadm.k8s.io/v1beta3
kind: JoinConfiguration
caCertPath: /etc/kubernetes/pki/ca.crt
discovery:
Expand Down
26 changes: 19 additions & 7 deletions context/rootfs/etc/kubeadm.yml.tmpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: kubeadm.k8s.io/v1beta2
apiVersion: kubeadm.k8s.io/v1beta3
kind: InitConfiguration
localAPIEndpoint:
advertiseAddress: 172.16.0.181
Expand Down Expand Up @@ -34,7 +34,7 @@ apiServer:
name: localtime
pathType: File
readOnly: true
apiVersion: kubeadm.k8s.io/v1beta2
apiVersion: kubeadm.k8s.io/v1beta3
controlPlaneEndpoint: apiserver.cluster.local:6443
controllerManager:
extraArgs:
Expand All @@ -48,7 +48,7 @@ controllerManager:
readOnly: true
dns:
type: ""
#imageRepository: {{or .RegistryURL "sea.hub:5000"}}/coredns
imageRepository: {{or .RegistryURL "sea.hub:5000"}}/coredns
etcd:
local:
dataDir: ""
Expand All @@ -70,6 +70,18 @@ scheduler:
pathType: File
readOnly: true

---
apiVersion: kubeadm.k8s.io/v1beta3
kind: JoinConfiguration
caCertPath: /etc/kubernetes/pki/ca.crt
discovery:
timeout: 5m0s
nodeRegistration:
criSocket: /var/run/dockershim.sock
controlPlane:
localAPIEndpoint:
bindPort: 6443

---
apiVersion: kubelet.config.k8s.io/v1beta1
authentication:
Expand All @@ -85,7 +97,7 @@ authorization:
webhook:
cacheAuthorizedTTL: 5m0s
cacheUnauthorizedTTL: 30s
cgroupDriver: cgroupfs
cgroupDriver: systemd
cgroupsPerQOS: true
clusterDomain: cluster.local
configMapAndSecretChangeDetectionStrategy: Watch
Expand All @@ -99,7 +111,7 @@ cpuManagerReconcilePeriod: 10s
enableControllerAttachDetach: true
enableDebuggingHandlers: true
enforceNodeAllocatable:
- pods
- pods
eventBurst: 10
eventRecordQPS: 5
evictionHard:
Expand Down Expand Up @@ -172,7 +184,7 @@ iptables:
syncPeriod: 0s
ipvs:
excludeCIDRs:
- 10.103.97.2/32
- 10.103.97.2/32
minSyncPeriod: 0s
scheduler: ""
strictARP: false
Expand All @@ -191,4 +203,4 @@ udpIdleTimeout: 0s
winkernel:
enableDSR: false
networkName: ""
sourceVip: ""
sourceVip: ""