본문 바로가기
따배쿠

[따배쿠] 8-1, 2 Kubernetes Ingress 개념과 Ingress Controller 설치 및 실습 - 웹페이지 구현

by Engineer-Lee 2022. 11. 15.
반응형

앞단에서 서비스를 ingerss rules 를 통해 포워딩 해주는 역할을 해준다. 여러가지 오픈소스들이 존재한다.

 

 

설치

https://kubernetes.github.io/ingress-nginx/deploy/#aws

 

Installation Guide - NGINX Ingress Controller

Installation Guide There are multiple ways to install the NGINX ingress controller: with Helm, using the project repository chart; with kubectl apply, using YAML manifests; with specific addons (e.g. for minikube or MicroK8s). On most Kubernetes clusters,

kubernetes.github.io

 

 

 

 

실습

 

 

nginx controller 의 deploy.yaml 에 nodePort svc 를 추가한다.

 

그리고 kubectl create -f deploy.yaml로 컨트롤러를 실행한다.

controller도 Running중으로 잘 생성됐다.

위에서 추가한 http , https 에 해당하는 node port 들이 30100, 30200 에 잘 생성된 걸 볼 수 있다.

 

 

이미 만들어진 html , appjs 를 그냥 container 안에 Copy 한다.

 

context 가 새로 추가 되었고 ingress-admin@kuberntes 로 switch 하게 되면 default namespace 가 ingress-nginx가 된다.

 

marvel-home.yaml에는 deployment와 svc가 들어있다.

pay.yaml에는 controller와 svc가  들어있다.

replicationController로 3개의 pay pod가 있고 그것을 묶은 pay-service가 있는것을 확인한다.

marvel-home replicaset(deployment의 자식)으로 있고 marvel-service도 있는 것을 확인한다.

 

create ingress.yaml을 실행후 marvel-ingress가 잘 동작하고 있다.

하지만 아직 cluster안의 node들끼리 통신이 가능한 것이다.

외부에서도 접속 가능하려면 포워딩을 해야한다.

반응형