포탈 접속 Port 변경 방법

작성자 이경미 수정일 2024-02-05 17:23

들어가며

  • 고객사의 상황에 따라 default port 인 80 에서 변경이 필요할 수 있습니다. 
  • 이 때, port 를 추가하는 방법에 대해 알 수 있습니다.



내용

port 를 변경하기 위해서 다음 pod 들의 재설정이 필요합니다. 

  • nginx, app



설치파일이 존재하는 대표 master node 에서 진행합니다.


NGINX 

nginx 의 service port 를 수정한다면 포탈에 수정된 포트로 접속이 가능합니다. 

cd <SETUP ROOT>/setup/01_nginx-ingress/yamls
vi install_nginx_ingress.yaml
# Source: nginx-ingress/templates/controller-service.yaml
apiVersion: v1
kind: Service
metadata:
  labels:
    app: nginx-ingress
    chart: nginx-ingress-1.41.3
    component: "controller"
    heritage: Tiller
    release: sodaflow
  name: sodaflow-nginx-ingress-controller
spec:
  externalIPs:
    - 192.168.50.198
  ports:
    - name: http
      port: 80
      protocol: TCP
      targetPort: http
    - name: https
      port: 8443
      protocol: TCP
      targetPort: https
  selector:
    app: nginx-ingress
    release: sodaflow
    app.kubernetes.io/component: controller
  type: "NodePort"
kubectl delete -f install_nginx_ingress.yaml 

# nginx pod 가 삭제된 것을 확인한 뒤 실행합니다. 
kubectl apply -f install_nginx_ingress.yaml 

kubectl get svc
NAME                                       TYPE        CLUSTER-IP    EXTERNAL-IP      PORT(S)                       AGE
sodaflow-nginx-ingress-controller          NodePort    6.5.205.77    192.168.50.198   80:31066/TCP,8443:30859/TCP   8s


APP

notebook 을 생성하여 IDE 를 클릭하면 새로운 창에 notebook 이 생성됩니다. 

이 때, notebook 에도 port 가 필요하기 때문에 app 의 상세사항을 수정해야합니다. 

cd <SETUP ROOT>/sodaflow_app/yamls
vi sodaflow-app-config_ini.yaml
    NOTEBOOK_HTTP = https
    NOTEBOOK_PORT = 8443

    REST_SERVER_HTTP = https
    REST_SERVER_PORT = 8443

수정이 끝나면 적용을 위해 pod 를 재생성해야합니다. 

kubectl delete -f sodaflow-app-config_ini.yaml
kubectl delete -f sodaflow-app-ingress.yaml
kubectl delete -f sodaflow-app.yaml
kubectl delete -f sodaflow-ui-ingress.yaml

# pod, service, ingress 가 삭제된 것을 확인한 뒤 진행합니다. 
kubectl apply -f sodaflow-app-config_ini.yaml
kubectl apply -f sodaflow-app-ingress.yaml
kubectl apply -f sodaflow-ui-ingress.yaml
kubectl apply -f sodaflow-app.yaml


아티클이 유용했나요?

훌륭합니다!

피드백을 제공해 주셔서 감사합니다.

도움이 되지 못해 죄송합니다!

피드백을 제공해 주셔서 감사합니다.

아티클을 개선할 수 있는 방법을 알려주세요!

최소 하나의 이유를 선택하세요
CAPTCHA 확인이 필요합니다.

피드백 전송

소중한 의견을 수렴하여 아티클을 개선하도록 노력하겠습니다.

02-558-8300