Quote
Hello @all, long time no see, itβs me again. Sorry, I donβt have time for doing personal blogging, but my job is crazy disaster, anything need to ready and I feel not well with my health to control over two things. Now, I take a break and donβt touch anything, therefore I write a blog again. Today, I learn a lot to setup first EKS cluster, especially Milvus Cluster as VectorDB. Letβs digest
Talk a bit about EKS
If you first time to come up with Kubernetes, you can enjoy and learn more about this techniques inside couple of my blog, that huge and truly insane
- Kubewekend Session 3: Basically about Kubernetes architecture
- Azure Kubernetes Service
- DevOps Training Session 13: Cloud - K8s Overview
Back again with EKS, Itβs Kubernetes Services of AWS Cloud, try to explore more about that at Amazon EKS - Kubernetes concepts
Info
Amazon Elastic Kubernetes Service (Amazon EKS) is an AWS managed service based on the open sourceΒ KubernetesΒ project. While there are things you need to know about how the Amazon EKS service integrates with AWS Cloud (particularly when you first create an Amazon EKS cluster)
As you can see in description, EKS is built and used as usual Kubernetes but leverage in AWS Resources, Itβs mean you will bring Kubernetes to approach with S3, ALB (Application Load Balancer), EBS (GP2, GP3), VPC, and β¦
To create and get for yourself one EKS Cluster, you need to approach at least with one of things eksctl - The official CLI for Amazon EKS. But, you can use Terraform or Pulumi to handle the job created with same effort, itβs totally up to you.
Note
Kubernetes is one of interesting technology nowadays, no one can refuse that and you will have multiple way to approach, and you can handle your cluster in multiple way. But with EKS, leverage in AWS Resources bring back you more challenge and powerful, you can get more value from them
You can try to calculate your cluster setup cost around how much and I think you will fair enough to give EKS a chance to work in your organizations, follow the link to get more information. (NOTE: EKS will charge much money, you will pay for EC2, EBS and Control Plane. But you need to concern use newest version to prevent charge extended support EKS with high price)
BTW, EKS is well place where you want to both used AWS Resources and operating microservice used them, that tuff with price but high quality back. I think itβs fair enough but if you choose you can concern with AKS, DOKS, β¦
Set up Milvus in EKS
Info
Turn back the story, I need to focus setup Milvus VectorDB inside EKS and Itβs about journey to handle that but really pitfall you need to catch and I try to warn about that with you to get good setup
Install and Setup Prerequisites
You can read about setup through article Deploy a Milvus Cluster on EKS. Following the documentation, you need to prepare some tools inside your machine, such as
- AWS CLI - AWS Command Line
- Kubectl - Kubernetes Command Line
- helm - Kubernetes Package Managers
- eksctl - The official CLI for Amazon EKS. (NOTE: Install version
0.194.0
, reason why you will know in down below)
Next you need to prepare IAM to access into AWS Organization. For me, I usually handle AWS with highest permission AdministratorAccess
, Itβs totally not recommend.
-
But as usual, when you want to quick setup and not want to corrupt anything in provisioning progress, choosing highest permission is better way. BTW, you can try to define one of these as EKS Policies, if you want to keep anything secure
-
With Milvus Cluster require S3 Access, you need to define add-on permission for this resource. You can do specific for what bucket created for Milvus or you can use highest permission of S3 like
AmazonS3FullAccess
Setup Bucket for Milvus
In my circumstance, I prefer to use terraform for provisioning s3 bucket
After setup code block to create aws_s3_bucket
, you need to run terraform workflow
Setup EKS Cluster
As you can see, EKS have multiple ways to setup, and we can choose to use eksctl
for new way to provision cluster for us, why not.
eksctl
will create EKS cluster by using AWS Cloudformation. With default
, when you try to run easy command with eksctl
, you will get one managed nodegroup containing two m5.large
nodes.
But in this case, I will try to make more customize because eksctl
permits us to do stuff like define what VPC, EC2 Size, Plugin, β¦ You will have file like this
After you define, you can use eksctl
command to setup your cluster
Wait around 10 - 15 mins, and you can get kubeconfig from aws eks
command
And now, you can use kubectl
to retrieve new cluster.
But hold on, before we go to next one, I will help you prevent some mistake inside eksctl
in V0.193.0
to relate with issue https://github.com/eksctl-io/eksctl/issues/7987
This bug will create error when you try to create load balancer with serviceAccount permission, you will assign for aws-load-balancer-controller
in next part. This service account will miss two configuration and cause you a noise when create load balancing
elasticloadbalancing:DescribeListenerAttributes
elasticloadbalancing:ModifyListenerAttributes
So why I give you advice to install eksctl
in V0.194.0
because the commit is attached with this version. You can read about fix at https://github.com/eksctl-io/eksctl/blob/v0.194.0/pkg/cfn/builder/iam_test.go#L503
But if you unlucky to see this warning, donβt afraid you can fix it up if you can find exactly role attach with your service account inside AWS IAM, modify context with add elasticloadbalancing:DescribeListenerAttributes
and save to apply
Next, you will do second work relate about your exist VPC and Subnet because you use VPC CNI
to setup network inside Cluster. Therefore, It means to your pod will try discover and make conversation via that network, load balancer work and spawn inside subnet, you need to add following tag if aws doesnβt add it for you. Read more about this one at View Amazon EKS networking requirements for VPC and subnets
Warning
If you want to deploy load balancers to a subnet, the subnet must have the following tag:
- Private Subnet:
kubernetes.io/role/internal-elb
:1
- Public Subnet:
kubernetes.io/role/elb
:1
- Public and Private Subnet:
kubernetes.io/cluster/<name-cluster>
:shared
Some advices and best practices when you try combine EKS with VPC to load balancer
- VPC and Subnet Considerations
- How do I automatically discover the subnets that my Application Load Balancer uses in Amazon EKS?
Setup StorageClass
Note
Milvus usesΒ
etcd
Β as meta storage and needs to rely on theΒgp3
Β StorageClass to create and manage PVC.
You can check addons
in cluster.yaml
, you will see aws-ebs-csi-driver
that one is driver CSI to help your cluster connect and create EBS from your Kubernetes. To do that stuff, Kubernetes have StorageClass
to define information about communicate mechanism
After you copy and put that in the file, you can try to apply this manifest into exist EKS with kubectl
Setup AWS LoadBalancer Controller
You have multiple way to help your service go live in Kubernetes, such as Ingress, API Gateway and LoadBalancer. With EKS, if you donβt want to become frustrated to setup something strange inside cluster, do best practice aws loadbalancer to reduce lot of complex. (NOTE: Sometime Itβs truly exist funny error, but itβs up to you π)
Easily to setup aws-load-balancer-controller
, we can use helm
for easier applying definition to our cluster directly. You can read blog of mine about What is Helm
Install the AWS Load Balancer Controller with aws-load-balancer-controller
chart
Wait a bit and you can see result with kubectl
command
You need to learn about how to use aws-load-balancer-controller
, I think you concern to refer with AWS Load Balancer Controller Documentation
Setup Milvus Cluster
Note
Now your cluster is ready to setup, you need to use
helm
to import chart and start installation.
Because Milvus Cluster is not running as standalone, your configuration can become complicate a bit, so for convenient, you need to prepare milvus.yaml
to help helm
create expectation Milvus cluster. To know about how configuration, you can try to access to ArtifactHub - milvus and find what things you need to overwrite or not
Now you can reach to helm
and create cluster what you want
Now you need to wait to all of components work with no error, you will meet some problem because reason
- App restart one to two time for wait
etcd
andkafka
already ready - You canβt modify replica number
etcd
,kafka
andzookeeper
with cluster mode because you will meet the error related with replicate factor
Your patience will get fair result if you wait enough long π. Just kidding, you can try to get cluster with kubectl
To get svc and attu, you can try another kubectl command
Adjust domain for Milvus
Before you can approach this UI, you need to handle to map your expectation domain with TLS to ready connect from browser
You can use Terraform to create Route53 record, if your domain will serve and managed with supportive from ACM (AWS Certificate Managed), your new domain will help you serve TLS, HTTPS quickly
Run terraform workflow and you will try to connect into Milvus Cluster from browser.
Note
Your start user and password with Milvus Cluster is
root:Milvus
WARNING: NEED TO CHANGE AFTER FIRST LOGIN
Conclusion
Success
Thatβs all thing, I want to share with you when I create first EKS for myself, and itβs good experience to have opportunity to do, capture the journey and share to whole of you. I thinks EKS is not hard to setup, quite easily but when you try to leverage AWS Services, you need to make sure you control over of that because if you mess up, your cost will reach to huge number.
Quote
Couple tough week with me, not have any mood to handover anything else, mess up with work and do some stuff didnβt make me comfortable. This week is kind of that, but I put it back and try to reach to good feeling, back again with useful article and hope so you feel well with this one. Thanks again buddy, stay safe, learn a new thing and we will meet in next weekend. Bye π