How do I deploy a shopping app on a Kubernetes Cluster?

8/7/2018

I am new to container orchestration and would like to deploy an shopping app on a kubernetes cluster that can automatically scale up and down its nodes based on the traffic coming its way (for example during end-of-season sale, it should automatically scale up). Do ingress controller and loadbalancer play a role in this? Also, I would like to use daemon sets instead of deployments. Can anyone pls guide met through this?

-- Bunny
kubernetes

1 Answer

8/8/2018

Ingress controller and Load Balancer are only responsible for delivering incoming traffic to the cluster. They are not responsible for scaling pods or nodes.

There are two types of scalers in Kubernetes:

Horizontal Pod Autoscaler (HPA) is responsible for running/stopping additional pods when pod metrics shows that load of existing pods is more/less than the configured threshold value.

Cluster Autoscaler is responsible for provisioning additional nodes to a cluster when new pod should be scheduled, but existing nodes have not enough resources to run it. It’s also responsible for draining and terminating nodes when average utilization of nodes decreases.

You can find a more detailed explanation of how to scale the Kubernetes cluster in the article.

Daemonset is responsible for running one instance of a specific pod on each node. It is used mostly for monitoring and log collection.

Use a Deployment for stateless services, like frontends, where scaling up and down the number of replicas and rolling out updates are more important than controlling exactly which host the Pod runs on. Use a DaemonSet when it is important that a copy of a Pod always run on all or certain hosts, and when it needs to start before other Pods.

Cluster Autoscaler will not work as expected if you decide to use DaemonSets instead of Deployments.

-- VAS
Source: StackOverflow