zoukankan      html  css  js  c++  java
  • centos7.5安装minikube kubernetes

    前提:已安装centos7.5安装VirtualBox

    Minikube是什么?
    Minikube是一种方便在本地运行Kubernetes的工具. 
    Minikube 是可以在VM中运行单节点的Kubernetes集群. 
    Minikube是为了开发或测试在本地启动一个节点的kubernetes集群.

    特点
    不能启动生产集群,没有高可用性的单节点机器. 
    可以工作在Windows,Linux,MacOS下

    1.安装minikube

    [root@localhost ~]# curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 38.2M  100 38.2M    0     0   671k      0  0:00:58  0:00:58 --:--:-- 1640k

    2.安装kubectl

    [root@localhost yum.repos.d]# curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.10.3/bin/linux/amd64/kubectl && chmod +x kubectl
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 51.7M  100 51.7M    0     0  1421k      0  0:00:37  0:00:37 --:--:-- 1762k
    [root@localhost yum.repos.d]# mv kubectl /usr/local/bin/

    此处获取稳定版本可直接在浏览器IE中输入https://storage.googleapis.com/kubernetes-release/release/stable.txt

     

    3.配置变量

    root@localhost network-scripts]# export MINIKUBE_WANTUPDATENOTIFICATION=false
    [root@localhost network-scripts]# export MINIKUBE_WANTREPORTERRORPROMPT=false
    [root@localhost network-scripts]# export MINIKUBE_HOME=$HOME
    [root@localhost network-scripts]# export CHANGE_MINIKUBE_NONE_USER=true
    [root@localhost network-scripts]# mkdir $HOME/.kube || true
    mkdir: cannot create directory ‘/root/.kube’: File exists
    [root@localhost network-scripts]# touch $HOME/.kube/config
    [root@localhost network-scripts]# export KUBECONFIG=$HOME/.kube/config
    [root@localhost network-scripts]# echo $MINIKUBE_WANTUPDATENOTIFICATION
    false
    [root@localhost network-scripts]# echo $MINIKUBE_WANTREPORTERRORPROMPT
    false[root@localhost network-scripts]# echo $MINIKUBE_HOME
    /root
    [root@localhost network-scripts]# echo $CHANGE_MINIKUBE_NONE_USER
    true
    [root@localhost network-scripts]# ls $HOME/.kube/
    config
    [root@localhost network-scripts]# echo $KUBECONFIG
    /root/.kube/config

    4.启动minikube

    [root@localhost bin]# curl -Lo kubeadm http://storage.googleapis.com/kubernetes-release/release/v1.10.0/bin/linux/amd64/kubeadm
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  149M  100  149M    0     0   731k      0  0:03:28  0:03:28 --:--:-- 1274k
    [root@localhost bin]# curl -Lo kubelet http://storage.googleapis.com/kubernetes-release/release/v1.10.0/bin/linux/amd64/kubelet
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  145M  100  145M    0     0  1638k      0  0:01:31  0:01:31 --:--:-- 1762k

    [root@localhost bin]# chmod +x ./*
    [root@localhost bin]# ll
    total 394152
    -rwxr-xr-x. 1 root root 424 Mar 27 15:58 config.sh
    -rwxr-xr-x. 1 root root 156467952 Mar 28 09:52 kubeadm
    -rwxr-xr-x. 1 root root 54277604 Mar 28 10:05 kubectl
    -rwxr-xr-x. 1 root root 152761952 Mar 28 09:55 kubelet
    -rwxr-xr-x. 1 root root 40087180 Mar 27 10:02 minikube
    -rwxr-xr-x. 1 root root 672 Mar 27 17:57 pullK8s.sh
    [root@localhost bin]# pwd
    /usr/local/bin

    [root@localhost network-scripts]# minikube start --vm-driver=virtualbox
    o   minikube v0.35.0 on linux (amd64)
    >   Creating virtualbox VM (CPUs=2, Memory=2048MB, Disk=20000MB) ...
    !   Unable to start VM: create: precreate: This computer doesn't have VT-X/AMD-v enabled. Enabling it in the BIOS is mandatory
    
    *   Sorry that minikube crashed. If this was unexpected, we would love to hear from you:
    -   https://github.com/kubernetes/minikube/issues/new

    保证VMware设置cpu虚拟化,intel VT-x  ThinkCentre进入BIOS,设置intel virtualization technology

    重新安装

  • 相关阅读:
    Code Forces Gym 100886J Sockets(二分)
    CSU 1092 Barricade
    CodeChef Mahesh and his lost array
    CodeChef Gcd Queries
    CodeChef GCD2
    CodeChef Sereja and LCM(矩阵快速幂)
    CodeChef Sereja and GCD
    CodeChef Little Elephant and Balance
    CodeChef Count Substrings
    hdu 4001 To Miss Our Children Time( sort + DP )
  • 原文地址:https://www.cnblogs.com/pu20065226/p/10608562.html
Copyright © 2011-2022 走看看