zoukankan      html  css  js  c++  java
  • [K8S]kubeadm国内镜像安装方式

    使用国内镜像站

    sudo apt-get update && sudo apt-get install -y apt-transport-https curl

    sudo curl -s https://mirrors.aliyun.com/kubernetes/apt/doc/apt-key.gpg | sudo apt-key add -

    sudo tee /etc/apt/sources.list.d/kubernetes.list <<-'EOF'
    deb https://mirrors.aliyun.com/kubernetes/apt kubernetes-xenial main
    EOF

    sudo apt-get update

    apt-cache madison kubeadm

    查看过版本之后就可以指定版本安装

    $ sudo apt-get install -y kubelet=1.14.0-00 kubeadm=1.14.0-00 kubectl=1.14.0-00
    $ sudo apt-mark hold kubelet=1.14.0-00 kubeadm=1.14.0-00 kubectl=1.14.0-00

    开机启动kubelet

    sudo systemctl enable kubelet && sudo systemctl start kubelet

    解决组件镜像无法拉取的问题

    不能翻墙换个方法变通处理一下

    docker pull mirrorgooglecontainers/kube-apiserver:v1.14.0
    docker pull mirrorgooglecontainers/kube-controller-manager:v1.14.0
    docker pull mirrorgooglecontainers/kube-scheduler:v1.14.0
    docker pull mirrorgooglecontainers/kube-proxy:v1.14.0
    docker pull mirrorgooglecontainers/pause:3.1
    docker pull mirrorgooglecontainers/etcd:3.3.10
    docker pull coredns/coredns:1.3.1

    在重新给下载的打个tag

    docker tag docker.io/mirrorgooglecontainers/kube-apiserver:v1.14.0 k8s.gcr.io/kube-apiserver:v1.14.0
    docker tag docker.io/mirrorgooglecontainers/kube-controller-manager:v1.14.0 k8s.gcr.io/kube-controller-manager:v1.14.0
    docker tag docker.io/mirrorgooglecontainers/kube-scheduler:v1.14.0 k8s.gcr.io/kube-scheduler:v1.14.0
    docker tag docker.io/mirrorgooglecontainers/kube-proxy:v1.14.0 k8s.gcr.io/kube-proxy:v1.14.0
    docker tag docker.io/mirrorgooglecontainers/pause:3.1 k8s.gcr.io/pause:3.1
    docker tag docker.io/mirrorgooglecontainers/etcd:3.3.10 k8s.gcr.io/etcd:3.3.10
    docker tag docker.io/coredns/coredns:1.3.1 k8s.gcr.io/coredns:1.3.1

    node01 ode02也需要pausekube-proxyflannel镜像在相应的宿主机

    初始化主节点

    kubeadm init --pod-network-cidr=10.244.0.0/16

    export KUBECONFIG=/etc/kubernetes/admin.conf

    安装flannel网络插件

    kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml

  • 相关阅读:
    redis总结
    java程序启动脚本
    mysql生成百万测试数据脚本
    java分布式锁的实现及在springboot中的应用
    mysql使用总结
    一个java实现代码(服务)编排的思路(未完)
    sentinel自定义统一限流降级处理
    shell学习
    oracle查看被锁的事务进程sql
    Sql查询两个时间段有重叠的记录
  • 原文地址:https://www.cnblogs.com/baylorqu/p/10754924.html
Copyright © 2011-2022 走看看