zoukankan      html  css  js  c++  java
  • Kubernates 环境搭建

    1. 简介

      kubernates version : v1.19.0
    

    2. 搭建过程

    2.1 设置yum源

    vim  /etc/yum.repos.d/kubernates.repo
    
    [kubernate]
    name=Kubernates Repository
    baseurl=http://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64/
    enabled=1
    gpgcheck=1
    repo_gpgcheck=1
    gpgkey=https://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg https://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
    
    

    2.2 基础组件安装

    yum install -y kubelet kubeadm kubectl --disableexcludes=kubernates
    yum -y install docker
    systemctl enable docker && systemctl start docker
    systemctl enable kubelet
    
    

    2.3 服务器环境设置

    关闭 selinux

    临时关闭命令

      setenforce 0
    

    永久关闭

      vim /etc/selinux/config
      SELINUX=disabled
    

    关闭防火墙

      systemctl stop firewalld
    

    删除 swap

      swapoff -a && sysctl -w vm.swappiness=0
    

    2.4 kubeadm 安装

    获取默认配置信息

      kubeadm config print init-defaults > init.default.yaml
    
      networking:
          dnsDomain: cluster.local
          serviceSubnet: 10.96.0.0/12
          podSubnet: 10.244.0.0/16
    

    修改配置

      vim   init.default.yaml
    

    拉取所需镜像

      kubeadm config images pull --config=init.default.yaml
    

    初始化master

      kubeadm init --config=init.default.yaml
    

    2.5 CNI 插件安装

    flannel

      kubectl apply -f http://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
  • 相关阅读:
    BZOJ2330 SCOI2011糖果
    BZOJ 3812主旋律
    模板更新 扩展卢卡斯
    BZOJ4556 HEOI2016字符串
    CodeForces700E Cool Slogans
    Atcoder Contest069F:Flag
    计算几何模板(更新中......)
    BZOJ4003 JLOI2015城池攻占
    BZOJ3772精神污染
    HDU5919 SequenceⅡ
  • 原文地址:https://www.cnblogs.com/virgosnail/p/13663236.html
Copyright © 2011-2022 走看看