Cloudera CDH/CDP 및 Hadoop EcoSystem, Semantic IoT등의 개발/운영 기술을 정리합니다. gooper@gooper.com로 문의 주세요.
1. microservice pattern책의 부록 부분을 참고하여 window에서 리눅스를 사용할 수 있도록(WSL2등) 설치/설정한다.
2. kubernetes로 서비스를 기동할때 몇가지 수정해야할 부분이 있다.
(kubernetes가 버젼이 올라가면서 예제로 만들어진 kubernetes기동용 yaml과 script자체가 잘못되거나 없어진 옵션을 사용하고 있어 몇가지를 수정해야한다.)
가. apps/v1beta1를 apps/v1로 수정
나. extentions/v1beta1를 apps/v1로 수정
다. selector.matchLabels.app에 app이름 추가
라. metadata의 label항목에 app: app이름 추가
3. github소스 받아 build및 docker이미 생성
가. git clone github.com/microservice-patterns/ftgo-application
나. cd ftgo-application
다. ./gradlew buildContracts
라. ./gradlew assemble
4. container 배포
가. cd ~/ftgo-application/deployment/kubernetes/scripts
나. ./kubernetes-deploy-all.sh
gooper@DESKTOP-PJ7F3IU:~/ftgo-application/deployment/kubernetes/scripts$ ./kubernetes-deploy-all.sh
secret/ftgo-db-secret created
service/ftgo-dynamodb-local created
statefulset.apps/ftgo-dynamodb-local created
job.batch/ftgo-dynamodb-local-init created
service/ftgo-kafka created
statefulset.apps/ftgo-kafka created
service/ftgo-mysql created
statefulset.apps/ftgo-mysql created
service/ftgo-zookeeper created
statefulset.apps/ftgo-zookeeper created
....................................................................................................................................connected
service/ftgo-cdc-service created
deployment.apps/ftgo-cdc-service created
5. container삭제
gooper@DESKTOP-PJ7F3IU:~/ftgo-application/deployment/kubernetes/scripts$ ./kubernetes-delete-all.sh
service "ftgo-cdc-service" deleted
deployment.apps "ftgo-cdc-service" deleted
secret "ftgo-db-secret" deleted
service "ftgo-dynamodb-local" deleted
statefulset.apps "ftgo-dynamodb-local" deleted
job.batch "ftgo-dynamodb-local-init" deleted
service "ftgo-kafka" deleted
statefulset.apps "ftgo-kafka" deleted
service "ftgo-mysql" deleted
statefulset.apps "ftgo-mysql" deleted
service "ftgo-zookeeper" deleted
statefulset.apps "ftgo-zookeeper" deleted
6. port forwarding하기 (이거 반드시 실행해줘야 한다)
가. cd ~/ftgo-application/deployment/kubernetes/scripts
나. ./port-forwards.sh
7. swagger ui를 이용한 서비스 테스트
가. consumer controller; http://127.0.0.1:8081/swagger-ui/
나. order controller, restaurant conroller; http://127.0.0.1:8082/swagger-ui/
다. kitchen controller, restaurant conroller; http://127.0.0.1:8083/swagger-ui/
라. basic error controller, operation handler, restaurant conrolle, web-mvc-link-handler ; http://127.0.0.1:8084/swagger-ui/
마. accounts controller; http://127.0.0.1:8085/swagger-ui/
* 수정해야 하는 파일 #1
gooper@DESKTOP-PJ7F3IU:~/ftgo-application/deployment/kubernetes/scripts$ ls -al ~/ftgo-application/*/src/deployment/kubernetes/*.yml
-rw-r--r-- 1 gooper gooper 1820 Jan 30 10:17 /home/gooper/ftgo-application/ftgo-accounting-service/src/deployment/kubernetes/ftgo-accounting-service.yml
-rw-r--r-- 1 gooper gooper 1542 Jan 30 10:17 /home/gooper/ftgo-application/ftgo-api-gateway/src/deployment/kubernetes/ftgo-api-gateway.yml
-rw-r--r-- 1 gooper gooper 1780 Jan 30 10:17 /home/gooper/ftgo-application/ftgo-consumer-service/src/deployment/kubernetes/ftgo-consumer-service.yml
-rw-r--r-- 1 gooper gooper 1802 Jan 30 10:17 /home/gooper/ftgo-application/ftgo-kitchen-service/src/deployment/kubernetes/ftgo-kitchen-service.yml
-rw-r--r-- 1 gooper gooper 2123 Jan 30 10:17 /home/gooper/ftgo-application/ftgo-order-history-service/src/deployment/kubernetes/ftgo-order-history-service.yml
-rw-r--r-- 1 gooper gooper 1931 Jan 30 10:17 /home/gooper/ftgo-application/ftgo-order-service/src/deployment/kubernetes/ftgo-order-service.yml
-rw-r--r-- 1 gooper gooper 1853 Jan 30 10:17 /home/gooper/ftgo-application/ftgo-restaurant-service/src/deployment/kubernetes/ftgo-restaurant-service.yml