Basic Load Balancing with Kubernetes

Howto: Getting Started with Kubernetes and Basic Load Balancing

This posting describes a way to deploy a service, expose it via the NodePort, scale it to 3 and observe basic load balancing. Enjoy!

Run a microservice on Kubernetes

First create a deployment which also creates a pod. This deployment was used in several conferences to demonstrate Docker features. It’s proven as suitable container to explore load balancing for Kubernetes.

$ kubectl run micro --image=fmunz/micro --port=80

deployment "micro" created


$ kubectl get pods

NAME                           READY     STATUS    RESTARTS   AGE
micro-7b99d94476-9tqx5         1/1       Running   0          5m

Expose the micro service

Before you can access the service from the outside, it has to be exposed:

$ kubectl get deployments

NAME          DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
micro   1         1         1            1           7m


$ kubectl expose deployment micro --type=NodePort

service “micro” exposed

Find out its port number

$ kubectl describe service micro | grep NodePort

Scale service to 3

$ kubectl scale --replicas=3 deployment/micro

deployment "micro" scaled

$ kubectl get deployments
NAME          DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
hello-nginx   3         3         3            3           1d

Explore the load balancing

Now you will have 3 pods running the micro service. Acces the service via the browser with the following URL:

http://localhost:NODE_PORT

Refresh the page 3 times. You will see that different pods will serve your request because a different IP is returned each time.

Artikel: Oracle WebLogic Server und Fusion Middleware in der Cloud

German only. Heute exklusiv auf deutsch ein Artikel den ich für das DOAG Magazin im Früjahr 2011 geschrieben habe:
Download: Oracle Fusion Middleware und WebLogic Server in der Cloud (PDF)

  • Cloud Dienste oder Fusion Middleware Features?
  • Was zeichnet eine echte Cloud aus?
  • Architektur Blueprint für die AWS Cloud und Java EE Anwendungen.

Teile des Artikels sowie zahlreiche Grafiken sind aus meinem “Middleware and Cloud Computing” entommen. Viel Spaß beim Lesen!

 

large tornado over the road (3D rendring)

Usage of Oracle Exadata, Exalogic, Oracle Fusion Middleware and Enterprise Manager within Oracle

Oracle is eating its own dog food.

Here is an interesting slide set from OOW11 about how Oracle is using it’s own hardware and software.

Still a lot of Oracle appserver to see instead of WebLogic..

2-day Amazon AWS Cloud Computing Workshop / Training Course

For an updated version of this workshop see here or contact me directly.

I’ll be offering a 2-day cloud computing workshop 2+3. May 2011 in city center of Munich. A second event is planned for Sydney later this year and will be announced by the Australian Oracle User Group.

After a basic introduction and the discussion of common misconceptions we will cover advanced topics such as how to achieve true elasticity, load balancing in clouds, queueing, notifications and databases in clouds. This workshop is centered around Amazon Web Services (AWS) technologies such as EC2 EBS images, RDS, SQS, SNS, ELB etc.

The workshop includes a free copy of my Middleware and Cloud Computing book, printed course material, a pre-configured lab environment to take home as a virtual image on DVD.

Please contact me via email for registration and further details.

Win a Copy of Middleware and Cloud Computing Book

If you are interested in Middleware and Cloud Computing subscribe to my my newsletter and win one of the first two copies of my brand new cloud computing book. The drawing will be Dec. 15th 2010.

There are only 4 mailings per year and you can unsubscribe any time from the newsletter.

Oracle Middleware and Cloud Computing Book