zoukankan      html  css  js  c++  java
  • Kubernetes

    Minikube is a tool that makes it easy to run Kubernetes locally. Minikube runs a single-node Kubernetes cluster inside a VM on your laptop for users looking to try out Kubernetes or develop with it day-to-day.

    More details can be found at https://github.com/kubernetes/minikube

    Step 1 - Start Minikube

    Minikube has been installed and configured in the environment. Check that it is properly installed, by running the minikube version command:

    minikube version

    Start the cluster, by running the minikube start command:

    minikube start

    Great! You now have a running Kubernetes cluster in your online terminal. Minikube started a virtual machine for you, and a Kubernetes cluster is now running in that VM.

    Step 2 - Cluster Info

    The cluster can be interacted with using the kubectl CLI. This is the main approach used for managing Kubernetes and the applications running on top of the cluster.

    Details of the cluster and its health status can be discovered via 

    kubectl cluster-info

    To view the nodes in the cluster using 

    kubectl get nodes

    If the node is marked as NotReady then it is still starting the components.

    This command shows all nodes that can be used to host our applications. Now we have only one node, and we can see that it’s status is ready (it is ready to accept applications for deployment).

    Step 3 - Deploy Containers

    With a running Kubernetes cluster, containers can now be deployed.

    Using kubectl run, it allows containers to be deployed onto the cluster - 

    kubectl run first-deployment --image=katacoda/docker-http-server --port=80

    The status of the deployment can be discovered via the running Pods - 

    kubectl get pods

    Once the container is running it can be exposed via different networking options, depending on requirements. One possible solution is NodePort, that provides a dynamic port to a container.

    kubectl expose deployment first-deployment --port=80 --type=NodePort

    The command below finds the allocated port and executes a HTTP request.

    export PORT=$(kubectl get svc first-deployment -o go-template='{{range.spec.ports}}{{if .nodePort}}{{.nodePort}}{{"
    "}}{{end}}{{end}}') echo "Accessing host01:$PORT" curl host01:$PORT

    The results is the container that processed the request.

    Step 4 - Dashboard

    The Kubernetes dashboard allows you to view your applications in a UI. In this deployment, the dashboard has been made available on port 30000.

    The URL to the dashboard is https://2886795296-30000-ollie02.environments.katacoda.com/

  • 相关阅读:
    腾讯云ubuntu安装Mysql并配置远程访问
    腾讯云ubuntu搭建tomcat
    腾讯云ubuntu搭建jdk
    说说建站那些事
    网络爬虫:分离生产者和消费者来优化爬虫程序
    spring mvc 图片上传,图片压缩、跨域解决、 按天生成文件夹 ,删除,限制为图片代码等相关配置
    UIkit – 轻量级前端框架
    【Spark】RDD操作具体解释3——键值型Transformation算子
    java线程具体解释
    HDU 5402 Travelling Salesman Problem(棋盘染色 构造 多校啊)
  • 原文地址:https://www.cnblogs.com/oskb/p/10196689.html
Copyright © 2011-2022 走看看