apiVersion: kubeadm.k8s.io/v1beta2
kind: InitConfiguration
localAPIEndpoint:
advertiseAddress: 192.168.10.241
bindPort: 6443
nodeRegistration:
criSocket: /var/run/dockershim.sock
name: master01
taints:
- effect: NoSchedule
key: node-role.kubernetes.io/master
---
apiVersion: kubeadm.k8s.io/v1beta2
kind: ClusterConfiguration
kubernetesVersion: v1.15.0
imageRepository: gcr.azk8s.cn/google_containers
apiServer:
# extraArgs:
# authorization-mode: "Node,RBAC"
certSANs:
- "master01"
- "master02"
- "master03"
- "192.168.10.241"
- "192.168.10.242"
- "192.168.10.243"
- "192.168.10.240"
- "127.0.0.1"
controlPlaneEndpoint: "192.168.10.240:8443"
dns:
type: CoreDNS
etcd:
local:
extraArgs:
listen-client-urls: "https://127.0.0.1:2379,https://192.168.10.241:2379"
advertise-client-urls: "https://192.168.10.241:2379"
listen-peer-urls: "https://192.168.10.241:2380"
initial-advertise-peer-urls: "https://192.168.10.241:2380"
initial-cluster: "master01=https://192.168.10.241:2380"
serverCertSANs:
- master01
- 192.168.10.241
peerCertSANs:
- master01
- 192.168.10.241
# external:
# endpoints:
# - https://192.168.10.241:2379
# - https://192.168.10.242:2379
# - https://192.168.10.243:2379
networking:
dnsDomain: cluster.local
podSubnet: "10.244.0.0/16"
---
apiVersion: kubeproxy.config.k8s.io/v1alpha1
kind: KubeProxyConfiguration
mode: "ipvs"
#使用默认配置生成配置文件kubeadm config print init-defaults > k8s-init-master01.yaml
#手动修改补全k8s-init-master01.yaml所需要的内容
#提前拉取镜像kubeadm config images pull --config k8s-init-master01.yaml
#初始化安装kubeadm init --config k8s-init-master01.yaml