Kubernetes ETL With EFK (포트 포워딩 및 배포)#2
1. git clone https://github.com/parksubo/ekf-with-flask
2. 현재 minikube에 elastic namespace가 없어서 아래 명령어를 실행할 수 없음,
kubectl create namespace elastic로 namespace 생성 후
// resource create
kubectl apply -f ./elasticsearch.yaml
kubectl apply -f ./kibana.yaml
kubectl apply -f ./fluentd.yaml
로 배포한다.
3. kubectl get svc -n elastic 로 elastic 레이블이 부착된 모든 서비스가 잘 돌아가는지 확인한다.
4. 포트포워딩
kubectl port-forward svc/flask-example -n real 8088:8088 --address=0.0.0.0 &
kubectl port-forward svc/kibana-svc -n elastic 5601:5601 --address=0.0.0.0 &
kubectl port-forward svc/elasticsearch-svc -n elastic 9200:9200 --address=0.0.0.0 &
5. localhost:5601에서 flask에서 발생시킨 로그 확인 가능
- 위와 같이 설정후 검색창에 flask-example을 입력하면 curl 127.0.0.1:8088/?message=hello로 테스트 했던 로그들을
볼 수 있음
ref) https://blog.naver.com/PostView.naver?blogId=isc0304&logNo=221860255105&categoryNo=0&parentCategoryNo=0&viewDate=¤tPage=4&postListTopCurrentPage=1&from=postView&userTopListOpen=true&userTopListCount=30&userTopListManageOpen=false&userTopListCurrentPage=4