forked from wardviaene/kubernetes-course
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c72b2e7
commit c82d702
Showing
3 changed files
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Setup EKS | ||
``` | ||
eksctl create cluster --name=cluster-2 --nodes=2 --region=eu-west-1 --managed | ||
``` | ||
|
||
# Setup IAM Roles for Service Accounts | ||
|
||
Enable IAM Roles for Service Accounts on the EKS cluster | ||
|
||
``` | ||
eksctl utils associate-iam-oidc-provider --cluster=cluster-2 | ||
eksctl utils associate-iam-oidc-provider --cluster=cluster-2 --approve | ||
``` | ||
|
||
Create new IAM Role using eksctl | ||
``` | ||
eksctl create iamserviceaccount --cluster=cluster-2 --name=myserviceaccount --namespace=default --attach-policy-arn=arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess | ||
eksctl create iamserviceaccount --cluster=cluster-2 --name=myserviceaccount --namespace=default --attach-policy-arn=arn:aws:iam::aws:policy/AmazonS3ReadOnlyAccess --approve | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: amazonlinux | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: amazonlinux | ||
template: | ||
metadata: | ||
labels: | ||
app: amazonlinux | ||
spec: | ||
serviceAccount: myserviceaccount | ||
securityContext: | ||
fsGroup: 1000 | ||
runAsUser: 1000 | ||
containers: | ||
- name: amazonlinux | ||
image: amazonlinux:2 | ||
command: ["sleep", "infinity"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
name: amazonlinux | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: amazonlinux | ||
template: | ||
metadata: | ||
labels: | ||
app: amazonlinux | ||
spec: | ||
serviceAccount: myserviceaccount | ||
containers: | ||
- name: amazonlinux | ||
image: amazonlinux:2 | ||
command: ["sleep", "infinity"] |