sha256sum # 安装包 sha256sum 校验文件 kubeplay-v0.1.0-alpha.1-linux-amd64.tar.gz # 适用于 amd64 CPU 体系架构 kubeplay-v0.1.0-alpha.1-linux-arm64.tar.gz # 适用于 arm64 CPU 体系架构
解压
1 2 3
$ tar -xpf kubeplay-v0.1.0-alpha.1-linux-amd64.tar.gz $ cd kubeplay $ vi config.yaml
配置
config.yaml 配置文件主要分为如下几个部分
compose:nginx 和 registry 部署节点信息
kubespray:kubespray 部署配置
invenory:kubernetes 集群节点 ssh 登录信息
default:一些默认的参数
compose
参数
说明
示例
internal_ip
部署节点内网访问 IP
192.168.10.11
nginx_http_port
部署 nginx 服务暴露的端口
8080
registry_domain
部署 registry 镜像仓库服务的域名
kube.registry.local
1 2 3 4 5 6 7
compose: # Compose bootstrap node ip, default is local internal ip internal_ip:172.20.0.25 # Nginx http server bind port for download files and packages nginx_http_port:8080 # Registry domain for CRI runtime download images registry_domain:kube.registry.local
kubespray
参数
说明
示例
kube_version
kubernetes 版本号
v1.21.3
external_apiserver_access_ip
集群APIserver外部访问 IP
192.168.10.100
kube_network_plugin
选用 CNI 网络插件名称
calico
container_manager
容器运行时
containerd
etcd_deployment_type
etcd 部署方式
host
1 2 3 4 5 6 7 8 9 10 11 12 13 14
kubespray: # Kubernetes version by default, only support v1.20.6 kube_version:v1.21.3 # For deploy HA cluster you must configure a external apiserver access ip external_apiserver_access_ip:127.0.0.1 # Set network plugin to calico with vxlan mode by default kube_network_plugin:calico #Container runtime, only support containerd if offline deploy container_manager:containerd # Now only support host if use containerd as CRI runtime etcd_deployment_type:host # Settings for etcd event server etcd_events_cluster_setup:true etcd_events_cluster_enabled:true
inventory
inventory 为 kubernetes 集群节点的 ssh 登录配置,支持 yaml, json, ini 三种格式。
default: # NTP server ip address or domain, default is internal_ip ntp_server: -internal_ip # Registry ip address, default is internal_ip registry_ip:internal_ip # Offline resource url for download files, default is internal_ip:nginx_http_port offline_resources_url:internal_ip:nginx_http_port # Use nginx and registry provide all offline resources offline_resources_enabled:true # Image repo in registry image_repository:library # Kubespray container image for deploy user cluster or scale kubespray_image:"kubespray" # Auto generate self-signed certificate for registry domain generate_domain_crt:true # For nodes pull image, use 443 as default registry_https_port:443 # For push image to this registry, use 5000 as default, and only bind at 127.0.0.1 registry_push_port:5000 # Set false to disable download all container images on all nodes download_container:false