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

Compare with Current View Page History

« Previous Version 13 Next »


목차

 

Ingress 개요

https://medium.com/devops-mojo/kubernetes-ingress-overview-what-is-kubernetes-ingress-introduction-to-k8s-ingress-b0f81525ffe2

  • 하나의 IP나 도메인으로 다수의 서비스 제공 (단일 Endpoint)
  • L7을 기본으로한 부하 분산이므로 많은 기능을 제공
  • Domain base Routing
  • Uri base Routing
  • 부하분산
  • SSL 종료
  • Ingress Controller필수
  • Service의 LoadBalancer Type과 같이 Load Balancer가 요구 됩니다.
  • 다양한 Ingress Controller가 있으며, 무료의 경우 기능사용에 제약이 많으므로 유료를 권장합니다.
  • Cloud환경에서는 ApplicationGateway또는 ApplicationLoadBalancer와 연동해서 사용가능합니다. (예: AZURE-AGIC, AWS ALB-INGRESS)

Ingress Controller



Ingress Manifest

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: minimal-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  ingressClassName: nginx-example
  rules:
  - http:
      paths:
      - path: /testpath
        pathType: Prefix
        backend:
          service:
            name: test
            port:
              number: 80


Ingress 실습

Ingress Controller 배포

sansae@sansaeAir15m2 k8s-lab-workspace % kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.10.0/deploy/static/provider/cloud/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

sansae@sansaeAir15m2 k8s-lab-workspace % k get all -n ingress-nginx 
NAME                                            READY   STATUS      RESTARTS   AGE
pod/ingress-nginx-admission-create-pknd2        0/1     Completed   0          110s
pod/ingress-nginx-admission-patch-6x9cm         0/1     Completed   2          110s
pod/ingress-nginx-controller-654497b5fc-mmgfl   1/1     Running     0          110s

NAME                                         TYPE           CLUSTER-IP    EXTERNAL-IP    PORT(S)                      AGE
service/ingress-nginx-controller             LoadBalancer   10.0.40.254   4.230.148.14   80:32251/TCP,443:31606/TCP   111s
service/ingress-nginx-controller-admission   ClusterIP      10.0.167.0    <none>         443/TCP                      111s

NAME                                       READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/ingress-nginx-controller   1/1     1            1           110s

NAME                                                  DESIRED   CURRENT   READY   AGE
replicaset.apps/ingress-nginx-controller-654497b5fc   1         1         1       110s

NAME                                       COMPLETIONS   DURATION   AGE
job.batch/ingress-nginx-admission-create   1/1           6s         111s
job.batch/ingress-nginx-admission-patch    1/1           19s        111s



  • No labels