25๋ ๋ AWS EKS Hands-on Study ์คํฐ๋ ์ ๋ฆฌ ๋ด์ฉ์ ๋๋ค.
kwatch
kwatch ๋ ์ฟ ๋ฒ๋คํฐ์ค ํด๋ฌ์คํฐ์์ ๋ฐ์ํ๋ ์ด๋ฒคํธ๋ฅผ ๋ชจ๋ํฐ๋งํ๊ณ , ํ๋, PVC, Node, Deployment ๋ฑ์ ๋ฆฌ์์ค ๋ณ๊ฒฝ ์ฌํญ์ ๊ฐ์งํ๊ณ , ์ด๋ฅผ Slack, Webhook, Discord ๋ฑ์ ์๋ฆผ ์ฑ๋๋ก ์ ๋ฌํ ์ ์๋ค.
์ค์ต์ ์ฌ๋ ์นํ ์ผ๋ก ์งํํ์๋ค.
๊ฐ์ธ ์ํฌ์คํ์ด์ค์ ๋ฐฐํฌ
# configmap ์์ฑ
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Namespace
metadata:
name: kwatch
---
apiVersion: v1
kind: ConfigMap
metadata:
name: kwatch
namespace: kwatch
data:
config.yaml: |
alert:
slack:
webhook: '์นํ
API'
title: $NICK-eks
pvcMonitor:
enabled: true
interval: 5
threshold: 70
EOF
kubectl apply -f https://raw.githubusercontent.com/abahmed/kwatch/v0.8.5/deploy/deploy.yaml
๊ฐ์ธ ์ํฌ์คํ์ด์ค์ ์นํ ์ ์ถ๊ฐํ์ฌ kwatch๋ฅผ ๋ฐฐํฌํ๋ค.
์ฒ์์ ํ๋๋ฅผ ๋ฐฐํฌํ๋๋ฐ ์๋ฟ์ด ์์์ ๋ณด๋ ์ฑ ์ถ๊ฐ๋ฅผ ๋น ๋จ๋ ธ์๋ค ์์ฐจ์ฐจ!
์ฑ ์ถ๊ฐ๋ฅผ ํด์ฃผ๊ณ ๋์ ํ๋ ๋ฐฐํฌ๋ฅผ ๋ค์ ํ๊ณ ์ฑ๊ณต์ ์ผ๋ก ์๋ฟ์ด ์์ ๋๋ ๊ฒ์ ํ์ธํ ์ ์๋ค.
์๋ชป๋ ์ด๋ฏธ์ง ๋ฒ์ ๋ฐฐํฌ
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: Pod
metadata:
name: nginx-19
spec:
containers:
- name: nginx-pod
image: nginx:1.19.19 # ์กด์ฌํ์ง ์๋ ์ด๋ฏธ์ง
EOF
kubectl get events -w
LAST SEEN TYPE REASON OBJECT MESSAGE
28m Normal Scheduled pod/nginx-19 Successfully assigned default/nginx-19 to ip-192-168-3-32.ap-northeast-2.compute.internal
28m Normal Pulling pod/nginx-19 Pulling image "nginx:1.19.19"
28m Warning Failed pod/nginx-19 Failed to pull image "nginx:1.19.19": rpc error: code = NotFound desc = failed to pull and unpack image "docker.io/library/nginx:1.19.19": failed to resolve reference "docker.io/library/nginx:1.19.19": docker.io/library/nginx:1.19.19: not found
28m Warning Failed pod/nginx-19 Error: ErrImagePull
28m Normal BackOff pod/nginx-19 Back-off pulling image "nginx:1.19.19"
28m Warning Failed pod/nginx-19 Error: ImagePullBackOff
์๋ชป๋ ์ด๋ฏธ์ง ๋ฒ์ ์ผ๋ก ๋ฐฐํฌํ์ ๋ ์๋ฟ์ด ๋ฐ์ํ๊ฒ ๋๋ค.