You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

언제 사용할까?

개발PC에서 MicroService를 검증 할 때

개발PC에서 AKS-POD 연결

Port-Forward를 이용한 개발PC에서 AKS-POD 연결 Command

sansae@win10pro-worksp:~$ az login
sansae@win10pro-worksp:~$ az aks get-credentials --resource-group ${RESOURCE_GROUP_NAME} --name ${AKS_CLUSTER_NAME}
sansae@win10pro-worksp:~$ kubectl get pod
NAME                    READY   STATUS    RESTARTS   AGE
todo-796c54bf46-snsvn   1/1     Running   0          26h
sansae@win10pro-worksp:~$ kubectl get pod todo-796c54bf46-snsvn -o yaml | grep containerPort
              k:{"containerPort":8080,"protocol":"TCP"}:
                f:containerPort: {}
    - containerPort: 8080
sansae@win10pro-worksp:~$ kubectl port-forward todo-796c54bf46-snsvn 8888:8080
Forwarding from 127.0.0.1:8888 -> 8080
Forwarding from [::1]:8888 -> 8080
Handling connection for 8888
Handling connection for 8888

개발PC의 Browser에서 http://localhost:8888 로 호출

예) 개발PC의 마이크로서비스에서 AKS-POD 호출URL설정

application.properties


개발PC에서 AKS-DEPLOYMENT연결

Port-Forward를 이용한 개발PC에서 AKS-DEPLOYMENT 연결 Command

sansae@win10pro-worksp:~$ kubectl get deploy
NAME   READY   UP-TO-DATE   AVAILABLE   AGE
todo   1/1     1            1           28h
sansae@win10pro-worksp:~$ kubectl get deploy todo -o yaml | grep containerPort
                  k:{"containerPort":8080,"protocol":"TCP"}:
                    f:containerPort: {}
        - containerPort: 8080
sansae@win10pro-worksp:~$ kubectl port-forward deployment/todo 9000:8080
Forwarding from 127.0.0.1:9000 -> 8080
Forwarding from [::1]:9000 -> 8080

개발PC의 Browser에서 http://localhost:9000 로 호출

예) 개발PC의 마이크로서비스에서 AKS-DEPLOYMENT 호출URL설정

application.properties

  • No labels