已过时,不可用
部署环境: ubuntu20.04, 8G+4核 kubernete版本: 1.22.1
1. 安装vagrant和ansible 按官网教程即可
2. Vagrantfile 建立如下目录
k8s-cluster ├── kubernetes-setup │ ├── master-playbook.yml │ └── node-playbook.yml └── Vagrantfile 其中,Vagrantfile内容如下:
IMAGE_NAME = "bento/ubuntu-16.04" N = 2 Vagrant.configure("2") do |config| config.ssh.insert_key = false config.vm.provider "virtualbox" do |v| v.memory = 2048 v.cpus = 2 end config.vm.define "k8s-master" do |master| master.vm.box = IMAGE_NAME master.vm.network "private_network", ip: "192.168.50.10" master.vm.hostname = "k8s-master" master.vm.provision "ansible" do |ansible| ansible.playbook = "kubernetes-setup/master-playbook.yml" ansible....
环境:ubuntu-20.04, kubernetes:v1.22.1
1. 安装docker 安装时有可能会遇到网络问题,你可以选择换源或是为apt设置代理,设置代理的方法见这里
更新源镜像并安装依赖 sudo apt-get update sudo apt-get install \ apt-transport-https \ ca-certificates \ curl \ gnupg \ lsb-release 安装docker 官方GPG密钥 curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg 设置稳定版本 echo \ "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs)stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null 安装docker sudo apt-get update sudo apt-get install docker-ce docker-ce-cli containerd....
apiVersion可能的字段值: Kind apiVersion CertificateSigningRequest certificates.k8s.io/v1beta1 ClusterRoleBinding rbac.authorization.k8s.io/v1 ClusterRole rbac.authorization.k8s.io/v1 ComponentStatus v1 ConfigMap v1 ControllerRevision apps/v1 CronJob batch/v1beta1 DaemonSet extensions/v1beta1 Deployment extensions/v1beta1 Endpoints v1 Event v1 HorizontalPodAutoscaler autoscaling/v1 Ingress extensions/v1beta1 Job batch/v1 LimitRange v1 Namespace v1 NetworkPolicy extensions/v1beta1 Node v1 PersistentVolumeClaim v1 PersistentVolume v1 PodDisruptionBudget policy/v1beta1 Pod v1 PodSecurityPolicy extensions/v1beta1 PodTemplate v1 ReplicaSet extensions/v1beta1 ReplicationController v1 ResourceQuota v1 RoleBinding rbac....