SlideShare a Scribd company logo
Minikube - Getting started (on windows)
Introduction
Local-machine Solutions for Kubernetes: Minikube
What is Minikube?
Running Kubernetes Locally via Minikube
Requirements
Install Oracle Virtual Box
Enable Virtualization
Install Minikube
Windows: download minikube and add to path
Windows Installer
Install Kubectl
Testing Setup
Starting the cluster
Some more minikube operations:
Test it out
Introduction
Kubernetes can run on a range of platforms, from your laptop, to VMs on a cloud provider, to rack of bare metal servers. The effort required to set
up a cluster varies from running a single command to crafting your own customized cluster. In this guide, i will walk you through creating
kubernetes cluster for local development.
If you just want to “kick the tires” on Kubernetes, we recommend the local Docker-based solution using MiniKube.
Local-machine Solutions for Kubernetes: Minikube
What is Minikube?
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.
Minikube is the recommended method for you to create a single node kubernetes cluster locally for purposes of development and testing. Setup is
completely automated and doesn’t require a cloud provider account.
Use the Minikube getting started guide to try it out
Running Kubernetes Locally via Minikube
Minikube starts a single node kubernetes cluster locally for purposes of development and testing. Minikube packages and configures a Linux VM,
Docker and all Kubernetes components, optimized for local development. Minikube supports Kubernetes features such as:
DNS
NodePorts
ConfigMaps and Secrets
Dashboards
Minikube does not yet support Cloud Provider specific features such as:
LoadBalancers
PersistentVolumes
Ingress
Requirements
Install Oracle Virtual Box
Install Oracle virtual box
1.
2.
Enable Virtualization
VT-x/AMD-v virtualization must be enabled in BIOS. If you are able to run virtualbox on your windows machine, it should already be enabled for
you.
Install Minikube
See the latest Minikube release for installation instructions. There are two methods for installing on windows.
Windows: download minikube and add to path
Download the file, rename it to and add it to your pathminikube-windows-amd64.exe minikube.exe
Windows Installer
Download the file, and execute the installer. This will automatically add minikube.exe to your path with anminikube-installer.exe
uninstaller available as well.
Install Kubectl
kubectl must be on your path. Minikube currently supports any version of kubectl greater than 1.0, but it is recommended using the most
recent version.
The latest version of kubectl can be downloaded from .here
Once downloaded put kucbectl to your windows path.
Testing Setup
Test minikube setup
minikube version
> minikube version
minikube version: v0.13.1
minikube help
minikube help
> minikube help
Minikube is a CLI tool that provisions and manages single-node
Kubernetes clusters optimized for development workflows.
Usage:
minikube [command]
Available Commands:
addons Modify minikube's kubernetes addons
completion Outputs minikube shell completion for the given
shell (bash)
config Modify minikube config
dashboard Opens/displays the kubernetes dashboard URL for
your local cluster
delete Deletes a local kubernetes cluster.
docker-env sets up docker env variables; similar to
'$(docker-machine env)'
get-k8s-versions Gets the list of available kubernetes versions
available for minikube.
ip Retrieve the IP address of the running cluster.
logs Gets the logs of the running localkube instance,
used for debugging minikube, not user code.
service Gets the kubernetes URL(s) for the specified
service in your local cluster
ssh Log into or run a command on a machine with SSH;
similar to 'docker-machine ssh'
start Starts a local kubernetes cluster.
status Gets the status of a local kubernetes cluster.
stop Stops a running local kubernetes cluster.
version Print the version of minikube.
Flags:
--alsologtostderr log to standard error as well
as files
--log_backtrace_at traceLocation when logging hits line
file:N, emit a stack trace (default :0)
--log_dir string If non-empty, write log files
in this directory
--logtostderr log to standard error instead
of files
--show-libmachine-logs Whether or not to show logs
from libmachine.
--stderrthreshold severity logs at or above this
threshold go to stderr (default 2)
--test.bench string regular expression per path
component to select benchmarks to run
--test.benchmem print memory allocations for
benchmarks
--test.benchtime duration approximate run time for each
benchmark (default 1s)
--test.blockprofile string write a goroutine blocking
profile to the named file after execution
--test.blockprofilerate int if >= 0, calls
runtime.SetBlockProfileRate() (default 1)
--test.count n run tests and benchmarks n
times (default 1)
--test.coverprofile string write a coverage profile to
the named file after execution
--test.cpu string comma-separated list of
number of CPUs to use for each test
--test.cpuprofile string write a cpu profile to the
named file during execution
--test.memprofile string write a memory profile to the
named file after execution
--test.memprofilerate int if >=0, sets
runtime.MemProfileRate
--test.outputdir string directory in which to write
profiles
--test.parallel int maximum test parallelism
(default 4)
--test.run string regular expression to select
tests and examples to run
--test.short run smaller test suite to
save time
--test.timeout duration if positive, sets an
aggregate time limit for all tests (default 0s)
--test.trace string write an execution trace to
the named file after execution
--test.v verbose: print additional
output
-v, --v Level log level for V logs
--vmodule moduleSpec comma-separated list of
pattern=N settings for file-filtered logging
Use "minikube [command] --help" for more information about a command.
kubernetes version supported by minikube
minikube supported kubernetes versions
> minikube get-k8s-versions
The following Kubernetes versions are available:
- v1.5.0-beta.1
- v1.4.3
- v1.4.2
- v1.4.1
- v1.4.0
- v1.3.7
- v1.3.6
- v1.3.5
- v1.3.4
- v1.3.3
- v1.3.0
Starting cluster in custome way
> minikube.exe start --kubernetes-version="v1.4.0" /
--vm-driver="virtualbox"
--show-libmachine-logs --alsologtostderr
W1207 00:16:20.958899 13400 root.go:139] Error reading config file
at C:UsersMMehta.minikubeconfigconfig.json: open
C:UsersMMehta.minikubeconfigconfig.json: The system cannot find
the file specified.
I1207 00:16:20.966391 13400 notify.go:112] Checking for updates...
Starting local Kubernetes cluster...
I1207 00:16:21.194417 13400 cluster.go:78] Machine exists!
I1207 00:16:21.850475 13400 cluster.go:85] Machine state: Stopped
(minikube) Check network to re-create if needed...
(minikube) Waiting for an IP...
Waiting for SSH to be available...
Detecting the provisioner...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Downloading localkube binary
78.78 MB / 78.78 MB [==============================================]
100.00% 0s
I1207 00:18:20.137511 13400 cluster.go:275] Setting up certificates
for IP: %s 192.168.99.100
I1207 00:18:20.270108 13400 cluster.go:212] sudo killall localkube
|| true
I1207 00:18:20.348164 13400 cluster.go:214] killall: localkube: no
process killed
I1207 00:18:20.348663 13400 cluster.go:212]
# Run with nohup so it stays up. Redirect logs to useful places.
sudo sh -c 'PATH=/usr/local/sbin:$PATH nohup /usr/local/bin/localkube

--generate-certs=false --logtostderr=true --enable-dns=false
--node-ip=192.168.99.100 > /var/lib/localkube/localkube.out 2>
/var/lib/localkube/localkube.err < /dev/null & echo $! >
/var/run/localkube.pid &'
I1207 00:18:20.434598 13400 cluster.go:214]
I1207 00:18:20.626234 13400 start.go:171] Using kubeconfig:
C:UsersMMehta/.kube/config
Kubectl is now configured to use the cluster.
Minikube cluster status
3.
minikube cluster status
> minikube status
minikubeVM: Running
localkube: Running
> minikube status
minikubeVM: Stopped
localkube: N/A
Cluster information
Minikube cluster info
> kubectl cluster-info
Kubernetes master is running at https://192.168.99.100:8443
KubeDNS is running at
https://192.168.99.100:8443/api/v1/proxy/namespaces/kube-system/servi
ces/kube-dns
kubernetes-dashboard is running at
https://192.168.99.100:8443/api/v1/proxy/namespaces/kube-system/servi
ces/kubernetes-dashboard
To further debug and diagnose cluster problems, use 'kubectl
cluster-info dump'.
kubectl client and server version
kubectl version
> kubectl version
Client Version: version.Info{Major:"1", Minor:"3",
GitVersion:"v1.3.0",
GitCommit:"283137936a498aed572ee22af6774b6fb6e9fd94",
GitTreeState:"clean", BuildDate:"2016-07-01T19:26:38Z",
GoVersion:"go1.6.2
", Compiler:"gc", Platform:"windows/amd64"}
Server Version: version.Info{Major:"1", Minor:"4",
GitVersion:"v1.4.6",
GitCommit:"e569a27d02001e343cb68086bc06d47804f62af6",
GitTreeState:"clean", BuildDate:"1970-01-01T00:00:00Z",
GoVersion:"go1.7.1
", Compiler:"gc", Platform:"linux/amd64"}
Test kubectl setup
Starting the cluster
To start a cluster, run the command
minikube start
> minikube start
Starting local Kubernetes cluster...
Downloading Minikube ISO
36.00 MB / 36.00 MB [==============================================]
100.00% 0s
Kubectl is now configured to use the cluster.
This will build and start a lightweight local cluster, consisting of a master, etcd, Docker and a single node.
Minikube will also create a “minikube” context, and set it to default in kubectl. To switch back to this context later, run this command:
set context
kubectl config use-context minikube
To stop cluster:
> minikube stop
Stopping local Kubernetes cluster...
Machine stopped.
To delete cluster:
delete cluster
> minikube delete
Deleting local Kubernetes cluster...
Machine deleted.
Minikube also includes the Kubernetes dashboard. Run this command to see the included kube-system pods:
Get pods
> kubectl get pods --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS
AGE
kube-system kube-addon-manager-minikube 1/1 Running 0
3m
kube-system kube-dns-v20-u1vsu 3/3 Running 0
1m
kube-system kubernetes-dashboard-0tymh 1/1 Running 0
1m
Run this command to open the Kubernetes dashboard:
Kube Dashboard
> minikube.exe dashboard --url=true
http://192.168.99.100:30000
> minikube dashboard
Opening kubernetes dashboard in default browser...
When nothing is up:
When services and pods in action:
1.
2.
3.
4.
Some more minikube operations:
Cluster IP
Cluster IP
> minikube ip
192.168.99.100
Create deployment
Deployment
> kubectl run hello-minikube
--image=gcr.io/google_containers/echoserver:1.4 --port=8080
deployment "hello-minikube" created
Service
> kubectl expose deployment hello-minikube --type=NodePort
service "hello-minikube" exposed
Get Pods Status
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:
5.
Pod Status
> kubectl get pod
NAME READY STATUS RESTARTS
AGE
hello-minikube-3015430129-6qmgo 1/1 ContainerCreating 0
30ms
Initially the container status would be: ".ContainerCreating". After some times it returns to "Running" Status.
Pod Status
> kubectl get pod
NAME READY STATUS RESTARTS AGE
hello-minikube-3015430129-6qmgo 1/1 Running 0 5m
Get the service
Get Services
> kubectl get services
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
hello-minikube 10.0.0.118 <nodes> 8080/TCP 17m
kubernetes 10.0.0.1 <none> 443/TCP 1h
Information about a service
Service description
> kubectl describe service hello-minikube
Name: hello-minikube
Namespace: default
Labels: run=hello-minikube
Selector: run=hello-minikube
Type: NodePort
IP: 10.0.0.118
Port: <unset> 8080/TCP
NodePort: <unset> 31436/TCP
Endpoints: 172.17.0.4:8080
Session Affinity: None
No events.
> minikube service hello-minikube
Opening kubernetes service default/hello-minikube in default
browser...
6.
7.
Scaling the service
> kubectl scale --replicas=3 deployment/hello-minikube
deployment "hello-minikube" scaled
Now the status of deployment
> kubectl.exe get deployment
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
hello-minikube 3 3 3 3 1h
Stopping cluster
7.
1.
2.
Stopping cluster
> minikube stop
Stopping local Kubernetes cluster...
Machine stopped.
Test it out
List the nodes in your cluster by running:
Get Nodes
> kubectl get nodes
NAME STATUS AGE
minikube Ready 50m
Minikube contains a built-in Docker daemon for running containers. If you use another Docker daemon for building your containers, you will have
to publish them to a registry before minikube can pull them. You can use minikube’s built in Docker daemon to avoid this extra step of pushing
your images. Use the built-in Docker daemon with:
> eval $(minikube docker-env)
References:
http://kubernetes.io/docs/getting-started-guides
http://kubernetes.io/docs/getting-started-guides/minikube/

More Related Content

What's hot

Kubernetes Networking
Kubernetes NetworkingKubernetes Networking
Kubernetes Networking
CJ Cullen
 
Docker Networking Overview
Docker Networking OverviewDocker Networking Overview
Docker Networking Overview
Sreenivas Makam
 
Introduction to Kubernetes Workshop
Introduction to Kubernetes WorkshopIntroduction to Kubernetes Workshop
Introduction to Kubernetes Workshop
Bob Killen
 
Scale Kubernetes to support 50000 services
Scale Kubernetes to support 50000 servicesScale Kubernetes to support 50000 services
Scale Kubernetes to support 50000 services
LinuxCon ContainerCon CloudOpen China
 
kubernetes, pourquoi et comment
kubernetes, pourquoi et commentkubernetes, pourquoi et comment
kubernetes, pourquoi et comment
Jean-Baptiste Claramonte
 
Introduction of Kubernetes - Trang Nguyen
Introduction of Kubernetes - Trang NguyenIntroduction of Kubernetes - Trang Nguyen
Introduction of Kubernetes - Trang Nguyen
Trang Nguyen
 
Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)
Megan O'Keefe
 
Kubernetes Basics
Kubernetes BasicsKubernetes Basics
Kubernetes Basics
Eueung Mulyana
 
Keystone at openstack multi sites
Keystone at openstack multi sitesKeystone at openstack multi sites
Keystone at openstack multi sites
Vietnam Open Infrastructure User Group
 
[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교 및 구축 방법
[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교  및 구축 방법[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교  및 구축 방법
[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교 및 구축 방법
Open Source Consulting
 
Kubernetes
KubernetesKubernetes
Kubernetes
erialc_w
 
Introduction and Deep Dive Into Containerd
Introduction and Deep Dive Into ContainerdIntroduction and Deep Dive Into Containerd
Introduction and Deep Dive Into Containerd
Kohei Tokunaga
 
Introduction to helm
Introduction to helmIntroduction to helm
Introduction to helm
Jeeva Chelladhurai
 
Ansible-cours .pdf
Ansible-cours .pdfAnsible-cours .pdf
Ansible-cours .pdf
Jaouad Assabbour
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
Eric Gustafson
 
Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101
Crevise Technologies
 
Docker Registry V2
Docker Registry V2Docker Registry V2
Docker Registry V2
Docker, Inc.
 
왜 쿠버네티스는 systemd로 cgroup을 관리하려고 할까요
왜 쿠버네티스는 systemd로 cgroup을 관리하려고 할까요왜 쿠버네티스는 systemd로 cgroup을 관리하려고 할까요
왜 쿠버네티스는 systemd로 cgroup을 관리하려고 할까요
Jo Hoon
 
Kubernetes Monitoring & Best Practices
Kubernetes Monitoring & Best PracticesKubernetes Monitoring & Best Practices
Kubernetes Monitoring & Best Practices
Ajeet Singh Raina
 
Kubernetes Helm: Why It Matters
Kubernetes Helm: Why It MattersKubernetes Helm: Why It Matters
Kubernetes Helm: Why It Matters
Platform9
 

What's hot (20)

Kubernetes Networking
Kubernetes NetworkingKubernetes Networking
Kubernetes Networking
 
Docker Networking Overview
Docker Networking OverviewDocker Networking Overview
Docker Networking Overview
 
Introduction to Kubernetes Workshop
Introduction to Kubernetes WorkshopIntroduction to Kubernetes Workshop
Introduction to Kubernetes Workshop
 
Scale Kubernetes to support 50000 services
Scale Kubernetes to support 50000 servicesScale Kubernetes to support 50000 services
Scale Kubernetes to support 50000 services
 
kubernetes, pourquoi et comment
kubernetes, pourquoi et commentkubernetes, pourquoi et comment
kubernetes, pourquoi et comment
 
Introduction of Kubernetes - Trang Nguyen
Introduction of Kubernetes - Trang NguyenIntroduction of Kubernetes - Trang Nguyen
Introduction of Kubernetes - Trang Nguyen
 
Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)Kubernetes: A Short Introduction (2019)
Kubernetes: A Short Introduction (2019)
 
Kubernetes Basics
Kubernetes BasicsKubernetes Basics
Kubernetes Basics
 
Keystone at openstack multi sites
Keystone at openstack multi sitesKeystone at openstack multi sites
Keystone at openstack multi sites
 
[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교 및 구축 방법
[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교  및 구축 방법[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교  및 구축 방법
[오픈소스컨설팅] 쿠버네티스와 쿠버네티스 on 오픈스택 비교 및 구축 방법
 
Kubernetes
KubernetesKubernetes
Kubernetes
 
Introduction and Deep Dive Into Containerd
Introduction and Deep Dive Into ContainerdIntroduction and Deep Dive Into Containerd
Introduction and Deep Dive Into Containerd
 
Introduction to helm
Introduction to helmIntroduction to helm
Introduction to helm
 
Ansible-cours .pdf
Ansible-cours .pdfAnsible-cours .pdf
Ansible-cours .pdf
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
Kubernetes 101
Kubernetes 101Kubernetes 101
Kubernetes 101
 
Docker Registry V2
Docker Registry V2Docker Registry V2
Docker Registry V2
 
왜 쿠버네티스는 systemd로 cgroup을 관리하려고 할까요
왜 쿠버네티스는 systemd로 cgroup을 관리하려고 할까요왜 쿠버네티스는 systemd로 cgroup을 관리하려고 할까요
왜 쿠버네티스는 systemd로 cgroup을 관리하려고 할까요
 
Kubernetes Monitoring & Best Practices
Kubernetes Monitoring & Best PracticesKubernetes Monitoring & Best Practices
Kubernetes Monitoring & Best Practices
 
Kubernetes Helm: Why It Matters
Kubernetes Helm: Why It MattersKubernetes Helm: Why It Matters
Kubernetes Helm: Why It Matters
 

Viewers also liked

ContainerDayVietnam2016: Kubernetes State-of-the-art Container Management Pla...
ContainerDayVietnam2016: Kubernetes State-of-the-art Container Management Pla...ContainerDayVietnam2016: Kubernetes State-of-the-art Container Management Pla...
ContainerDayVietnam2016: Kubernetes State-of-the-art Container Management Pla...
Docker-Hanoi
 
ElasticKube, a Container Management Platform for Kubernetes
ElasticKube, a Container Management Platform for KubernetesElasticKube, a Container Management Platform for Kubernetes
ElasticKube, a Container Management Platform for Kubernetes
Matt Baldwin
 
Docker: The basics - Including a demo with an awesome full-stack JS app
Docker: The basics - Including a demo with an awesome full-stack JS appDocker: The basics - Including a demo with an awesome full-stack JS app
Docker: The basics - Including a demo with an awesome full-stack JS app
Marcelo Rodrigues
 
9 ways to consume kubernetes on open stack in 15 mins (k8s meetup)
9 ways to consume kubernetes on open stack in 15 mins (k8s meetup)9 ways to consume kubernetes on open stack in 15 mins (k8s meetup)
9 ways to consume kubernetes on open stack in 15 mins (k8s meetup)
Stacy Véronneau
 
Amazon EC2 & VPC HOL
Amazon EC2 & VPC HOLAmazon EC2 & VPC HOL
Amazon EC2 & VPC HOL
Amazon Web Services
 
Getting started with kubernetes
Getting started with kubernetesGetting started with kubernetes
Getting started with kubernetes
Janakiram MSV
 
Java Performance Analysis on Linux with Flame Graphs
Java Performance Analysis on Linux with Flame GraphsJava Performance Analysis on Linux with Flame Graphs
Java Performance Analysis on Linux with Flame Graphs
Brendan Gregg
 
Kubernetes architecture
Kubernetes architectureKubernetes architecture
Kubernetes architecture
Janakiram MSV
 
Blazing Performance with Flame Graphs
Blazing Performance with Flame GraphsBlazing Performance with Flame Graphs
Blazing Performance with Flame Graphs
Brendan Gregg
 
Achieving CI/CD with Kubernetes
Achieving CI/CD with KubernetesAchieving CI/CD with Kubernetes
Achieving CI/CD with Kubernetes
Ramit Surana
 

Viewers also liked (10)

ContainerDayVietnam2016: Kubernetes State-of-the-art Container Management Pla...
ContainerDayVietnam2016: Kubernetes State-of-the-art Container Management Pla...ContainerDayVietnam2016: Kubernetes State-of-the-art Container Management Pla...
ContainerDayVietnam2016: Kubernetes State-of-the-art Container Management Pla...
 
ElasticKube, a Container Management Platform for Kubernetes
ElasticKube, a Container Management Platform for KubernetesElasticKube, a Container Management Platform for Kubernetes
ElasticKube, a Container Management Platform for Kubernetes
 
Docker: The basics - Including a demo with an awesome full-stack JS app
Docker: The basics - Including a demo with an awesome full-stack JS appDocker: The basics - Including a demo with an awesome full-stack JS app
Docker: The basics - Including a demo with an awesome full-stack JS app
 
9 ways to consume kubernetes on open stack in 15 mins (k8s meetup)
9 ways to consume kubernetes on open stack in 15 mins (k8s meetup)9 ways to consume kubernetes on open stack in 15 mins (k8s meetup)
9 ways to consume kubernetes on open stack in 15 mins (k8s meetup)
 
Amazon EC2 & VPC HOL
Amazon EC2 & VPC HOLAmazon EC2 & VPC HOL
Amazon EC2 & VPC HOL
 
Getting started with kubernetes
Getting started with kubernetesGetting started with kubernetes
Getting started with kubernetes
 
Java Performance Analysis on Linux with Flame Graphs
Java Performance Analysis on Linux with Flame GraphsJava Performance Analysis on Linux with Flame Graphs
Java Performance Analysis on Linux with Flame Graphs
 
Kubernetes architecture
Kubernetes architectureKubernetes architecture
Kubernetes architecture
 
Blazing Performance with Flame Graphs
Blazing Performance with Flame GraphsBlazing Performance with Flame Graphs
Blazing Performance with Flame Graphs
 
Achieving CI/CD with Kubernetes
Achieving CI/CD with KubernetesAchieving CI/CD with Kubernetes
Achieving CI/CD with Kubernetes
 

Similar to kubernetes - minikube - getting started

kubernetes practice
kubernetes practicekubernetes practice
kubernetes practice
wonyong hwang
 
Introducing Docker
Introducing DockerIntroducing Docker
Introducing Docker
Francesco Pantano
 
Kubernetes installation
Kubernetes installationKubernetes installation
Kubernetes installation
Ahmed Mekawy
 
k8s practice 2023.pptx
k8s practice 2023.pptxk8s practice 2023.pptx
k8s practice 2023.pptx
wonyong hwang
 
Preparation study of_docker - (MOSG)
Preparation study of_docker  - (MOSG)Preparation study of_docker  - (MOSG)
Preparation study of_docker - (MOSG)
Soshi Nemoto
 
Docker and Kubernetes 101 workshop
Docker and Kubernetes 101 workshopDocker and Kubernetes 101 workshop
Docker and Kubernetes 101 workshop
Sathish VJ
 
Kubernetes
KubernetesKubernetes
Kubernetes
Meng-Ze Lee
 
Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...
Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...
Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...
NLJUG
 
Install a micro k8s single node cluster of kubernetes on windows 10
Install a micro k8s single node cluster of kubernetes on windows 10Install a micro k8s single node cluster of kubernetes on windows 10
Install a micro k8s single node cluster of kubernetes on windows 10
Lợi Dương
 
Docker for Java developers at JavaLand
Docker for Java developers at JavaLandDocker for Java developers at JavaLand
Docker for Java developers at JavaLand
Johan Janssen
 
Kubernetes laravel and kubernetes
Kubernetes   laravel and kubernetesKubernetes   laravel and kubernetes
Kubernetes laravel and kubernetes
William Stewart
 
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
Puppet
 
Continuous delivery with docker
Continuous delivery with dockerContinuous delivery with docker
Continuous delivery with docker
Johan Janssen
 
kubernetes for beginners
kubernetes for beginnerskubernetes for beginners
kubernetes for beginners
Dominique Dumont
 
[OpenInfra Days Korea 2018] Day 2 - E4 - 딥다이브: immutable Kubernetes architecture
[OpenInfra Days Korea 2018] Day 2 - E4 - 딥다이브: immutable Kubernetes architecture[OpenInfra Days Korea 2018] Day 2 - E4 - 딥다이브: immutable Kubernetes architecture
[OpenInfra Days Korea 2018] Day 2 - E4 - 딥다이브: immutable Kubernetes architecture
OpenStack Korea Community
 
4K–Kubernetes with Knative, Kafka and Kamel
4K–Kubernetes with Knative, Kafka and Kamel 4K–Kubernetes with Knative, Kafka and Kamel
4K–Kubernetes with Knative, Kafka and Kamel
Red Hat Developers
 
Nuxeo5 - Continuous Integration
Nuxeo5 - Continuous IntegrationNuxeo5 - Continuous Integration
Nuxeo5 - Continuous IntegrationPASCAL Jean Marie
 
Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next Frontier
Carlos Sanchez
 
Immutable kubernetes architecture by linuxkit
Immutable kubernetes architecture by linuxkitImmutable kubernetes architecture by linuxkit
Immutable kubernetes architecture by linuxkit
어형 이
 
Installing & Configuring IBM Domino 9 on CentOS
Installing & Configuring IBM Domino 9 on CentOSInstalling & Configuring IBM Domino 9 on CentOS
Installing & Configuring IBM Domino 9 on CentOS
Devin Olson
 

Similar to kubernetes - minikube - getting started (20)

kubernetes practice
kubernetes practicekubernetes practice
kubernetes practice
 
Introducing Docker
Introducing DockerIntroducing Docker
Introducing Docker
 
Kubernetes installation
Kubernetes installationKubernetes installation
Kubernetes installation
 
k8s practice 2023.pptx
k8s practice 2023.pptxk8s practice 2023.pptx
k8s practice 2023.pptx
 
Preparation study of_docker - (MOSG)
Preparation study of_docker  - (MOSG)Preparation study of_docker  - (MOSG)
Preparation study of_docker - (MOSG)
 
Docker and Kubernetes 101 workshop
Docker and Kubernetes 101 workshopDocker and Kubernetes 101 workshop
Docker and Kubernetes 101 workshop
 
Kubernetes
KubernetesKubernetes
Kubernetes
 
Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...
Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...
Gebruik dezelfde Docker container voor Java applicaties tijdens ontwikkelen e...
 
Install a micro k8s single node cluster of kubernetes on windows 10
Install a micro k8s single node cluster of kubernetes on windows 10Install a micro k8s single node cluster of kubernetes on windows 10
Install a micro k8s single node cluster of kubernetes on windows 10
 
Docker for Java developers at JavaLand
Docker for Java developers at JavaLandDocker for Java developers at JavaLand
Docker for Java developers at JavaLand
 
Kubernetes laravel and kubernetes
Kubernetes   laravel and kubernetesKubernetes   laravel and kubernetes
Kubernetes laravel and kubernetes
 
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
 
Continuous delivery with docker
Continuous delivery with dockerContinuous delivery with docker
Continuous delivery with docker
 
kubernetes for beginners
kubernetes for beginnerskubernetes for beginners
kubernetes for beginners
 
[OpenInfra Days Korea 2018] Day 2 - E4 - 딥다이브: immutable Kubernetes architecture
[OpenInfra Days Korea 2018] Day 2 - E4 - 딥다이브: immutable Kubernetes architecture[OpenInfra Days Korea 2018] Day 2 - E4 - 딥다이브: immutable Kubernetes architecture
[OpenInfra Days Korea 2018] Day 2 - E4 - 딥다이브: immutable Kubernetes architecture
 
4K–Kubernetes with Knative, Kafka and Kamel
4K–Kubernetes with Knative, Kafka and Kamel 4K–Kubernetes with Knative, Kafka and Kamel
4K–Kubernetes with Knative, Kafka and Kamel
 
Nuxeo5 - Continuous Integration
Nuxeo5 - Continuous IntegrationNuxeo5 - Continuous Integration
Nuxeo5 - Continuous Integration
 
Continuous Delivery: The Next Frontier
Continuous Delivery: The Next FrontierContinuous Delivery: The Next Frontier
Continuous Delivery: The Next Frontier
 
Immutable kubernetes architecture by linuxkit
Immutable kubernetes architecture by linuxkitImmutable kubernetes architecture by linuxkit
Immutable kubernetes architecture by linuxkit
 
Installing & Configuring IBM Domino 9 on CentOS
Installing & Configuring IBM Domino 9 on CentOSInstalling & Configuring IBM Domino 9 on CentOS
Installing & Configuring IBM Domino 9 on CentOS
 

kubernetes - minikube - getting started

  • 1. Minikube - Getting started (on windows) Introduction Local-machine Solutions for Kubernetes: Minikube What is Minikube? Running Kubernetes Locally via Minikube Requirements Install Oracle Virtual Box Enable Virtualization Install Minikube Windows: download minikube and add to path Windows Installer Install Kubectl Testing Setup Starting the cluster Some more minikube operations: Test it out Introduction Kubernetes can run on a range of platforms, from your laptop, to VMs on a cloud provider, to rack of bare metal servers. The effort required to set up a cluster varies from running a single command to crafting your own customized cluster. In this guide, i will walk you through creating kubernetes cluster for local development. If you just want to “kick the tires” on Kubernetes, we recommend the local Docker-based solution using MiniKube. Local-machine Solutions for Kubernetes: Minikube What is Minikube? 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. Minikube is the recommended method for you to create a single node kubernetes cluster locally for purposes of development and testing. Setup is completely automated and doesn’t require a cloud provider account. Use the Minikube getting started guide to try it out Running Kubernetes Locally via Minikube Minikube starts a single node kubernetes cluster locally for purposes of development and testing. Minikube packages and configures a Linux VM, Docker and all Kubernetes components, optimized for local development. Minikube supports Kubernetes features such as: DNS NodePorts ConfigMaps and Secrets Dashboards Minikube does not yet support Cloud Provider specific features such as: LoadBalancers PersistentVolumes Ingress Requirements Install Oracle Virtual Box Install Oracle virtual box
  • 2. 1. 2. Enable Virtualization VT-x/AMD-v virtualization must be enabled in BIOS. If you are able to run virtualbox on your windows machine, it should already be enabled for you. Install Minikube See the latest Minikube release for installation instructions. There are two methods for installing on windows. Windows: download minikube and add to path Download the file, rename it to and add it to your pathminikube-windows-amd64.exe minikube.exe Windows Installer Download the file, and execute the installer. This will automatically add minikube.exe to your path with anminikube-installer.exe uninstaller available as well. Install Kubectl kubectl must be on your path. Minikube currently supports any version of kubectl greater than 1.0, but it is recommended using the most recent version. The latest version of kubectl can be downloaded from .here Once downloaded put kucbectl to your windows path. Testing Setup Test minikube setup minikube version > minikube version minikube version: v0.13.1 minikube help minikube help > minikube help Minikube is a CLI tool that provisions and manages single-node Kubernetes clusters optimized for development workflows. Usage: minikube [command] Available Commands: addons Modify minikube's kubernetes addons completion Outputs minikube shell completion for the given
  • 3. shell (bash) config Modify minikube config dashboard Opens/displays the kubernetes dashboard URL for your local cluster delete Deletes a local kubernetes cluster. docker-env sets up docker env variables; similar to '$(docker-machine env)' get-k8s-versions Gets the list of available kubernetes versions available for minikube. ip Retrieve the IP address of the running cluster. logs Gets the logs of the running localkube instance, used for debugging minikube, not user code. service Gets the kubernetes URL(s) for the specified service in your local cluster ssh Log into or run a command on a machine with SSH; similar to 'docker-machine ssh' start Starts a local kubernetes cluster. status Gets the status of a local kubernetes cluster. stop Stops a running local kubernetes cluster. version Print the version of minikube. Flags: --alsologtostderr log to standard error as well as files --log_backtrace_at traceLocation when logging hits line file:N, emit a stack trace (default :0) --log_dir string If non-empty, write log files in this directory --logtostderr log to standard error instead of files --show-libmachine-logs Whether or not to show logs from libmachine. --stderrthreshold severity logs at or above this threshold go to stderr (default 2) --test.bench string regular expression per path component to select benchmarks to run --test.benchmem print memory allocations for benchmarks --test.benchtime duration approximate run time for each benchmark (default 1s) --test.blockprofile string write a goroutine blocking profile to the named file after execution --test.blockprofilerate int if >= 0, calls runtime.SetBlockProfileRate() (default 1) --test.count n run tests and benchmarks n times (default 1) --test.coverprofile string write a coverage profile to the named file after execution --test.cpu string comma-separated list of number of CPUs to use for each test --test.cpuprofile string write a cpu profile to the named file during execution --test.memprofile string write a memory profile to the
  • 4. named file after execution --test.memprofilerate int if >=0, sets runtime.MemProfileRate --test.outputdir string directory in which to write profiles --test.parallel int maximum test parallelism (default 4) --test.run string regular expression to select tests and examples to run --test.short run smaller test suite to save time --test.timeout duration if positive, sets an aggregate time limit for all tests (default 0s) --test.trace string write an execution trace to the named file after execution --test.v verbose: print additional output -v, --v Level log level for V logs --vmodule moduleSpec comma-separated list of
  • 5. pattern=N settings for file-filtered logging Use "minikube [command] --help" for more information about a command. kubernetes version supported by minikube minikube supported kubernetes versions > minikube get-k8s-versions The following Kubernetes versions are available: - v1.5.0-beta.1 - v1.4.3 - v1.4.2 - v1.4.1 - v1.4.0 - v1.3.7 - v1.3.6 - v1.3.5 - v1.3.4 - v1.3.3 - v1.3.0 Starting cluster in custome way
  • 6. > minikube.exe start --kubernetes-version="v1.4.0" / --vm-driver="virtualbox" --show-libmachine-logs --alsologtostderr W1207 00:16:20.958899 13400 root.go:139] Error reading config file at C:UsersMMehta.minikubeconfigconfig.json: open C:UsersMMehta.minikubeconfigconfig.json: The system cannot find the file specified. I1207 00:16:20.966391 13400 notify.go:112] Checking for updates... Starting local Kubernetes cluster... I1207 00:16:21.194417 13400 cluster.go:78] Machine exists! I1207 00:16:21.850475 13400 cluster.go:85] Machine state: Stopped (minikube) Check network to re-create if needed... (minikube) Waiting for an IP... Waiting for SSH to be available... Detecting the provisioner... Copying certs to the local machine directory... Copying certs to the remote machine... Setting Docker configuration on the remote daemon... Downloading localkube binary 78.78 MB / 78.78 MB [==============================================] 100.00% 0s I1207 00:18:20.137511 13400 cluster.go:275] Setting up certificates for IP: %s 192.168.99.100 I1207 00:18:20.270108 13400 cluster.go:212] sudo killall localkube || true I1207 00:18:20.348164 13400 cluster.go:214] killall: localkube: no process killed I1207 00:18:20.348663 13400 cluster.go:212] # Run with nohup so it stays up. Redirect logs to useful places. sudo sh -c 'PATH=/usr/local/sbin:$PATH nohup /usr/local/bin/localkube --generate-certs=false --logtostderr=true --enable-dns=false --node-ip=192.168.99.100 > /var/lib/localkube/localkube.out 2> /var/lib/localkube/localkube.err < /dev/null & echo $! > /var/run/localkube.pid &' I1207 00:18:20.434598 13400 cluster.go:214] I1207 00:18:20.626234 13400 start.go:171] Using kubeconfig: C:UsersMMehta/.kube/config Kubectl is now configured to use the cluster. Minikube cluster status
  • 7. 3. minikube cluster status > minikube status minikubeVM: Running localkube: Running > minikube status minikubeVM: Stopped localkube: N/A Cluster information Minikube cluster info > kubectl cluster-info Kubernetes master is running at https://192.168.99.100:8443 KubeDNS is running at https://192.168.99.100:8443/api/v1/proxy/namespaces/kube-system/servi ces/kube-dns kubernetes-dashboard is running at https://192.168.99.100:8443/api/v1/proxy/namespaces/kube-system/servi ces/kubernetes-dashboard To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'. kubectl client and server version kubectl version > kubectl version Client Version: version.Info{Major:"1", Minor:"3", GitVersion:"v1.3.0", GitCommit:"283137936a498aed572ee22af6774b6fb6e9fd94", GitTreeState:"clean", BuildDate:"2016-07-01T19:26:38Z", GoVersion:"go1.6.2 ", Compiler:"gc", Platform:"windows/amd64"} Server Version: version.Info{Major:"1", Minor:"4", GitVersion:"v1.4.6", GitCommit:"e569a27d02001e343cb68086bc06d47804f62af6", GitTreeState:"clean", BuildDate:"1970-01-01T00:00:00Z", GoVersion:"go1.7.1 ", Compiler:"gc", Platform:"linux/amd64"} Test kubectl setup
  • 8. Starting the cluster To start a cluster, run the command minikube start > minikube start Starting local Kubernetes cluster... Downloading Minikube ISO 36.00 MB / 36.00 MB [==============================================] 100.00% 0s Kubectl is now configured to use the cluster. This will build and start a lightweight local cluster, consisting of a master, etcd, Docker and a single node. Minikube will also create a “minikube” context, and set it to default in kubectl. To switch back to this context later, run this command: set context kubectl config use-context minikube To stop cluster: > minikube stop Stopping local Kubernetes cluster... Machine stopped. To delete cluster: delete cluster > minikube delete Deleting local Kubernetes cluster... Machine deleted. Minikube also includes the Kubernetes dashboard. Run this command to see the included kube-system pods:
  • 9. Get pods > kubectl get pods --all-namespaces NAMESPACE NAME READY STATUS RESTARTS AGE kube-system kube-addon-manager-minikube 1/1 Running 0 3m kube-system kube-dns-v20-u1vsu 3/3 Running 0 1m kube-system kubernetes-dashboard-0tymh 1/1 Running 0 1m Run this command to open the Kubernetes dashboard: Kube Dashboard > minikube.exe dashboard --url=true http://192.168.99.100:30000 > minikube dashboard Opening kubernetes dashboard in default browser... When nothing is up: When services and pods in action:
  • 10. 1. 2. 3. 4. Some more minikube operations: Cluster IP Cluster IP > minikube ip 192.168.99.100 Create deployment Deployment > kubectl run hello-minikube --image=gcr.io/google_containers/echoserver:1.4 --port=8080 deployment "hello-minikube" created Service > kubectl expose deployment hello-minikube --type=NodePort service "hello-minikube" exposed Get Pods Status 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:
  • 11. 5. Pod Status > kubectl get pod NAME READY STATUS RESTARTS AGE hello-minikube-3015430129-6qmgo 1/1 ContainerCreating 0 30ms Initially the container status would be: ".ContainerCreating". After some times it returns to "Running" Status. Pod Status > kubectl get pod NAME READY STATUS RESTARTS AGE hello-minikube-3015430129-6qmgo 1/1 Running 0 5m Get the service Get Services > kubectl get services NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE hello-minikube 10.0.0.118 <nodes> 8080/TCP 17m kubernetes 10.0.0.1 <none> 443/TCP 1h Information about a service Service description > kubectl describe service hello-minikube Name: hello-minikube Namespace: default Labels: run=hello-minikube Selector: run=hello-minikube Type: NodePort IP: 10.0.0.118 Port: <unset> 8080/TCP NodePort: <unset> 31436/TCP Endpoints: 172.17.0.4:8080 Session Affinity: None No events. > minikube service hello-minikube Opening kubernetes service default/hello-minikube in default browser...
  • 12. 6. 7. Scaling the service > kubectl scale --replicas=3 deployment/hello-minikube deployment "hello-minikube" scaled Now the status of deployment > kubectl.exe get deployment NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE hello-minikube 3 3 3 3 1h Stopping cluster
  • 13. 7. 1. 2. Stopping cluster > minikube stop Stopping local Kubernetes cluster... Machine stopped. Test it out List the nodes in your cluster by running: Get Nodes > kubectl get nodes NAME STATUS AGE minikube Ready 50m Minikube contains a built-in Docker daemon for running containers. If you use another Docker daemon for building your containers, you will have to publish them to a registry before minikube can pull them. You can use minikube’s built in Docker daemon to avoid this extra step of pushing your images. Use the built-in Docker daemon with: > eval $(minikube docker-env) References: http://kubernetes.io/docs/getting-started-guides http://kubernetes.io/docs/getting-started-guides/minikube/