Skip to content

a simple tutorial for running a dockerized app in kubernetes

License

Notifications You must be signed in to change notification settings

valerio/kubernetes-tutorial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kubernetes-tutorial

A simple guide for running a local kubernetes cluster (using minikube), dockerizing and deploying a simple web application.

Prerequisites

It's recommended that you already have a grasp on some Kubernetes basics, you can check this presentation for a quick introduction.

This tutorial assumes that the following tools are installed on the system:

  • minikube, for running a local kubernetes (k8s) cluster.
  • a virtualization driver for minikube (details in the minikube page).
  • kubectl, for managing the cluster, can be installed via homebrew.
  • docker, for creating a containerized application.
  • node.js, version 8+, for running the sample application, but feel free to use your own app/image.

Any application that can be dockerized can be used for this tutorial, as long as the docker image is available.

Setting up the cluster

Install a virtualization driver and minikube. Then run minikube start, it should look like this:

➜  ~ minikube start --vm-driver=hyperkit
Starting local Kubernetes v1.10.0 cluster...
Starting VM...
Getting VM IP address...
Moving files into cluster...
Setting up certs...
Connecting to cluster...
Setting up kubeconfig...
Starting cluster components...
Kubectl is now configured to use the cluster.
Loading cached images from config file.

Cluster is now ready to be used with kubectl. You can verify so by running:

➜  ~ kubectl get all
NAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
service/kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP   3m

You can also open the Kubernetes dashboard by running minikube dashboard, which will open a new browser window.

The Kubernetes dashboard gives information about the cluster at a quick glance, it also allows to run many of the actions that can be run via kubectl.

When the cluster is ready, head over to the first step: deploying your first container.

About

a simple tutorial for running a dockerized app in kubernetes

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published