-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathcloud세팅.txt
67 lines (47 loc) · 2.24 KB
/
cloud세팅.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
[Final Assessment - Cloud 세팅]
------------------------------------------------------------------------
1. 리소스그룹 만들기 skcc01-rsrcgrp
2. ACR 만들기 skcc01
3. AKS 만들기 skcc01-aks
* azure shell에서 아래 내역 수행
4. azure shell 에서 클러스터 연결 (aks)
az aks get-credentials --resource-group skcc01-rsrcgrp --name skcc01-aks
5. 연결 확인
kubectl get all
6. AKS와 ACR 연결
az aks update -n skcc01-aks -g skcc01-rsrcgrp --attach-acr skcc01
7. git clone (최초 소스 check out 개념)
git clone https://github.com/keviny2107/library.git
7-1. 카프카 설치
-- 버전 확인 (3.xx 인경우)
helm version
kubectl --namespace kube-system create sa tiller # helm 의 설치관리자를 위한 시스템 사용자 생성
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
helm repo add incubator https://charts.helm.sh/incubator
helm repo update
kubectl create ns kafka
helm install my-kafka --namespace kafka incubator/kafka
8. 서비스별 mvn package 진행
mvn package
9. 이미지 생성 (ACR 리파지토리 확인)
az acr build --registry skcc01 --image skcc01.azurecr.io/book:latest .
az acr build --registry skcc01 --image skcc01.azurecr.io/gateway:latest .
az acr build --registry skcc01 --image skcc01.azurecr.io/payment:latest .
az acr build --registry skcc01 --image skcc01.azurecr.io/mypage:latest .
az acr build --registry skcc01 --image skcc01.azurecr.io/rental:latest .
10. yml파일 이용하여 클러스터 배포
- yaml파일 기반으로 작업해야 함
- 컨테이너 이미지 경로를 ACR정보로 수정
image: skcc01.azurecr.io/book:latest
kubectl apply -f deployment.yml
kubectl apply -f service.yaml
kubectl delete service,deploy rental
11. gateway yaml 세팅
- service.yaml >> type: LoadBalancer
- gateway readinessProbe 적용하지 않음.
12. httpie 설치
pip install --upgrade httpie
13. http 명령어로 api gateway IP:port로 서비스 호출해보기
14. view 확인 http {externalIP로 수정}:8080/mypages
* observer
kubectl -n kafka exec -ti my-kafka-0 -- /usr/bin/kafka-console-consumer --bootstrap-server my-kafka:9092 --topic library --from-beginning