Kubernetes cluster in AWS - what instance types?

12/17/2015

I would like to try set up Kubernetes cluster in AWS for an application that consists of:

  • 5 Java-based microservices
  • 2 Node.JS microservices
  • MongoDB
  • Elasticsearch
  • MariaDB
  • RabbitMQ

AWS has been chosen instead of GCE, because other services, e.g. S3, are already being used. Currently the app is set up using Jelastic (https://jelastic.com/ - GUI for cluster management), however Jelastic ceased to suffice because of lack of automation tooling and also hardware provider had numerous outages.

Jelastic uses cloudlets as an abstraction of computer resources - one cloudlet is 200MHz CPU and 128MB RAM. The app uses about 150 cloudlets = 30 GHz CPU + 20GB RAM.

How would you recommend setting up the cluster in AWS? What instance types are the best for Kubernetes master and minions? Do you recommend running databases on the cluster as well as services, or is it better to spin up dedicated instances for them?

-- Jakub Kulhan
amazon-web-services
java
kubernetes

2 Answers

7/20/2016

To fine tune aws instance type requires a bit of trial & error ... for starters if you define these env vars prior to launching kube-up.sh

export MASTER_SIZE=t2.large # master instance type
export NODE_SIZE=t2.large   # minion instance type
export NUM_NODES=3          # determines number of minion instances

then once running closely read over output to call

kubectl describe nodes  

... typical output

  Namespace         Name                                CPU Requests    CPU Limits                                                                                                                        Memory Requests   Memory Limits
  ---------         ----                                ------------    ----------                                                                                                                        ---------------   -------------
  kube-system           elasticsearch-logging-v1-rvvnw                  100m (5%)                                                                                                                         100m (5%) 0 (0%)      0 (0%)
  kube-system           elasticsearch-logging-v1-ybz5n                  100m (5%)                                                                                                                         100m (5%) 0 (0%)      0 (0%)
  kube-system           fluentd-elasticsearch-ip-172-20-0-211.ec2.internal                                                                                                                                100m (5%) 0 (0%)      200Mi (5%)  200Mi (5%)
  kube-system           heapster-v1.1.0-1261016182-q18fr                288m (14%)                                                                                                                        288m (14%)    598916Ki (14%)  598916Ki (14%)
  kube-system           kibana-logging-v1-9337e                     100m (5%)                                                                                                                             100m (5%) 0 (0%)      0 (0%)
  kube-system           kube-dns-v17-iits3                      110m (5%)   110m (5%)                                                                                                                     120Mi (3%)    220Mi (5%)
  kube-system           kube-proxy-ip-172-20-0-211.ec2.internal             100m (5%)                                                                                                                     0 (0%)        0 (0%)      0 (0%)
  kube-system           kubernetes-dashboard-v1.1.0-ss59o               100m (5%)                                                                                                                         100m (5%) 50Mi (1%)   50Mi (1%)
  kube-system           monitoring-influxdb-grafana-v3-lzjq7                200m (10%)                                                                                                                    200m (10%)    600Mi (15%) 600Mi (15%)
  ruptureofthemundaneplane  loudspeed-deployment-3003771997-bybrm                                                                                                                                         0 (0%)        0 (0%)      0 (0%)      0 (0%)
  ruptureofthemundaneplane  mongo-deployment-2286179029-0bltg               0 (0%)                                                                                                                        0 (0%)        0 (0%)      0 (0%)
Allocated resources:
  (Total limits may be over 100%, i.e., overcommitted. More info: http://releases.k8s.io/HEAD/docs/user-guide/compute-resources.md)
  CPU Requests  CPU Limits  Memory Requests Memory Limits
  ------------  ----------  --------------- -------------
  1198m (59%)   998m (49%)  1592196Ki (39%) 1694596Ki (41%)

in above focus on that bottom set of resource usage % values

https://aws.amazon.com/ec2/instance-types/

https://aws.amazon.com/ec2/pricing/

tweak to achieve smallest/cheapest instance types without getting too high usage % values

-- Scott Stensland
Source: StackOverflow

12/18/2015

Can you please give us more information about your use case and automation you want to have? In Jelastic there is an automation tool called CloudScripting, with a help of this any kind of automation is possible.

-- Ihor Kolodyuk
Source: StackOverflow