• Kubernetes之安装minikube


      https://www.cnblogs.com/pack27/p/12202687.html

      https://www.jianshu.com/p/18441c7434a6

      一,安装docker

    #Step 2:安装必要包
    sudo yum install -y yum-utils device-mapper-persistent-data lvm2
    # Step 2: 添加软件源信息
    sudo yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
    # Step 3: 更新并安装Docker-CE
    sudo yum makecache fast
    sudo yum -y install docker-ce
    # Step 4: 开启Docker服务
    sudo service docker start
    systemctl enable docker
    

       二,安装kubectl

      下载二进制包https://github.com/kubernetes/kubernetes/releases

      解压 后把可执行程序kubectl移动至/usr/local/bin

      三,安装minikube

      下载

    wget https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
    

       安装

     mv minikube-linux-amd64 minikube
    chmox +x minikube
     mv minikube /usr/local/bin/
    #安装需要设置成国内源
    minikube start --image-repository='registry.cn-hangzhou.aliyuncs.com/google_containers'
    

       查看

    # kubectl get cs,node
    NAME                                 STATUS    MESSAGE             ERROR
    componentstatus/scheduler            Healthy   ok                  
    componentstatus/controller-manager   Healthy   ok                  
    componentstatus/etcd-0               Healthy   {"health":"true"}   
    
    NAME                STATUS   ROLES    AGE   VERSION
    node/k8s-minikube   Ready    master   17m   v1.17.3
    

       创建一个测试用例

    kubectl run nginx --image=nginx --port=80
    kubectl expose deployment nginx --port=80 --target-port=80 --type=NodePort
    

       查看

    # kubectl get node,svc
    NAME                STATUS   ROLES    AGE   VERSION
    node/k8s-minikube   Ready    master   19m   v1.17.3
    
    NAME                 TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)        AGE
    service/kubernetes   ClusterIP   10.96.0.1      <none>        443/TCP        19m
    service/nginx        NodePort    10.106.214.5   <none>        80:30807/TCP   15m
    

       能使用node加NodePort端口访问即可,单机minikube搭建完成,可由于开发及测试。

  • 相关阅读:
    Luogu P4053 [JSOI2007]建筑抢修
    CF894E Ralph and Mushrooms
    Boruvka
    Codeforces Beta Round #25 (Div. 2 Only) C. Roads in Berland
    HDU 3714/UVA1476 Error Curves
    HDU 5410 CRB and His Birthday
    HDU 1796 How many integers can you find
    UVA 11624 Fire!
    POJ 3279 Dungeon Master
    POJ 1321 棋盘问题
  • 原文地址:https://www.cnblogs.com/minseo/p/12509303.html
Copyright © 2020-2023  润新知