• 搭建单机k8s环境


    安装minikube

    1、本地下载kubectl


     
     
     
     
     
     
     
     
     
     
     
    1
    # 1 配置k8s的yum ,将kubernetes.repo添加到/etc/yum.repos.d中
    2
    
    
    3
    [kubernetes]
    4
    name=Kubernetes
    5
    baseurl=http://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-x86_64
    6
    enabled=1
    7
    gpgcheck=1
    8
    repo_gpgcheck=1
    9
    gpgkey=http://mirrors.aliyun.com/kubernetes/yum/doc/yum-key.gpg http://mirrors.aliyun.com/kubernetes/yum/doc/rpm-package-key.gpg
    10
    
    
    11
    # 2 安装kubectl
    12
    yum clean all
    13
    yum makecache
    14
    yum install -y kubectl
    15
    
    
     
     

    2、本地下载阿里的minikube


     
     
     
     
     
     
     
     
     
     
     
    1
    curl -Lo minikube http://kubernetes.oss-cn-hangzhou.aliyuncs.com/minikube/releases/v1.2.0/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
    2
    
    
     
     

    3、安装非最新版的docker-ce


     
     
     
     
     
     
     
     
     
     
     
    1
    yum install -y yum-utils device-mapper-persistent-data lvm2
    2
    yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
    3
    yum list docker-ce --showduplicates | sort -r
    4
    yum install docker-ce-17.12.0.ce 
     
     

    4、启动minikube


     
     
     
     
     
     
     
     
     
     
     
    1
    minikube start --vm-driver=none --registry-mirror=https://registry.docker-cn.com
    2
    
    
     
     

     
     
     
     
     
     
     
     
     
     
     
    1
    [root@alluer ~]# minikube start --vm-driver=none --registry-mirror=https://registry.docker-cn.com                                                   * minikube v1.2.0 on linux (amd64)
    2
    * using image repository registry.cn-hangzhou.aliyuncs.com/google_containers
    3
    * Creating none VM (CPUs=2, Memory=2048MB, Disk=20000MB) ...
    4
    * Configuring environment for Kubernetes v1.15.0 on Docker 17.12.0-ce
    5
    * Downloading kubeadm v1.15.0
    6
    * Downloading kubelet v1.15.0
    7
    * Pulling images ...
    8
    * Launching Kubernetes ...
    9
    * Configuring local host environment ...
    10
    
    
    11
    ! The 'none' driver provides limited isolation and may reduce system security and reliability.
    12
    ! For more information, see:
    13
      - https://github.com/kubernetes/minikube/blob/master/docs/vmdriver-none.md
    14
    
    
    15
    ! kubectl and minikube configuration will be stored in /root
    16
    ! To use kubectl or minikube commands as your own user, you may
    17
    ! need to relocate them. For example, to overwrite your own settings:
    18
    
    
    19
      - sudo mv /root/.kube /root/.minikube $HOME
    20
      - sudo chown -R $USER $HOME/.kube $HOME/.minikube
    21
    
    
    22
    * This can also be done automatically by setting the env var CHANGE_MINIKUBE_NONE_USER=true
    23
    * Verifying: apiserver proxy etcd scheduler controller dns
    24
    * Done! kubectl is now configured to use "minikube"
    25
    
    
     
     
    Nobody knows it better than me.
  • 相关阅读:
    Python 远程开机
    Python 爬虫利器 Selenium
    Python爬虫——Python 岗位分析报告
    Python 爬虫入门(二)——爬取妹子图
    Python 爬虫入门(一)——爬取糗百
    边缘计算—你了解吗?
    关于图片适配不同尺寸的image View(实战)
    HTML页面转换为Sharepoint母版页(实战)
    SharePoint中你不知道的图片库(实战)
    Sharepoint 2013搜索服务配置总结(实战)
  • 原文地址:https://www.cnblogs.com/dadaizi/p/13060390.html
Copyright © 2020-2023  润新知