DevOps
  • DevOps
  • Docker
    • Overview
  • Vagrant
    • Overview
    • Installation
    • Basic Commands
    • Vagrantfile
      • Example
    • Deploying Multiple Machine
    • Distribution
    • Reference
  • Running SQL Server on Windows Docker
    • Introduction
      • Windows Container & Hyper-V Container
    • System Requirements and Prerequisites
    • Version Compatibility
    • Enable Hyper-V & Containers and Install Docker on Window Servers
    • Using Docker to Run MSSQL Image
    • Install SSMS for remoting MSSQL Server Image
    • Using Docker-Compose to Build Up a MSSQL Image
    • Increase the default Windows container's storage
    • Reference
    • Appendix
  • Kubernetes
    • Install Kubernetes with kubeasz
    • Use Hyper-V Manager to create VM for K8S
      • Specification of the VM
      • Use Hyper-V Manager to turn on a VM for K8S
    • Installation
      • Install VirtualBox and its extension on Ubuntu
      • Install kubectl
      • Install minikube
    • Getting Started
      • Running Kubernetes Locally via Minikube
    • Assign Memory Resources to Containers and Pods
    • Assign CPU Resources to Containers and Pods
    • Quality of Services (QoS)
    • Volume for Storage
      • Configure a Pod to Use a Volume for Storage
      • *Configure a Pod to Use a PersistentVolume for Storage
    • In a nutshell...
    • Reference
  • Ansible
    • What is Ansible?
    • Set Up OS Environments for Ansible
    • Install Ansible
    • Structure for ansible
      • Inventory
      • Playbook
      • Modules
      • Variables
      • Conditions
    • Security - Ansible Fault
    • 實際操作測試1 - 使用ssh
    • 實際操作測試2 - Docker容器部署
    • Appendix
    • Reference
  • Azure
    • Overview
    • Terms
    • Getting Started
    • Azure DevOps Services
    • Reference
Powered by GitBook
On this page

Was this helpful?

  1. Kubernetes
  2. Getting Started

Running Kubernetes Locally via Minikube

Quickstart

minikube start
Starting local Kubernetes cluster...
Running pre-create checks...
Creating machine...
Starting local Kubernetes cluster...
kubectl run hello-minikube --image=k8s.gcr.io/echoserver:1.10 --port=8080
deployment.apps/hello-minikube created
kubectl expose deployment hello-minikube --type=NodePort
service/hello-minikube exposed

We have now launched an echoserver pod but we have to wait until the pod is up before curling/accessing it via the exposed service. To check whether the pod is up and running we can use the following:

kubectl get pod
NAME                              READY     STATUS              RESTARTS   AGE
hello-minikube-3383150820-vctvh   0/1       ContainerCreating   0          3s

We can see that the pod is still being created from the ContainerCreating status kubectl get pod

NAME                              READY     STATUS    RESTARTS   AGE
hello-minikube-3383150820-vctvh   1/1       Running   0          13s

We can see that the pod is now Running and we will now be able to curl it:

curl $(minikube service hello-minikube --url)

Hostname: hello-minikube-7c77b68cff-8wdzq

Pod Information:
	-no pod information available-

Server values:
	server_version=nginx: 1.13.3 - lua: 10008

Request Information:
	client_address=172.17.0.1
	method=GET
	real path=/
	query=
	request_version=1.1
	request_scheme=http
	request_uri=http://192.168.99.100:8080/

Request Headers:
	accept=*/*
	host=192.168.99.100:30674
	user-agent=curl/7.47.0

Request Body:
	-no body in request-
kubectl delete services hello-minikube
service "hello-minikube" deleted
kubectl delete deployment hello-minikube
deployment.extensions "hello-minikube" deleted
minikube stop
Stopping local Kubernetes cluster...
Stopping "minikube"...
PreviousGetting StartedNextAssign Memory Resources to Containers and Pods

Last updated 6 years ago

Was this helpful?