kubeadm init文件

# kubeadm init --config kubeadm-init.yaml #基于文件执行 k8s master 初始化
apiVersion: kubeadm.k8s.io/v1beta2
bootstrapTokens:
- groups:
  - system:bootstrappers:kubeadm:default-node-token
  token: abcdef.0123456789abcdef
  ttl: 48h0m0s #token有郊期
  usages:
  - signing
  - authentication
kind: InitConfiguration
localAPIEndpoint:
  advertiseAddress: 172.31.3.101   #本机IP和端口
  bindPort: 6443
nodeRegistration:
  criSocket: /var/run/dockershim.sock
  name: kubeadm-master1.magedu.net  #本机服务器名称
  taints:
  - effect: NoSchedule
    key: node-role.kubernetes.io/master
---
apiServer:
  timeoutForControlPlane: 4m0s
apiVersion: kubeadm.k8s.io/v1beta2
certificatesDir: /etc/kubernetes/pki
clusterName: kubernetes
controlPlaneEndpoint: 172.31.3.248:6443 #添加基于 VIP 的 Endpoint
controllerManager: {}
dns:
  type: CoreDNS  #DNS
etcd:
  local:
    dataDir: /var/lib/etcd
imageRepository: registry.cn-hangzhou.aliyuncs.com/google_containers  #镜像仓库地址
kind: ClusterConfiguration
kubernetesVersion: v1.17.2 #K8S版本
networking:# k8s 内部域名  pod网段和service网络
  dnsDomain: linux39.local
  podSubnet: 10.10.0.0/16
  serviceSubnet: 192.168.0.0/20
scheduler: {}

 

posted @ 2023-02-28 16:42  yuanbangchen  阅读(125)  评论(0编辑  收藏  举报