zoukankan      html  css  js  c++  java
  • kubernet

    kubernet

    1、关闭swap
    swapoff -a
    /etc/fstab 注释swap分区

    2、将桥接的IPv4流量传递到iptables的链
    cat > /etc/sysctl.d/k8s.conf <<EOF
    net.bridge.bridge-nf-call-ip6tables = 1
    net.bridge.bridge-nf-call-iptables = 1
    EOF
    sysctl --system

    3、安装docker-ce
    yum install -y yum-utils device-mapper-persistent-data lvm2 iproute-tc
    yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
    yum -y install docker-ce

    4、修改docker配置文件
    /etc/docker/docker.jason
    {
    "registry-mirrors": ["https://registry.docker-cn.com"],
    "exec-opts":["native.cgroupdriver=systemd"]
    }


    4、增加kubernet源

    cat <<EOF > /etc/yum.repos.d/kubernetes.repo
    [kubernetes]
    name=Kubernetes
    baseurl=https://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
    EOF

    5、安装kubectl kubelet kubeadm
    dnf install kubectl kubelet kubeadm

    6、初始化kubernet
    kubeadm init --kubernetes-version=1.18.0
    --apiserver-advertise-address=10.21.101.39
    --image-repository registry.aliyuncs.com/google_containers
    --service-cidr=10.10.0.0/16 --pod-network-cidr=10.20.0.0/16


    Your Kubernetes control-plane has initialized successfully!

    To start using your cluster, you need to run the following as a regular user:

    mkdir -p $HOME/.kube
    sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
    sudo chown $(id -u):$(id -g) $HOME/.kube/config

    You should now deploy a pod network to the cluster.
    Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:
    https://kubernetes.io/docs/concepts/cluster-administration/addons/

    Then you can join any number of worker nodes by running the following on each as root:

    kubeadm join 10.21.101.39:6443 --token hd4gc7.d5sa6bmz16ezlfib
    --discovery-token-ca-cert-hash sha256:a19b147eadb269f5b7aa5b9a4f1926f523609745530e38e0f06d4537e24eae4c

    7、配置kubernet
    mkdir -p $HOME/.kube
    sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
    sudo chown $(id -u):$(id -g) $HOME/.kube/config

    source <(kubectl completion bash)

    8、安装cni
    kubectl apply -f https://docs.projectcalico.org/v3.14/manifests/calico.yaml

  • 相关阅读:
    游戏的真实度
    91)Prometheus简单入门
    90)ubuntu 内核升级/降级系统内核(4.13.0)
    89)yaml文件语法
    使用格式工厂,把视频转为gif,画质受损,出现彩虹条模糊的情况
    fastadmin管理后台--带个人日程管理功能
    http响应--禁用缓存设置
    HTTP响应-302,304码的运用
    http请求详解 防盗链技术
    php支付宝支付接口开发(教程笔记)
  • 原文地址:https://www.cnblogs.com/timlong/p/13307422.html
Copyright © 2011-2022 走看看