[*] 更新默认值
All checks were successful
Build Docker Image / Explore-Gitea-Actions (push) Successful in 10s
All checks were successful
Build Docker Image / Explore-Gitea-Actions (push) Successful in 10s
This commit is contained in:
parent
088a29f5be
commit
e7ce179d93
10
init-k8s.sh
10
init-k8s.sh
@ -2,9 +2,11 @@
|
|||||||
|
|
||||||
lsb_dist=$(cat /etc/*release | grep ^ID= | cut -d= -f2) # ubuntu or debian?
|
lsb_dist=$(cat /etc/*release | grep ^ID= | cut -d= -f2) # ubuntu or debian?
|
||||||
release=$(cat /etc/*release | grep VERSION_CODENAME | cut -d= -f2) # ubuntu(jammy oracular) debian(bookworm)....
|
release=$(cat /etc/*release | grep VERSION_CODENAME | cut -d= -f2) # ubuntu(jammy oracular) debian(bookworm)....
|
||||||
#
|
# 默认值
|
||||||
K8S_VERSION=${K8S_VERSION:-1.32} # 如果未设置,使用默认值 1.32
|
K8S_VERSION=${K8S_VERSION:-1.32} # 如果未设置,使用默认值 1.32
|
||||||
CONTAINERD_VERSION=${CONTAINERD_VERSION:-2.0.2} # 如果未设置,使用默认值 2.0.2
|
CONTAINERD_VERSION=${CONTAINERD_VERSION:-2.0.2} # 如果未设置,使用默认值 2.0.2
|
||||||
|
CALICO_VERSION=${CALICO_VERSION:-3.29.1} # 如果未设置,使用默认值 2.0.2
|
||||||
|
MIRRORS=${MIRRORS:-docker.martin98.com/k8s} # 如果未设置,默认使用集群镜像
|
||||||
|
|
||||||
# 更新 apt
|
# 更新 apt
|
||||||
curl -sSL https://git.martin98.com/MartinFarm/init/raw/branch/main/init-apt.sh | bash
|
curl -sSL https://git.martin98.com/MartinFarm/init/raw/branch/main/init-apt.sh | bash
|
||||||
@ -244,14 +246,14 @@ clusterName: kubernetes
|
|||||||
controlPlaneEndpoint: "$vip_ip:6443"
|
controlPlaneEndpoint: "$vip_ip:6443"
|
||||||
controllerManager: {}
|
controllerManager: {}
|
||||||
dns:
|
dns:
|
||||||
imageRepository: $mirrors/coredns
|
imageRepository: $MIRRORS/coredns
|
||||||
encryptionAlgorithm: RSA-2048
|
encryptionAlgorithm: RSA-2048
|
||||||
etcd:
|
etcd:
|
||||||
local:
|
local:
|
||||||
dataDir: /var/lib/etcd
|
dataDir: /var/lib/etcd
|
||||||
imageRepository: $mirrors
|
imageRepository: $MIRRORS
|
||||||
kind: ClusterConfiguration
|
kind: ClusterConfiguration
|
||||||
kubernetesVersion: $k8s_version
|
kubernetesVersion: $K8S_VERSION
|
||||||
networking:
|
networking:
|
||||||
dnsDomain: cluster.local
|
dnsDomain: cluster.local
|
||||||
podSubnet: $pod_subnet
|
podSubnet: $pod_subnet
|
||||||
|
@ -1,13 +1,14 @@
|
|||||||
## 初始化每个节点环境
|
## 初始化每个节点环境
|
||||||
### 配置 k8s 属性
|
|
||||||
```bash
|
```bash
|
||||||
# k8s containerd 版本
|
# 当前默认值
|
||||||
export K8S_VERSION=1.32
|
export K8S_VERSION=1.32
|
||||||
export CONTAINERD_VERSION=2.0.2
|
export CONTAINERD_VERSION=2.0.2
|
||||||
export CALICO_VERSION=3.29.1
|
export CALICO_VERSION=3.29.1
|
||||||
# 镜像源 k8s_version
|
export MIRRORS=docker.martin98.com/k8s
|
||||||
export mirrors=docker.martin98.com/k8s
|
```
|
||||||
export k8s_version=1.32.1
|
|
||||||
|
### 配置 k8s 属性
|
||||||
|
```bash
|
||||||
# 网段配置
|
# 网段配置
|
||||||
export pod_subnet=10.101.0.0/16
|
export pod_subnet=10.101.0.0/16
|
||||||
export service_subnet=10.100.0.0/16
|
export service_subnet=10.100.0.0/16
|
||||||
|
Loading…
x
Reference in New Issue
Block a user