美文网首页
01 minikube安装过程

01 minikube安装过程

作者: 逸章 | 来源:发表于2021-06-27 20:36 被阅读0次

    一、 安装完整内容:

    hadoop@hadoop-VirtualBox:~$ sudo curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.15.0/bin/linu                                      x/amd64/kubectl
    [sudo] hadoop 的密码:
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
      0     0    0     0    0     0      0      0 --:--:--  0:00:10 --:--:--     0
    curl: (35) gnutls_handshake() failed: The TLS connection was non-properly terminated.
    hadoop@hadoop-VirtualBox:~$ sudo curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.15.0/bin/linu                                      x/amd64/kubectl
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 40.9M  100 40.9M    0     0  7122k      0  0:00:05  0:00:05 --:--:-- 9199k
    
    hadoop@hadoop-VirtualBox:~$ sudo chmod +x ./kubectl
    hadoop@hadoop-VirtualBox:~$ sudo mv ./kubectl /usr/local/bin/kubectl
    hadoop@hadoop-VirtualBox:~$ kubectl version -o json
    {
      "clientVersion": {
        "major": "1",
        "minor": "15",
        "gitVersion": "v1.15.0",
        "gitCommit": "e8462b5b5dc2584fdcd18e6bcfe9f1e4d970a529",
        "gitTreeState": "clean",
        "buildDate": "2019-06-19T16:40:16Z",
        "goVersion": "go1.12.5",
        "compiler": "gc",
        "platform": "linux/amd64"
      }
    }
    The connection to the server localhost:8080 was refused - did you specify the right host or port?
    hadoop@hadoop-VirtualBox:~$ sudo curl -Lo minikube http://kubernetes.oss-cn-hangzhou.aliyuncs.com/minikube/releases/                                      v1.2.0/minikube-linux-amd64
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 39.8M  100 39.8M    0     0  8322k      0  0:00:04  0:00:04 --:--:-- 8700k
    hadoop@hadoop-VirtualBox:~$ sudo chmod +x minikube
    hadoop@hadoop-VirtualBox:~$ sudo mv minikube /usr/local/bin/
    
    hadoop@hadoop-VirtualBox:~$ sudo minikube start --registry-mirror=https://registry.docker-cn.com --vm-driver=none
    * minikube v1.2.0 on linux (amd64)
    * using image repository registry.cn-hangzhou.aliyuncs.com/google_containers
    * Tip: Use 'minikube start -p <name>' to create a new cluster, or 'minikube delete' to delete this one.
    * Restarting existing none VM for "minikube" ...
    * Waiting for SSH access ...
    * Configuring environment for Kubernetes v1.15.0 on Docker 20.10.7
    * Relaunching Kubernetes v1.15.0 using kubeadm ...
    * Configuring local host environment ...
    
    ! The 'none' driver provides limited isolation and may reduce system security and reliability.
    ! For more information, see:
      - https://github.com/kubernetes/minikube/blob/master/docs/vmdriver-none.md
    
    ! kubectl and minikube configuration will be stored in /home/hadoop
    ! To use kubectl or minikube commands as your own user, you may
    ! need to relocate them. For example, to overwrite your own settings:
    
      - sudo mv /home/hadoop/.kube /home/hadoop/.minikube $HOME
      - sudo chown -R $USER $HOME/.kube $HOME/.minikube
    
    * This can also be done automatically by setting the env var CHANGE_MINIKUBE_NONE_USER=true
    * Verifying: apiserver proxy etcd scheduler controller dns
    * Done! kubectl is now configured to use "minikube"
    

    二、运行一个简单的例子(不用yaml和json)

    hadoop@hadoop-VirtualBox:~/k8s$ docker login --username=yinbodotcc@aliyun.com registry.cn-hangzhou.aliyuncs.com
    Password:
    WARNING! Your password will be stored unencrypted in /home/hadoop/.docker/config.json.
    Configure a credential helper to remove this warning. See
    https://docs.docker.com/engine/reference/commandline/login/#credentials-store
    
    Login Succeeded
    
    hadoop@hadoop-VirtualBox:~/k8s$ docker images
    REPOSITORY                                                                       TAG       IMAGE ID       CREATED             SIZE
    kubia                                                                            latest    d7aadb9c95e5   About an hour ago   660MB
    hello-world                                                                      latest    d1165f221234   3 months ago        13.3kB
    registry.cn-hangzhou.aliyuncs.com/google_containers/kube-proxy                   v1.15.0   d235b23c3570   2 years ago         82.4MB
    registry.cn-hangzhou.aliyuncs.com/google_containers/kube-apiserver               v1.15.0   
    ......
    
    
    hadoop@hadoop-VirtualBox:~/k8s$ docker tag kubia registry.cn-hangzhou.aliyuncs.com/yay1/yay2:tag-kubia
    hadoop@hadoop-VirtualBox:~/k8s$ docker push registry.cn-hangzhou.aliyuncs.com/yay1/yay2:tag-kubia
    The push refers to repository [registry.cn-hangzhou.aliyuncs.com/yay1/yay2]
    2667bcb28156: Pushed
    ab90d83fa34a: Pushed
    8ee318e54723: Pushed
    e6695624484e: Pushed
    da59b99bbd3b: Pushed
    5616a6292c16: Pushed
    f3ed6cb59ab0: Pushed
    654f45ecb7e3: Pushed
    2c40c66f7667: Pushed
    tag-kubia: digest: sha256:452de313f5dab1c03faafad338f06e2d8110f705cf7a1098dffccb4123****** size: 2213
    hadoop@hadoop-VirtualBox:~/k8s$
    
    hadoop@hadoop-VirtualBox:~/k8s$ kubectl get pods
    NAME           READY   STATUS             RESTARTS   AGE
    kubia2-sz8mf   0/1     ImagePullBackOff   0          75m
    kubia3-k6jgl   0/1     ImagePullBackOff   0          41m
    hadoop@hadoop-VirtualBox:~/k8s$ kubectl run kubia4 --image=registry.cn-hangzhou.aliyuncs.com/yay1/yay2:tag-kubia --port=9999 --generator=run/v1
    kubectl run --generator=run/v1 is DEPRECATED and will be removed in a future version. Use kubectl run --generator=run-pod/v1 or kubectl create instead.
    replicationcontroller/kubia4 created
    hadoop@hadoop-VirtualBox:~/k8s$ kubectl get pods
    NAME           READY   STATUS             RESTARTS   AGE
    kubia2-sz8mf   0/1     ImagePullBackOff   0          76m
    kubia3-k6jgl   0/1     ImagePullBackOff   0          42m
    kubia4-fnnzh   1/1     Running            0          5s
    hadoop@hadoop-VirtualBox:~/k8s$
    
    
    image.png image.png
    image.png 图片.png

    相关文章

      网友评论

          本文标题:01 minikube安装过程

          本文链接:https://www.haomeiwen.com/subject/snvxultx.html