Skip to content

Commit aa5d77c

Browse files
committed
Add startup.sh & revise markdowns
1 parent a394f81 commit aa5d77c

File tree

4 files changed

+101
-3
lines changed

4 files changed

+101
-3
lines changed

k8s/command.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Access pod
2+
3+
- 특정 pod bash에 접근
4+
5+
```bash
6+
kubectl exec --stdin --tty <pod name> -- /bin/bash
7+
```
8+
9+
- network util pod 생성 및 shell 로그인
10+
11+
```bash
12+
kubectl run <netutil name> --rm -i --tty --image praqma/network-multitool -- bash
13+
```
14+
15+
# Dashboard
16+
17+
- *관련 reference* : `https://kubernetes.io/ko/docs/tasks/access-application-cluster/web-ui-dashboard/`
18+
19+
- dashboard UI 배포
20+
21+
```bash
22+
kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.4.0/aio/deploy/recommended.yaml
23+
```
24+
25+
- dashboard 접속 활성화
26+
27+
```bash
28+
kubectl proxy
29+
```
30+
31+
- dashboard URL (접근)
32+
33+
```
34+
http://localhost:8001/api/v1/namespaces/kubernetes-dashboard/services/https:kubernetes-dashboard:/proxy/
35+
```
36+
37+
- dashboard UI에 접근에 사용할 token 얻기
38+
39+
```bash
40+
kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | awk '/^deployment-controller-token-/{print $1}') | awk '$1=="token:"{print $2}'
41+
```
42+
43+
# 참고 : TODO
44+
45+
- dashboard에 service, ingress, node 등의 항목이 나타나지 않는데, 이를 해결

k8s/mongo.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,25 @@
5656
> rs.stepDown()
5757
```
5858

59-
## 참고
59+
# 검토 TODO
6060

61-
- 특정 pod bash에 접근 : `kubectl exec --stdin --tty <pod name> -- /bin/bash`
62-
- network util pod 생성 및 shell 로그인 `kubectl run my-shell --rm -i --tty --image praqma/network-multitool -- bash`
61+
### Kind Persistent Volumes
62+
63+
- URL : <https://mauilion.dev/posts/kind-pvc/>
64+
65+
1. **default storage class**: I want there to be a built in storage class so that I can deploy applications that request persistent volume claims.
66+
67+
2. **pod restart**: If my pod restarts I want that pod to be scheduled such that the persistent volume claim is available to my pod. This ensures that if I have to restart and my pod will always come back with access to the same data.
68+
69+
3. **restore volumes**: I want to be able to bring up a kind cluster and regain access to a previously provisioned persistent volume claim.
70+
71+
4. **volume mobility**: I want to be able to schedule my pod to multiple nodes and have it access the same persistent volume claim. This requires that the peristent volume be made available to all nodes.
72+
73+
### 쿠버네티스 볼륨 개념 정리
74+
75+
- URL : <https://blog.eunsukim.me/posts/kubernetes-volume-overview>
76+
77+
1. Persistent Volume
78+
2. Persistent Volume Claim
79+
3. Storage Class
80+
4. 상기 항목의 용도 : 볼륨 관리자와 볼륨 사용자 관점에서 설명

k8s/readme.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
- [ingress 테스트](#ingress-테스트)
1414
- [load balancer 테스트](#load-balancer-테스트)
1515
- [클러스터 삭제하기](#클러스터-삭제하기)
16+
1617
# Description
1718

1819
- **kind**가 무엇인지, 어떻게 사용하는지

k8s/startup.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/sh
2+
3+
Green='\033[0;32m' # Green
4+
NC='\033[0m' # No Color
5+
6+
echo "${Green}[startup] Creating k8s cluster...${NC}"
7+
kind create cluster --config ./kind-config.yaml
8+
9+
echo
10+
echo "${Green}[startup] Deploying NGINX ingress controller...${NC}"
11+
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml
12+
13+
echo
14+
echo "${Green}[startup] Waiting for NGINX setting completion...${NC}"
15+
kubectl wait --namespace ingress-nginx \
16+
--for=condition=ready pod \
17+
--selector=app.kubernetes.io/component=controller \
18+
--timeout=90s
19+
20+
echo
21+
echo "${Green}[startup] Creating metallb load balancer namespace...${NC}"
22+
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.12.1/manifests/namespace.yaml
23+
24+
echo
25+
echo "${Green}[startup] Deploying metallb...${NC}"
26+
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.12.1/manifests/metallb.yaml
27+
28+
echo
29+
echo "${Green}[startup] Waiting for metallb setting completion...${NC}"
30+
#kubectl get pods -n metallb-system --watch
31+
kubectl wait --namespace metallb-system \
32+
--for=condition=ready pod \
33+
--selector=app=metallb,component=speaker \
34+
--timeout=90s

0 commit comments

Comments
 (0)