49 lines
1.2 KiB
Markdown
49 lines
1.2 KiB
Markdown
|
**vim kubeadm-config.yaml**
|
||
|
|
||
|
````
|
||
|
apiVersion: kubeadm.k8s.io/v1beta3
|
||
|
bootstrapTokens:
|
||
|
- groups:
|
||
|
- system:bootstrappers:kubeadm:default-node-token
|
||
|
token: 7t2weq.bjbawausm0jaxury
|
||
|
ttl: 24h0m0s
|
||
|
usages:
|
||
|
- signing
|
||
|
- authentication
|
||
|
kind: InitConfiguration
|
||
|
localAPIEndpoint:
|
||
|
advertiseAddress: 192.168.236.201
|
||
|
bindPort: 6443
|
||
|
nodeRegistration:
|
||
|
# criSocket: /var/run/dockershim.sock # 如果是Docker作为Runtime配置此项
|
||
|
criSocket: /run/containerd/containerd.sock # 如果是Containerd作为Runtime配置此项
|
||
|
name: k8s-master01
|
||
|
taints:
|
||
|
- effect: NoSchedule
|
||
|
key: node-role.kubernetes.io/master
|
||
|
---
|
||
|
apiServer:
|
||
|
certSANs:
|
||
|
- 192.168.236.236
|
||
|
timeoutForControlPlane: 4m0s
|
||
|
apiVersion: kubeadm.k8s.io/v1beta2
|
||
|
certificatesDir: /etc/kubernetes/pki
|
||
|
clusterName: kubernetes
|
||
|
controlPlaneEndpoint: 192.168.236.236:16443
|
||
|
controllerManager: {}
|
||
|
dns:
|
||
|
type: CoreDNS
|
||
|
etcd:
|
||
|
local:
|
||
|
dataDir: /var/lib/etcd
|
||
|
imageRepository: registry.cn-hangzhou.aliyuncs.com/google_containers
|
||
|
kind: ClusterConfiguration
|
||
|
kubernetesVersion: v1.22.0 # 更改此处的版本号和kubeadm version一致
|
||
|
networking:
|
||
|
dnsDomain: cluster.local
|
||
|
podSubnet: 172.16.0.0/12
|
||
|
serviceSubnet: 192.168.0.0/16
|
||
|
scheduler: {}
|
||
|
````
|
||
|
|