With the recent maturation of the MSA architecture, more and more people are looking at Kubernetes environments. As a result, many developers and engineers are taking a deeper dive into Kubernetes. In this article, we will discuss cloud vendor usage, autoscaling strategies, deployment strategies, and other things to consider when organizing your Kubernetes architecture.
A typical Kubernetes structure consists of a Master and Woker Nodes, as shown in the figure below.
With Amazon EKS, the management of the master node is supported by AWS rather than by the operator, which means that even complex tasks such as updating the cluster can be done simply from the AWS Console. In addition, Amazon EKS's AutoScaler can dynamically adjust the number of Cluster Nodes using AWS's Auto Scaling Groups, and monitoring and logging can be done without any configuration. But it's not all good news.
Amazon EKS has a per-cluster management fee, so for smaller clusters or single instances, you may want to consider building your own with EC2 if it is less of an administrative burden, such as clustering directly to EC2.
https://aws.amazon.com/ko/eks/pricing/
AutoScaling is essential for stable operation. In particular, Kubernetes requires AutoScaling for Pods and AutoScaling for Nodes to be applied simultaneously to ensure stable operation. Flexible AutoScaling can also lead to lower operating costs.
Adds nodes to an Auto Scaling Group when there are pods pending due to insufficient AWS Cluster Autoscaler resources.
If all nodes run out of resources, here → Pod pending
Source: https://awskrug.github.io/eks-workshop/spotworkers/
The basic strategy is as follows
By utilizing Taint, you can force Pods to be assigned to a Spot only when they cannot be assigned to Ondemand.
The biggest concern with using Spot is that a Spot Instance can be terminated at any time. To prevent this from happening, you need to take the following actions.
What makes this possible is the AWS Node Termination Handler.
If you use the IDMS method, it will be installed as a DaemonSet and installed on all Nodes, monitoring the metadata of the instance and then performing the previously described process when it is due for termination. (Applies only to Spot Nodes using Label)
Once you have created a cluster on EKS, created a NodeGroup and applied the AutoScaling strategy, you are done with the basic architecture. You can now configure the following architecture to build/deploy your application on Kubernetes.
I know that many people are hesitant to adopt Kubernetes environments into production because of the learning curve. But as the comedian Myung Soo Park says, "It is better late than never," and I think it is time to jump on the Kubernetes bandwagon before it is too late.