zoukankan      html  css  js  c++  java
  • kubeadm 安装 k8s

    安装kubeadm,国内镜像源

    https://www.orchome.com/10036

    Debian / Ubuntu

    apt-get update && apt-get install -y apt-transport-https
    curl https://mirrors.aliyun.com/kubernetes/apt/doc/apt-key.gpg | apt-key add - 
    cat <<EOF >/etc/apt/sources.list.d/kubernetes.list
    deb https://mirrors.aliyun.com/kubernetes/apt/ kubernetes-xenial main
    EOF  
    apt-get update
    apt-get install -y kubelet kubeadm kubectl
    
    ## 另外,你也可以指定版本安装
    ## apt-get install kubectl=1.19.3-00 kubelet=1.19.3-00 kubeadm=1.19.3-00

    CentOS / RHEL / Fedora

    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
    setenforce 0
    yum install -y kubelet kubeadm kubectl
    systemctl enable kubelet && systemctl start kubelet
     
     
    安装docker
    yum install -y docker
     
    配置docker工作目录到数据盘
    rm -rf /var/lib/docker
    mkdir /data/docker
    ln -s /data/docker /var/lib/docker
     
    开机自启动docker
    systemctl enable docker.service
     
    开始初始化安装
    kubeadm init
     
    [preflight] This might take a minute or two, depending on the speed of your internet connection
    等待中
     
    centos7 查看docker 系统日志
    journalctl -u docker.service
     
    此时看到报错:
    May 08 18:04:07 HHY-k8s-1 dockerd-current[13978]: time="2021-05-08T18:04:07.527294422+08:00" level=warning msg="Error getting v2 registry: Get https://k8s.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded
    May 08 18:26:23 HHY-k8s-1 dockerd-current[13978]: time="2021-05-08T18:26:23.839516697+08:00" level=error msg="Attempting next endpoint for pull after error: Get https://k8s.gcr.io/v1/_ping: dial tcp 74.125.23.82:443: i/o timeout"
     
    kubeadm init
    --kubernetes-version=v1.13.1
    --pod-network-cidr=10.244.0.0/16
    --service-cidr=10.96.0.0/12
    --image-repository registry.aliyuncs.com/google_containers
    --apiserver-advertise-address=0.0.0.0
    --ignore-preflight-errors=Swap
     
     
  • 相关阅读:
    模仿企业在宣传中的动画效果页面
    模仿头条导航的左右滚动效果
    Ubuntu 1210怎么获得root权限登录
    Linux嵌入式 -- 内核简介(x86)
    linux ioctl()函数
    BUTTON标签和INPUT标签的区别【转】
    如何删除列表中的空格
    python第一模块数据类型
    python第一模块基础语法
    最短路 dijkstra+优先队列+邻接表
  • 原文地址:https://www.cnblogs.com/xxdfly/p/14745973.html
Copyright © 2011-2022 走看看