---
# System prepended metadata

title: CI/CD for EKS Cluster

---

# CI/CD for EKS Cluster

HackMD Url: https://reurl.cc/Wqnayy
Event URL: https://dashboard.eventengine.run/login
Event Hash: afa4-191ea0e9a4-ad
Workshop: https://catalog.us-east-1.prod.workshops.aws/workshops/9c0aa9ab-90a9-44a6-abe1-8dff360ae428/en-US

簽到
![](https://i.imgur.com/Of9K27B.png)

## Step (1.3) Configure git remote repository locally
Workshop用https以帳號密碼登入Github的方式已不再支援。
```bash!
> git remote add origin https://github.com/$GITHUB_USERNAME/front-app-repo.git
```

```bash!
remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/chubbychia/front-app-repo.git/'
```

改用ssh keypair login，設定：
1. 在cloud9 gen keypair
```bash!
> ssh-keygen -t ecdsa -f ~/.ssh/id_ecdsa 
> chmod 400 ~/.ssh/id_ecdsa 
```
2. 修改ssh config
```bash!
> vi ~/.ssh/config 
====
Host github.com (http://github.com/) 
    IdentityFile ~/.ssh/id_ecdsa 
    IdentitiesOnly yes
===
> chmod 400 ~/.ssh/config 
```
若不熟悉vi，從Cloud9打開隱藏檔和顯示Home目錄，從文字編輯器中修改 (/home/ec2-user/.ssh/config)
![](https://i.imgur.com/oC7Op9B.png)

3. Github -> Profile -> Setttings -> SSH and GPG keys -> New SSH Key
複製public key到SSH Key中，取名MyPubKey
```bash!
> cat ~/.ssh/id_ecdsa.pub
===
ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBKJi0LfRi50D8qRB19GJWUJkE6QZJGFatmpiFoPd7g5J/dIC1RSs0vGfvGwWFFIotzk76WLlxBoOJ4PdNvgzHnw= ec2-user@ip-172-31-30-207.ap-northeast-1.compute.internal
```
4. 把workshop連github的指令從https改為ssh
```bash!
> git remote add origin ${YOU_GIT_SSH_URL}
> git push -v origin main
```
5. 將改完的程式碼段落貼上Cloud9執行

## Step (9.1) Setup Github Repository URL to ArgoCD
先到Settings編輯git相關資訊
![](https://i.imgur.com/naiXUkJ.png)
把Username和Github personal token更新至連線設定
![](https://i.imgur.com/BlBR7BF.png)
再按照Workshop步驟建立application，設定k8s manifest 的Github URL（使用https URL)
![](https://i.imgur.com/19u0Jtq.png)


## Step (11) 取得frontend LoadBalancer的endpoint
Workshop有誤，把ingress/backend-ingress改為ingress/frontend-ingress
```bash!
echo http://$(kubectl get ingress/frontend-ingress -o jsonpath='{.status.loadBalancer.ingress[*].hostname}')
```

Please help us fill the survey: 

![](https://i.imgur.com/oFiAnQO.png)

