apiVersion:kubekey.kubesphere.io/v1 kind:Config spec: # If set to "cn", online downloads will prioritize domestic sources when available. zone:"cn"## 此处很重要,如果填会导致你的镜像下载不成功 kubernetes: # Specify the Kubernetes version to be installed. kube_version:v1.34.3 # Specify the Helm version to be installed. helm_version:v3.18.5 # Tag for the sandbox (pause) image used by pods. sandbox_image: tag:"3.10.1" control_plane_endpoint: # Supported HA types: local, kube-vip, haproxy. # If set to local, configure local hostname resolution as follows: # - Control-plane nodes: 127.0.0.1 .kubernetes.control_plane_endpoint.host # - Worker nodes: .init_kubernetes_node .kubernetes.control_plane_endpoint.host type:local # Kube-vip image tag used for static pod deployment (when type is kube-vip). kube_vip: image: tag:v0.7.2 # HAProxy image tag used for static pod deployment (when type is haproxy). haproxy: image: tag:2.9.6-alpine etcd: # Specify the etcd version to be installed. etcd_version:v3.6.5 image_registry: # Image registry type to install. Supported: harbor, docker-registry. # Leave empty to skip installation (assuming an existing registry is available). type:"" # auth: # # Address of the private image registry. Format: host:port/project # # The port (if present) is used as http_port when plain_http=true, # # or as https_port when plain_http=false. # registry: "dockerhub.kubekey.local" # # Use plain HTTP (no TLS). Default is false. # plain_http: false # username: admin # password: Harbor12345 # Specify a VIP for image registry high availability. If set, enables HA. ha_vip:"" # ========== Image Registry - High Availability ========== # keepalived image tag for load balancing when multiple registry nodes exist. # keepalived_version: 2.3.4 # ========== Image Registry - Harbor ========== # Image registry port settings. Usually you do not need to set them manually; # they are derived from image_registry.auth.registry and plain_http. # http_port: 80 # https_port: 443 # Harbor image tag (only valid if type is harbor). #harbor_version: v2.10.2 # docker-compose binary #dockercompose_version: v2.20.3 # ========== Image Registry - Docker Registry ========== # Docker Registry image tag (only valid if type is docker-registry). # docker_registry_version: 2.8.3 cri: # Container runtime type. Supported: containerd, docker. container_manager:containerd # ========== CRI Tool ========== # crictl binary version. crictl_version:v1.34.0 # ========== Docker Runtime ========== # Docker binary version. #docker_version: 25.0.5 # cridockerd version (required for Kubernetes 1.24+). # cridockerd_version: v0.3.21 # ========== Containerd Runtime ========== # containerd binary version (active only when container_manager is containerd). # containerd_version: v1.7.13 # runc binary version (active only when container_manager is containerd). # runc_version: v1.1.12 cni: # CNI plugin type. Supported: calico, cilium, flannel, hybridnet, kubeovn, other type:calico # ========== Multi-CNI ========== # Multi-CNI type. Supported: multus, spiderpool, none. multi_cni:none # ========== Multi-CNI - Multus ========== # Image tag for Multus (configure if needed). # multus: # image: # tag: v4.2.4 # ========== Multi-CNI - Spiderpool ========== # Spiderpool version (configure if needed). # spiderpool_version: v1.1.1 # ========== Calico CNI ========== # Calico version (effective only when type is calico). calico_version:v3.31.3 # ========== Cilium CNI ========== # Cilium version (effective only when type is cilium). # cilium_version: 1.19.1 # ========== Flannel CNI ========== # Flannel version (effective only when type is flannel). #flannel_version: v0.27.4 # ========== Kube-OVN CNI ========== # Kube-OVN version (effective only when type is kubeovn). #kubeovn_version: v1.15.0 # ========== Hybridnet CNI ========== # Hybridnet version (effective only when type is hybridnet). #hybridnet_version: 0.6.8 storage_class: # ========== Storage Class Configuration ========== # ========== Local/OpenEBS Storage Class ========== # Local storage class settings. local: enabled:true# Enable the local storage class. default:true# Set as the default storage class. # openebs/dynamic-localpv-provisioner helm chart version. localpv_provisioner_version:4.4.0 # ========== NFS Storage Class ========== nfs: enabled:false# Enable the NFS storage class. # nfs-provisioner Helm chart version. #nfs_provisioner_version: 4.0.18 dns: # CoreDNS settings. coredns: image: tag:v1.12.1 # NodeLocalDNS settings. nodelocaldns: enabled:true image: tag:1.26.4 # the external images will to add in packages
初始化OS依赖
kubekey版本低于4.0
1
./kk init os -f config-sample.yaml
kubekey版本高于4.0
1
./kk init os -i inventory.yaml -c config-<Kubernetes version>.yaml
# 可以修改成自己的镜像仓库 registry_host: "swr.cn-north-4.myhuaweicloud.com/ddn-k8s/" # 修改成自己nginx服务器的IP地址+目录 files_repo: "http://IP/download/" ### If using CentOS, RedHat, AlmaLinux or Fedora # yum_repo: "http://myinternalyumrepo" ### If using Debian # debian_repo: "http://myinternaldebianrepo" ### If using Ubuntu # ubuntu_repo: "http://myinternalubunturepo"
## [Optional] etcd: only if you use etcd_deployment=host etcd_download_url: "{{ files_repo }}/github.com/etcd-io/etcd/releases/download/v{{ etcd_version }}/etcd-v{{ etcd_version }}-linux-{{ image_arch }}.tar.gz"
# [Optional] Calico: If using Calico network plugin calicoctl_download_url: "{{ files_repo }}/github.com/projectcalico/calico/releases/download/v{{ calico_ctl_version }}/calicoctl-linux-{{ image_arch }}" # [Optional] Calico with kdd: If using Calico network plugin with kdd datastore calico_crds_download_url: "{{ files_repo }}/github.com/projectcalico/calico/archive/v{{ calico_version }}.tar.gz"
# [Optional] Cilium: If using Cilium network plugin ciliumcli_download_url: "{{ files_repo }}/github.com/cilium/cilium-cli/releases/download/v{{ cilium_cli_version }}/cilium-linux-{{ image_arch }}.tar.gz"
# [Optional] helm: only if you set helm_enabled: true helm_download_url: "{{ files_repo }}/get.helm.sh/helm-v{{ helm_version }}-linux-{{ image_arch }}.tar.gz"
# [Optional] crun: only if you set crun_enabled: true crun_download_url: "{{ files_repo }}/github.com/containers/crun/releases/download/{{ crun_version }}/crun-{{ crun_version }}-linux-{{ image_arch }}"
# [Optional] kata: only if you set kata_containers_enabled: true kata_containers_download_url: "{{ files_repo }}/github.com/kata-containers/kata-containers/releases/download/{{ kata_containers_version }}/kata-static-{{ kata_containers_version }}-{{ image_arch }}.tar.xz"
# [Optional] cri-dockerd: only if you set container_manager: docker cri_dockerd_download_url: "{{ files_repo }}/github.com/Mirantis/cri-dockerd/releases/download/v{{ cri_dockerd_version }}/cri-dockerd-{{ cri_dockerd_version }}.{{ image_arch }}.tgz"
# [Optional] runc: if you set container_manager to containerd or crio runc_download_url: "{{ files_repo }}/github.com/opencontainers/runc/releases/download/v{{ runc_version }}/runc.{{ image_arch }}"
# [Optional] cri-o: only if you set container_manager: crio # crio_download_base: "download.opensuse.org/repositories/devel:kubic:libcontainers:stable" # crio_download_crio: "http://{{ crio_download_base }}:/cri-o:/" crio_download_url: "{{ files_repo }}/storage.googleapis.com/cri-o/artifacts/cri-o.{{ image_arch }}.v{{ crio_version }}.tar.gz" skopeo_download_url: "{{ files_repo }}/github.com/lework/skopeo-binary/releases/download/v{{ skopeo_version }}/skopeo-linux-{{ image_arch }}"
# [Optional] containerd: only if you set container_runtime: containerd containerd_download_url: "{{ files_repo }}/github.com/containerd/containerd/releases/download/v{{ containerd_version }}/containerd-{{ containerd_version }}-linux-{{ image_arch }}.tar.gz" nerdctl_download_url: "{{ files_repo }}/github.com/containerd/nerdctl/releases/download/v{{ nerdctl_version }}/nerdctl-{{ nerdctl_version }}-{{ ansible_system | lower }}-{{ image_arch }}.tar.gz"
# [Optional] runsc,containerd-shim-runsc: only if you set gvisor_enabled: true gvisor_runsc_download_url: "{{ files_repo }}/storage.googleapis.com/gvisor/releases/release/{{ gvisor_version }}/{{ ansible_architecture }}/runsc" gvisor_containerd_shim_runsc_download_url: "{{ files_repo }}/storage.googleapis.com/gvisor/releases/release/{{ gvisor_version }}/{{ ansible_architecture }}/containerd-shim-runsc-v1"