美文网首页
国内环境部署使用minikube部署k8s

国内环境部署使用minikube部署k8s

作者: 小黑佬 | 来源:发表于2020-03-25 11:43 被阅读0次
    minikube start --vm-driver=none --image-repository=registry.cn-hangzhou.aliyuncs.com/google_containers
    

    安装helm客户端

    ##[https://helm.sh/docs/intro/install/](https://helm.sh/docs/intro/install/)
    
    curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
    

    查看clusters

    [root@localhost ~]# kubectl config view
    apiVersion: v1
    clusters:
    - cluster:
        certificate-authority: /root/.minikube/ca.crt
        server: https://10.0.2.15:8443
      name: minikube
    contexts:
    - context:
        cluster: minikube
        user: minikube
      name: minikube
    current-context: minikube
    kind: Config
    preferences: {}
    users:
    - name: minikube
      user:
        client-certificate: /root/.minikube/client.crt
        client-key: /root/.minikube/client.key
    

    实例

    [root@localhost ~]# kubectl create deployment hello-minikube   --image=registry.cn-hangzhou.aliyuncs.com/google-containers/echoserver:1.4
    deployment.apps/hello-minikube created
    [root@localhost ~]# kubectl expose deployment hello-minikube --type=NodePort --port=8080
    service/hello-minikube exposed
    [root@localhost ~]# minikube service hello-minikube
    
    |-----------|----------------|-------------|------------------------|
    | NAMESPACE |      NAME      | TARGET PORT |          URL           |
    |-----------|----------------|-------------|------------------------|
    | default   | hello-minikube |             | http://10.0.2.15:30080 |
    |-----------|----------------|-------------|------------------------|
    * Opening service default/hello-minikube in default browser...
    

    相关文章

      网友评论

          本文标题:国内环境部署使用minikube部署k8s

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