lakukan pengecekan apabila konfigurasi sudah benar dengan command
aws eks list-clusters
{
"clusters": [
]
}
Create Cluster
Apabila sudah dapat melakukan list eks cluster seperti response diatas, maka langsung lakukan create cluster dengan eksctl. Langkah pertama create file cluster.yaml
cluster.yaml
---apiVersion:eksctl.io/v1alpha5kind:ClusterConfigmetadata:name:cluster-sapawarga-sgregion:ap-southeast-1nodeGroups: - name:node-cluster-sapawargainstanceType:m5.largedesiredCapacity:2cloudWatch:clusterLogging:# enable specific types of cluster control plane logsenableTypes: ["audit","authenticator","controllerManager"]
lalu jalankan command berikut
eksctl create cluster -f simple-cluster.yaml
tunggu beberapa saat dan cek dashboard Console AWS di Services > EC2 .
lakukan verifikasi akses Kubernetes cluster dengan CLI kubectl
kind:ServiceapiVersion:v1metadata:name:ingress-nginxnamespace:ingress-nginxlabels:app.kubernetes.io/name:ingress-nginxapp.kubernetes.io/part-of:ingress-nginxannotations:# replace with the correct value of the generated certificate in the AWS console service.beta.kubernetes.io/aws-load-balancer-ssl-cert: "arn:aws:acm:ap-southeast-1:924939894012:certificate/9f880639-7e47-41f4-bd9e-ed1f05616f1d"
# the backend instances are HTTPservice.beta.kubernetes.io/aws-load-balancer-backend-protocol:"http"# Map port 443service.beta.kubernetes.io/aws-load-balancer-ssl-ports:"https"# Ensure the ELB idle timeout is less than nginx keep-alive timeout. By default,# NGINX keep-alive is set to 75s. If using WebSockets, the value will need to be# increased to '3600' to avoid any potential issues.service.beta.kubernetes.io/aws-load-balancer-connection-idle-timeout:"60"spec:type:LoadBalancerselector:app.kubernetes.io/name:ingress-nginxapp.kubernetes.io/part-of:ingress-nginxports: - name:httpport:80targetPort:http - name:httpsport:443targetPort:http---