Skip to content

Latest commit

 

History

History
128 lines (80 loc) · 3 KB

README_PartII.md

File metadata and controls

128 lines (80 loc) · 3 KB

Simple Kubernetes example (cont.)

back

PART II: Deploy Nginx with storage

1. Deploy Nginx with a local volume

(Best option for development environments)

Architecture

Kubernetes-local_devel

1.1. Run Kubernetes on Minikube

Minikube settings: Global: cat ~/.minikube/config/config.json , Local: cat ~/.minikube/machines/minikube/config.json , Command: minikube config [set|get] --help

1.2. Setup Minikube driver

  • VirtualBox
  1. Install VirtualBox + VirtualBox VM VirtualBox Extension Pack: https://www.virtualbox.org/wiki/Downloads
  2. Set default driver: minikube config set vm-driver virtualbox
  • KVM2
  1. Install KVM2: https://github.com/kubernetes/minikube/blob/master/docs/drivers.md#kvm2-driver
  2. Set default driver: minikube config set vm-driver kvm2

1.3. Deploy test environment: Local volume

(from: https://kubernetes.io/docs/tasks/configure-pod-container/configure-persistent-volume-storage/)

  • Create environment: Start MiniKube, mount folder & apply k8s scripts
make localv_up
  • View results
make localv_results

Output: This is a HOSTPATH test

  • Destroy environment
make localv_down

2. Deploy Nginx with a GlusterFS volume

Architecture

Kubernetes-inhouse

Steps

  • Create environment: Start Vagrant instances, provision K8s, provision GlusterFS, deploy Nginx pod
make glusterv_up
  • View results
vagrant ssh k8sMaster
    $ curl http://192.168.32.12:$(kubectl get svc mynginx -o json | jq -j '.spec.ports[0].nodePort')

Output: This is a GLUSTERFS test

  • Destroy environment
make glusterv_down

Dependencies

  • Exposing services: Expose an application outside a Kubernetes cluster using a Service

3. Deploy Nginx with a Google Compute Engine (GCE) Persistent Disk volume !!EXPERIMENTAL!!

(TODO)

Architecture

Kubernetes-cloud

Steps

  • Commands
make gcev_apply

back