From bdc5f27cdc084d466df5611eb84b09e95ad794f6 Mon Sep 17 00:00:00 2001 From: Fernando Rocha Date: Fri, 8 Nov 2024 12:20:13 -0800 Subject: [PATCH 1/4] Update setup-eks.md Signed-off-by: Fernando Rocha --- .../hosting/kubernetes/cluster/setup-eks.md | 78 +++++++++++++++++-- 1 file changed, 71 insertions(+), 7 deletions(-) diff --git a/daprdocs/content/en/operations/hosting/kubernetes/cluster/setup-eks.md b/daprdocs/content/en/operations/hosting/kubernetes/cluster/setup-eks.md index b6e9b774708..e0ef65be197 100644 --- a/daprdocs/content/en/operations/hosting/kubernetes/cluster/setup-eks.md +++ b/daprdocs/content/en/operations/hosting/kubernetes/cluster/setup-eks.md @@ -16,6 +16,7 @@ This guide walks you through installing an Elastic Kubernetes Service (EKS) clus - [AWS CLI](https://aws.amazon.com/cli/) - [eksctl](https://eksctl.io/) - [An existing VPC and subnets](https://docs.aws.amazon.com/eks/latest/userguide/network_reqs.html) + - [Dapr CLI](https://docs.dapr.io/getting-started/install-dapr-cli/) ## Deploy an EKS cluster @@ -25,20 +26,57 @@ This guide walks you through installing an Elastic Kubernetes Service (EKS) clus aws configure ``` -1. Create an EKS cluster. To use a specific version of Kubernetes, use `--version` (1.13.x or newer version required). +1. Create a new file called `cluster-config.yaml` and add the content below to it, replacing `[your_cluster_name]`, `[your_cluster_region]`, and `[your_k8s_version]` with the appropriate values: + + ```yaml + apiVersion: eksctl.io/v1alpha5 + kind: ClusterConfig + + metadata: + name: [your_cluster_name] + region: [your_cluster_region] + version: [your_k8s_version] + tags: + karpenter.sh/discovery: [your_cluster_name] + + iam: + withOIDC: true + + managedNodeGroups: + - name: mng-od-4vcpu-8gb + desiredCapacity: 2 + minSize: 1 + maxSize: 5 + instanceType: c5.xlarge + privateNetworking: true + + addons: + - name: vpc-cni # no version is specified so it deploys the default version + attachPolicyARNs: + - arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy + - name: coredns + version: latest # auto discovers the latest available + - name: kube-proxy + version: latest + - name: aws-ebs-csi-driver + wellKnownPolicies: # add IAM and service account + ebsCSIController: true + ``` + +1. Create the cluster by running the following command: ```bash - eksctl create cluster --name [your_eks_cluster_name] --region [your_aws_region] --version [kubernetes_version] --vpc-private-subnets [subnet_list_seprated_by_comma] --without-nodegroup + eksctl create cluster -f cluster.yaml ``` - - Change the values for `vpc-private-subnets` to meet your requirements. You can also add additional IDs. You must specify at least two subnet IDs. If you'd rather specify public subnets, you can change `--vpc-private-subnets` to `--vpc-public-subnets`. - -1. Verify kubectl context: + +1. Verify the kubectl context: ```bash kubectl config current-context ``` +## Implement Dapr requirements + 1. Update the security group rule to allow the EKS cluster to communicate with the Dapr Sidecar by creating an inbound rule for port 4000. ```bash @@ -49,11 +87,37 @@ This guide walks you through installing an Elastic Kubernetes Service (EKS) clus --source-group [your_security_group] ``` +2. Dapr 1.14 Scheduler service requires a default storage class to be set. If you don't have one, patch your cluster with the command below: + +```bash +kubectl patch storageclass gp2 -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}' +``` + +## Install Dapr + +Install Dapr on your cluster by running: + +```bash +dapr init -k +``` + +You should see the following response: + +```bash +⌛ Making the jump to hyperspace... +ℹ️ Note: To install Dapr using Helm, see here: https://docs.dapr.io/getting-started/install-dapr-kubernetes/#install-with-helm-advanced + +ℹ️ Container images will be pulled from Docker Hub +✅ Deploying the Dapr control plane with latest version to your cluster... +✅ Deploying the Dapr dashboard with latest version to your cluster... +✅ Success! Dapr has been installed to namespace dapr-system. To verify, run `dapr status -k' in your terminal. To get started, go here: https://docs.dapr.io/getting-started +``` + ## Troubleshooting ### Access permissions -If you face any access permissions, make sure you are using the same AWS profile that was used to create the cluster. If needed, update the kubectl configuration with the correct profile: +If you face any access permissions, make sure you are using the same AWS profile that was used to create the cluster. If needed, update the kubectl configuration with the correct profile. More information [here](https://repost.aws/knowledge-center/eks-api-server-unauthorized-error): ```bash aws eks --region [your_aws_region] update-kubeconfig --name [your_eks_cluster_name] --profile [your_profile_name] From 9d59f943d5915a9fd21562746eead7fd15f9f702 Mon Sep 17 00:00:00 2001 From: Fernando Rocha Date: Fri, 8 Nov 2024 12:34:40 -0800 Subject: [PATCH 2/4] Update setup-eks.md Signed-off-by: Fernando Rocha --- .../en/operations/hosting/kubernetes/cluster/setup-eks.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/daprdocs/content/en/operations/hosting/kubernetes/cluster/setup-eks.md b/daprdocs/content/en/operations/hosting/kubernetes/cluster/setup-eks.md index e0ef65be197..6c4e05f3aa8 100644 --- a/daprdocs/content/en/operations/hosting/kubernetes/cluster/setup-eks.md +++ b/daprdocs/content/en/operations/hosting/kubernetes/cluster/setup-eks.md @@ -51,15 +51,15 @@ This guide walks you through installing an Elastic Kubernetes Service (EKS) clus privateNetworking: true addons: - - name: vpc-cni # no version is specified so it deploys the default version + - name: vpc-cni attachPolicyARNs: - arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy - name: coredns - version: latest # auto discovers the latest available + version: latest - name: kube-proxy version: latest - name: aws-ebs-csi-driver - wellKnownPolicies: # add IAM and service account + wellKnownPolicies: ebsCSIController: true ``` From 4cdc8eb8cbcec1496054be08a8b25ad3f0b3a426 Mon Sep 17 00:00:00 2001 From: Fernando Rocha Date: Fri, 8 Nov 2024 12:36:55 -0800 Subject: [PATCH 3/4] Update setup-eks.md Signed-off-by: Fernando Rocha --- .../en/operations/hosting/kubernetes/cluster/setup-eks.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/daprdocs/content/en/operations/hosting/kubernetes/cluster/setup-eks.md b/daprdocs/content/en/operations/hosting/kubernetes/cluster/setup-eks.md index 6c4e05f3aa8..8a1622e212a 100644 --- a/daprdocs/content/en/operations/hosting/kubernetes/cluster/setup-eks.md +++ b/daprdocs/content/en/operations/hosting/kubernetes/cluster/setup-eks.md @@ -75,7 +75,7 @@ This guide walks you through installing an Elastic Kubernetes Service (EKS) clus kubectl config current-context ``` -## Implement Dapr requirements +## Add Dapr requirements for sidecar access and default storage class: 1. Update the security group rule to allow the EKS cluster to communicate with the Dapr Sidecar by creating an inbound rule for port 4000. @@ -89,9 +89,9 @@ This guide walks you through installing an Elastic Kubernetes Service (EKS) clus 2. Dapr 1.14 Scheduler service requires a default storage class to be set. If you don't have one, patch your cluster with the command below: -```bash -kubectl patch storageclass gp2 -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}' -``` + ```bash + kubectl patch storageclass gp2 -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}' + ``` ## Install Dapr From 6bf11fbc3fecb77e32c61aeb9e19a230663041dc Mon Sep 17 00:00:00 2001 From: Fernando Rocha Date: Fri, 8 Nov 2024 12:52:00 -0800 Subject: [PATCH 4/4] Update setup-eks.md Signed-off-by: Fernando Rocha --- .../en/operations/hosting/kubernetes/cluster/setup-eks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daprdocs/content/en/operations/hosting/kubernetes/cluster/setup-eks.md b/daprdocs/content/en/operations/hosting/kubernetes/cluster/setup-eks.md index 8a1622e212a..6a87484cc36 100644 --- a/daprdocs/content/en/operations/hosting/kubernetes/cluster/setup-eks.md +++ b/daprdocs/content/en/operations/hosting/kubernetes/cluster/setup-eks.md @@ -87,7 +87,7 @@ This guide walks you through installing an Elastic Kubernetes Service (EKS) clus --source-group [your_security_group] ``` -2. Dapr 1.14 Scheduler service requires a default storage class to be set. If you don't have one, patch your cluster with the command below: +2. Add a default storage class if you don't have one: ```bash kubectl patch storageclass gp2 -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}'