Skip to content

csmende/nug-k8s-event

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 

Repository files navigation

nug-k8s-event

##NetApp User Group (NUG) Kuberenetes Event

This is a simple runthrough where we will be setting up a Kubernetes cluster, deploying a simple web app to test and scale.

Prerequisites

  1. Sign up a new account at GCP, AWS or Azure. Free credits are everywhere!
  2. Sign up at https://cloud.netapp.com

Install Kubectl

  1. If you chose GCP or Azure, you have Cloud Shell with kubectl installed. Good choice.

  2. If you chose AWS, fire up an Ubuntu instance & install kubectl.

     sudo snap install kubectl --classic
    
  3. Test your install.

     kubectl version
    

Launch a NetApp Kubernetes Service cluster

  1. Go to https://cloud.netapp.com, sign in and click on NetApp Kubernetes Service Start Free Trial.
  2. Select + New Cluster.
  3. Choose your cloud and follow authentication instructions. GCP & AWS are easiest.
  4. Wait for cluster to show successful install.

Add a load balancer

  1. Click into your cluster, and scroll down to + Service.
  2. Select HAproxy and click install.

Configure kubectl environment

  1. Set variables & context.

     export KUBECONFIG=/path/to/kubeconfig
     kubectl config use-context stackpoint
    
  2. Test the connection to your cluster.

     kubectl get nodes
    

Deploy whoami

  1. Let’s deploy whoami from GitHub, https://hub.docker.com/r/emilevauge/whoami/

     kubectl run whoami --image=emilevauge/whoami
    
  2. Scale the deployment to four replicas.

     kubectl scale deployment/whoami --replicas=4
    
  3. Allow port 80 traffic.

     kubectl expose deployment/whoami --port=80 --target-port=80 --type=NodePort
    

Configure Ingress Rules

  1. Grab the whoami-ingress.yaml file & create ingress rules.

     kubectl create -f whoami-ingress.yaml
    
  2. Check ingress routes for whoami.

     kubectl get ingress/whoami
    

Test access to whoami app.

  1. Hit the web service via the HA Proxy load balancer IP.

     curl -s http://xx.xx.xx.xx
    

Test lots of access!

  1. Grab the whoami-hammer.sh script file.

  2. Modify the script to point at your HA Proxy IP.

  3. Run the script - it will poll the service 10 times by default.

     sh whoami-hammer.sh
    
  4. See the distribution of hits across the four workers.

  5. Adjust the number of replicas & rerun the hammer script.

     kubectl scale deployment/whoami --replicas=8
     sh whoami-hammer.sh
    

Enjoy!

  1. You now have a fully functional Kubernetes cluster running with a sample app.
  2. Explore some of the other services like Prometheus for logging.

DELETE ALL THE THINGS.

Don't forget to remove your cluster when you're done!

Thank You

Special thanks to @DazWilkin for this idea via his medium.com article.

About

NetApp Kubernetes Service Files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages