Pada langkah awal lakukan inisiasi awscli dengan IAM Users yang memiliki policy AdministratorAccess seperti gambar di bawah.
lalu lakukan configure untuk awscli dengan menggunakan
aws configure
AWS Access Key ID [****************NT5Q]: <YOUR_ACCESS_KEY>
AWS Secret Access Key [****************9mlg]: <YOUR_SECRET_KEY>
Default region name [ap-southeast-1]: <YOUR_REGION>
Default output format [json]:
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
kind: Service
apiVersion: v1
metadata:
name: ingress-nginx
namespace: ingress-nginx
labels:
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/part-of: ingress-nginx
annotations:
# 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 HTTP
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: "http"
# Map port 443
service.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: LoadBalancer
selector:
app.kubernetes.io/name: ingress-nginx
app.kubernetes.io/part-of: ingress-nginx
ports:
- name: http
port: 80
targetPort: http
- name: https
port: 443
targetPort: http
---