본문 바로가기

Kubernetes

[Kubernetes] Ingress 개념과 Ingress Controller 설치

반응형

Kubernetes Ingress 란?

 - HTTP나 HTTPS를 통해 클러스터 내부의 서비스를 외부로 노출

 - 기능

   1. Service에 외부 URL을 제공

   2. 트래픽을 로드밸런싱

   3. SSL 인증서 처리

   4. Virtual hosting을 지정

 

Kubernetes Ingress 동작방식

https://kubernetes.io/docs/concepts/services-networking/ingress/
https://www.youtube.com/watch?v=y5-u4jtflic&list=PLApuRlvrZKohaBHvXAOhUD-RxD0uQ3z0c&index=28

 

Ingress Controller 설치

 

아래 링크에 접근

https://github.com/kubernetes/ingress-nginx/blob/main/README.md#readme

 

GitHub - kubernetes/ingress-nginx: Ingress-NGINX Controller for Kubernetes

Ingress-NGINX Controller for Kubernetes. Contribute to kubernetes/ingress-nginx development by creating an account on GitHub.

github.com

 

Getting Started 클릭시 아래 링크 접근

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

 

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

Contents의 설치하는 환경에 맞춰서 진행 

VM 환경으로 진행하기 때문에 Bare-metal 클릭

 

ingress-nginx controller 링크를 wget 으로 가지고 온다.

wget https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.5.1/deploy/static/provider/baremetal/deploy.yaml

 

deploy.yaml 실행

# kubectl create -f deploy.yaml
namespace/ingress-nginx created
serviceaccount/ingress-nginx created
serviceaccount/ingress-nginx-admission created
role.rbac.authorization.k8s.io/ingress-nginx created
role.rbac.authorization.k8s.io/ingress-nginx-admission created
clusterrole.rbac.authorization.k8s.io/ingress-nginx created
clusterrole.rbac.authorization.k8s.io/ingress-nginx-admission created
rolebinding.rbac.authorization.k8s.io/ingress-nginx created
rolebinding.rbac.authorization.k8s.io/ingress-nginx-admission created
clusterrolebinding.rbac.authorization.k8s.io/ingress-nginx created
clusterrolebinding.rbac.authorization.k8s.io/ingress-nginx-admission created
configmap/ingress-nginx-controller created
service/ingress-nginx-controller created
service/ingress-nginx-controller-admission created
deployment.apps/ingress-nginx-controller created
job.batch/ingress-nginx-admission-create created
job.batch/ingress-nginx-admission-patch created
ingressclass.networking.k8s.io/nginx created
validatingwebhookconfiguration.admissionregistration.k8s.io/ingress-nginx-admission created

 

ingress-nginx 네임스페이스에서 구성중인 pod 확인

# kubectl get pod -n ingress-nginx 
NAME                                        READY   STATUS      RESTARTS   AGE
ingress-nginx-admission-create-5xt5z        0/1     Completed   0          2m20s
ingress-nginx-admission-patch-r4brt         0/1     Completed   0          2m20s
ingress-nginx-controller-6c56945c75-2mjrc   1/1     Running     0          2m20s

# kubectl get svc -n ingress-nginx 
NAME                                 TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)                      AGE
ingress-nginx-controller             NodePort    10.110.242.135   <none>        80:30989/TCP,443:30537/TCP   2m24s
ingress-nginx-controller-admission   ClusterIP   10.101.74.222    <none>        443/TCP                      2m24s

 

 

[참고]

- https://www.youtube.com/watch?v=y5-u4jtflic&list=PLApuRlvrZKohaBHvXAOhUD-RxD0uQ3z0c&index=28

반응형