Skip to content

Commit 32dfc92

Browse files
Update README
1 parent 5882059 commit 32dfc92

8 files changed

+25
-62
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
55

66
# terraform
7-
terraform.tfstate
87
devops/*/.terraform
98
devops/*/.terraform.*
9+
devops/*/.terraform.tfstate.*
1010

1111
# User-specific files
1212
*.rsuser

AWS/load-balancer-role-trust-policy.json

Lines changed: 0 additions & 18 deletions
This file was deleted.

README.md

Lines changed: 5 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Deploy a sample .Net6 WebAPI to Amazon EKS with Github Actions
1111

1212
+ Update kubeconfig
1313
```
14-
aws eks update-kubeconfig --region ap-southeast-1 --name eks-github
14+
aws eks update-kubeconfig --region ap-southeast-1 --name webapi-eks
1515
```
1616

1717
+ Create Role
@@ -23,7 +23,7 @@ aws iam attach-role-policy --policy-arn arn:aws:iam::aws:policy/AmazonEKSCluster
2323

2424
+ oidc-provider and cluster
2525
```
26-
eksctl utils associate-iam-oidc-provider --region=ap-southeast-1 --cluster=eks-github --approve
26+
eksctl utils associate-iam-oidc-provider --region=ap-southeast-1 --cluster=webapi-eks --approve
2727
```
2828

2929
+ Create policy
@@ -53,20 +53,20 @@ aws iam attach-role-policy --role-name AmazonEKSLoadBalancerControllerRole --po
5353

5454
+ Create Service Account
5555
```
56-
eksctl create iamserviceaccount --cluster=eks-github --namespace=kube-system --name=aws-load-balancer-controller --role-name AmazonEKSLoadBalancerControllerRole --attach-policy-arn=arn:aws:iam::ACCOUNT_ID:policy/ALBIngressControllerIAMPolicy --override-existing-serviceaccounts --approve
56+
eksctl create iamserviceaccount --cluster=webapi-eks --namespace=kube-system --name=aws-load-balancer-controller --role-name AmazonEKSLoadBalancerControllerRole --attach-policy-arn=arn:aws:iam::ACCOUNT_ID:policy/ALBIngressControllerIAMPolicy --override-existing-serviceaccounts --approve
5757
5858
kubectl apply -f AWS/aws-load-balancer-controller-service-account.yml
5959
```
6060

6161
+ Get IAM Service Account
6262
```
63-
eksctl get iamserviceaccount --cluster eks-github
63+
eksctl get iamserviceaccount --cluster webapi-eks
6464
6565
kubectl describe sa aws-load-balancer-controller -n kube-system
6666
6767
kubectl apply -k "github.com/aws/eks-charts/stable/aws-load-balancer-controller/crds?ref=master"
6868
69-
helm install aws-load-balancer-controller eks/aws-load-balancer-controller --set clusterName=eks-github --set serviceAccount.create=false --set serviceAccount.name=aws-load-balancer-controller -n kube-system
69+
helm install aws-load-balancer-controller eks/aws-load-balancer-controller --set clusterName=webapi-eks --set serviceAccount.create=false --set serviceAccount.name=aws-load-balancer-controller -n kube-system
7070
```
7171

7272
+ Verify that the AWS Load Balancer Controller is installed:
@@ -79,43 +79,6 @@ kubectl get deployment -n kube-system aws-load-balancer-controller
7979
kubectl logs -n kube-system deployment.apps/aws-load-balancer-controller
8080
```
8181

82-
83-
### Apply Terraform
84-
+ Create Infrastructure EKS
85-
```
86-
cd devops\terraform
87-
terraform init
88-
terraform apply
89-
```
90-
91-
+ Update kubeconfig
92-
```
93-
aws eks update-kubeconfig --region ap-southeast-1 --name microservice-eks-00mIoI2W
94-
```
95-
96-
+ Create Service Account
97-
```
98-
eksctl create iamserviceaccount --cluster=microservice-eks-00mIoI2W --name=aws-load-balancer-controller --namespace=kube-system --role-name eksctl-eks-github-addon-iamserviceaccount-ku-Role1 --attach-policy-arn=arn:aws:iam::783560535431:policy/ALBIngressControllerIAMPolicy --override-existing-serviceaccounts --approve
99-
100-
kubectl apply -f aws/aws-load-balancer-controller-service-account.yml
101-
```
102-
103-
+ Get IAM Service Account
104-
```
105-
eksctl get iamserviceaccount --cluster microservice-eks-00mIoI2W
106-
107-
kubectl describe sa aws-load-balancer-controller -n kube-system
108-
109-
kubectl apply -k "github.com/aws/eks-charts/stable/aws-load-balancer-controller/crds?ref=master"
110-
111-
helm install aws-load-balancer-controller eks/aws-load-balancer-controller --set clusterName=microservice-eks-00mIoI2W --set serviceAccount.create=false --set serviceAccount.name=aws-load-balancer-controller -n kube-system
112-
```
113-
114-
+ Verify the AWS Load Balancer Controller
115-
```
116-
kubectl get deployment -n kube-system aws-load-balancer-controller
117-
```
118-
11982
### Issues
12083
+ Couldn't create an AWS Load Balancer Controller
12184
```

AWS/aws-load-balancer-controller-service-account.yml renamed to devops/AWS/aws-load-balancer-controller-service-account.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ metadata:
77
name: aws-load-balancer-controller
88
namespace: kube-system
99
annotations:
10-
eks.amazonaws.com/role-arn: arn:aws:iam::[AccountID]:role/AmazonEKSLoadBalancerControllerRole
10+
eks.amazonaws.com/role-arn: arn:aws:iam::783560535431:role/AmazonEKSLoadBalancerControllerRole
File renamed without changes.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"Version": "2012-10-17",
3+
"Statement": [
4+
{
5+
"Effect": "Allow",
6+
"Principal": {
7+
"Federated": "arn:aws:iam::783560535431:oidc-provider/oidc.eks.ap-southeast-1.amazonaws.com/id/B3CC05A4C5B79D318F0942260946D505"
8+
},
9+
"Action": "sts:AssumeRoleWithWebIdentity",
10+
"Condition": {
11+
"StringEquals": {
12+
"oidc.eks.ap-southeast-1.amazonaws.com/id/B3CC05A4C5B79D318F0942260946D505:aud": "sts.amazonaws.com",
13+
"oidc.eks.ap-southeast-1.amazonaws.com/id/B3CC05A4C5B79D318F0942260946D505:sub": "system:serviceaccount:kube-system:aws-load-balancer-controller"
14+
}
15+
}
16+
}
17+
]
18+
}

0 commit comments

Comments
 (0)