Skip to content

yongjulejule/kube-voyage

Repository files navigation

VideoPlatform

flowchart LR
    subgraph Kubernetes_Cluster [Kubernetes Cluster]
        subgraph Video_Service_Namespace [Video Service Namespace]
            Video_Streaming_Pod[Video Streaming Pod]
            Video_Storage_Pod[Video Storage Pod]
            RabbitMQ_Pod[(RabbitMQ Pod)]
            History_Pod[History Pod]

            Video_Streaming_Pod -->|Microservice Message Flow| Video_Storage_Pod
            Video_Streaming_Pod -->|Microservice Message Flow| RabbitMQ_Pod
            RabbitMQ_Pod --> History_Pod
        end
    end

    Client[Client] -->|Requests| Video_Streaming_Pod
Loading

k8s

Cluster 배포

K8s 인프라

MongoDB

  • pv 생성 (helm/mongo/pv.yaml)
  • pvc 생성 (helm/mongo/pvc.yaml)
  • helm install mongo bitnami/mongodb -f helm/mongo/values.yaml
kubectl apply -f helm/mongo/pv.yaml
kubectl apply -f helm/mongo/pvc.yaml
helm install mongo bitnami/mongodb -f helm/mongo/values.yaml

troubleshooting

  • pv / pvc 만들어줘야함
  • bitnami/mongodb docker image 가 arm64 지원 안함 -> mongo 이미지로 변경
  • 만들어진 pv / pvc 가 노드의 /mnt/data 에 바인드 되는데, 이때 권한때문에 막힘
    • 노드에 직접 접속해서 권한 바꿔주면 됨 (sudo chown -R 1001:1001 /mnt/data/mongo)
  • 자꾸 유저 생성 안돼서 집적 mongosh 로 접속해서 유저 생성함... 원인 찾아야함

apps/

  • helm create apps 로 helm chart 생성
  • values.yaml 에 기본 values 설정
  • video-streaming.yaml, history.yaml 에 서비스 별 필요한 값 설정
  • template/deployment.yaml 에서 env 설정
  • helm upgrade --install ./helm/apps -f ./helm/apps/.yaml

RabbitMQ

  • kubectl apply -f helm/rabbitmq/
  • helm install rabbitmq bitnami/rabbitmq -f helm/rabbitmq/values.yaml

MINIO

  • helm repo add minio https://charts.min.io/
  • helm repo update
  • values.yaml 에서 accessKey, secretKey 설정
  • storageClass 만들기 (뭔지 잘 모르겠음)
  • pv, pvc 생성
    • 디렉토리 권한 체크하기
    • storageClassName 체크
  • helm install video-storage minio/minio -f ./values.yaml

Helm

  • helm install 로 워크로드 배포 가능
  • helm list 로 배포된 워크로드 확인 가능
  • helm status 로 워크로드 상세 확인 가능