# Amazon EKS Workshop HackMD: https://reurl.cc/kl2bG3 匿名問問題:https://app.sli.do/event/jz4ZT5Xdg6CuYNTkpkwiG8 Workshop environment: https://catalog.workshops.aws/ Event hash: 75b7-04607a-9c Lab guide: https://www.eksworkshop.com/ Survey:https://survey.immersionday.com/ebiAEGE4R ![](https://i.imgur.com/B5ULZoO.jpg) 實做Lab章節: Introduction Automation - GitOps ## Introduction Setup At an AWS event Accessing the IDE Getting started - Deploying out first component/Other components Kustomize ![](https://i.imgur.com/VJn7oNh.png) ![](https://i.imgur.com/CXj4snp.png) ## Automation ### ArgoCD -> Initial setup 進入這章之前,先完成以下兩件事: 1. Create CodeCommit Repo from Cloud9 ```sh! aws codecommit create-repository --repository-name eks-workshop-argocd --repository-description "CodeCommit repository for ArgoCD" ``` 2. 新增 IAM user `eks-workshop-gitops` 的policy `policy.json`,允許 GitPush,GitPull 到名為`eks-workshop-*` 的Repo ```sh! cat << EOF > policy.json { "Version": "2012-10-17", "Statement": [ { "Sid": "AllowGitPushAndPull", "Effect": "Allow", "Action": [ "codecommit:GitPush", "codecommit:GitPull" ], "Resource": "arn:aws:codecommit:$AWS_DEFAULT_REGION:$AWS_ACCOUNT_ID:eks-workshop-*" } ] } EOF ``` ```sh! aws iam create-policy --policy-name GitPushPullPolicy --policy-document file://policy.json ``` ```sh! aws iam attach-user-policy --user-name eks-workshop-gitops --policy-arn arn:aws:iam::$AWS_ACCOUNT_ID:policy/GitPushPullPolicy ``` ### ArgoCD -> Deploying an application Copy files的部分都有錯誤,請直接手動create檔案內容到~/environment/argocd/apps/kustomization.yaml ```yaml! apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization resources: - ui ``` ### ArgoCD -> Updating an application Copy files的部分都有錯誤,請直接手動create檔案內容到~/environment/argocd/apps/deployment-patch.yaml ```yaml! apiVersion: apps/v1 kind: Deployment metadata: name: ui spec: replicas: 3 ``` ~/environment/argocd/apps/kustomization.yaml ```yaml! apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization bases: - ui patches: - deployment-patch.yaml ``` Commit and push to AWS CodeCommit.