"쿠버네티스 Ingress"의 두 판 사이의 차이

 
(사용자 2명의 중간 판 24개는 보이지 않습니다)
1번째 줄: 1번째 줄:
{{다른뜻|인그레스}}
==개요==
==개요==
;쿠버네티스 Ingress
;[[Kubernetes]] [[Ingress]]
;Kubernetes 인그레스
;[[쿠버네티스]] [[인그레스]], 인입, 수신
* 클러스터 내의 서비스들에 대한 외부 접근(특히 HTTP)을 관리하는 API 객체
* 클러스터 내의 서비스들에 대한 외부 접근(특히 HTTP)을 관리하는 API 객체
* 로드 밸런싱, SSL 터미네이션, 이름-기반 버추얼 호스팅을 제공 가능
* 로드 밸런싱, SSL 터미네이션, 이름-기반 버추얼 호스팅을 제공 가능
==기본==
===Prefix===
<syntaxhighlight lang='yaml'>
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: myingress
spec:
  rules:
  - host: example.com # Host
    http:
      paths:
      - pathType: Prefix
        path: /
        backend:
          service:
            name: myservice # Service
            port:
              number: 80 # Port
</syntaxhighlight>
===ImplementationSpecific===
<syntaxhighlight lang='yaml'>
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: myingress
spec:
  rules:
  - host: example.com # Host
    http:
      paths:
      - pathType: ImplementationSpecific
        backend:
          service:
            name: myservice # Service
            port:
              number: 80 # Port
</syntaxhighlight>
==기타 예시==
===tls===
<syntaxhighlight lang='yaml'>
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: tls-example-ingress
spec:
  tls:
  - hosts:
      - https-example.foo.com
    secretName: testsecret-tls
  rules:
  - host: https-example.foo.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: service1
            port:
              number: 80
</syntaxhighlight>
===defaultBackend===
<syntaxhighlight lang='yaml'>
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-resource-backend
spec:
  defaultBackend:
    resource:
      apiGroup: k8s.example.com
      kind: StorageBucket
      name: static-assets
  rules:
    - http:
        paths:
          - path: /icons
            pathType: ImplementationSpecific
            backend:
              resource:
                apiGroup: k8s.example.com
                kind: StorageBucket
                name: icon-assets
</syntaxhighlight>
===Prefix===
<syntaxhighlight lang='yaml'>
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: minimal-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - http:
      paths:
      - path: /testpath
        pathType: Prefix
        backend:
          service:
            name: test
            port:
              number: 80
</syntaxhighlight>
<syntaxhighlight lang='yaml'>
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-wildcard-host
spec:
  rules:
  - host: "foo.bar.com"
    http:
      paths:
      - pathType: Prefix
        path: "/bar"
        backend:
          service:
            name: service1
            port:
              number: 80
  - host: "*.foo.com"
    http:
      paths:
      - pathType: Prefix
        path: "/foo"
        backend:
          service:
            name: service2
            port:
              number: 80
</syntaxhighlight>
==구식(v1beta1)==
<syntaxhighlight lang='yaml'>
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: traffic-router
spec:
  rules:
    - http:
        paths:
          - path: /
            backend:
              serviceName: servicename
              servicePort: 8080
</syntaxhighlight>
<syntaxhighlight lang='yaml'>
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: test-ingress
spec:
  rules:
  - host: foo.bar.com
    http:
      paths:
      - path: /
        backend:
          serviceName: test
          servicePort: 80
</syntaxhighlight>
<syntaxhighlight lang='yaml'>
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: test-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - http:
      paths:
      - path: /testpath
        backend:
          serviceName: test
          servicePort: 80
</syntaxhighlight>


==같이 보기==
==같이 보기==
* [[쿠버네티스 용어]]
{{z컬럼3|
* [[쿠버네티스 네트워크]]
* [[인그레스]]
* [[쿠버네티스 Ingress Controller]]
* [[k8s 용어]]
* [[쿠버네티스 Ingress HTTP 50X 오류 코드]]
* [[k8s 네트워크]]
* [[k8s Service]]
* [[k8s Ingress Controller]]
* [[k8s ingressClassName]]
* [[k8s Ingress HTTP 50X 오류 코드]]
* [[no matches for kind "Ingress" in version "extensions/v1beta1"]]
}}


==참고==
==참고==

2023년 12월 28일 (목) 11:18 기준 최신판

1 개요[ | ]

Kubernetes Ingress
쿠버네티스 인그레스, 인입, 수신
  • 클러스터 내의 서비스들에 대한 외부 접근(특히 HTTP)을 관리하는 API 객체
  • 로드 밸런싱, SSL 터미네이션, 이름-기반 버추얼 호스팅을 제공 가능

2 기본[ | ]

2.1 Prefix[ | ]

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: myingress
spec:
  rules:
  - host: example.com # Host
    http:
      paths:
      - pathType: Prefix
        path: /
        backend:
          service:
            name: myservice # Service
            port: 
              number: 80 # Port

2.2 ImplementationSpecific[ | ]

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: myingress
spec:
  rules:
  - host: example.com # Host
    http:
      paths:
      - pathType: ImplementationSpecific
        backend:
          service:
            name: myservice # Service
            port:
              number: 80 # Port

3 기타 예시[ | ]

3.1 tls[ | ]

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: tls-example-ingress
spec:
  tls:
  - hosts:
      - https-example.foo.com
    secretName: testsecret-tls
  rules:
  - host: https-example.foo.com
    http:
      paths:
      - path: /
        pathType: Prefix
        backend:
          service:
            name: service1
            port:
              number: 80

3.2 defaultBackend[ | ]

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-resource-backend
spec:
  defaultBackend:
    resource:
      apiGroup: k8s.example.com
      kind: StorageBucket
      name: static-assets
  rules:
    - http:
        paths:
          - path: /icons
            pathType: ImplementationSpecific
            backend:
              resource:
                apiGroup: k8s.example.com
                kind: StorageBucket
                name: icon-assets

3.3 Prefix[ | ]

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: minimal-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - http:
      paths:
      - path: /testpath
        pathType: Prefix
        backend:
          service:
            name: test
            port:
              number: 80
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-wildcard-host
spec:
  rules:
  - host: "foo.bar.com"
    http:
      paths:
      - pathType: Prefix
        path: "/bar"
        backend:
          service:
            name: service1
            port:
              number: 80
  - host: "*.foo.com"
    http:
      paths:
      - pathType: Prefix
        path: "/foo"
        backend:
          service:
            name: service2
            port:
              number: 80

4 구식(v1beta1)[ | ]

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: traffic-router
spec:
  rules:
    - http:
        paths:
          - path: /
            backend:
              serviceName: servicename
              servicePort: 8080
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: test-ingress
spec:
  rules:
  - host: foo.bar.com
    http:
      paths:
      - path: /
        backend:
          serviceName: test
          servicePort: 80
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: test-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
  - http:
      paths:
      - path: /testpath
        backend:
          serviceName: test
          servicePort: 80

5 같이 보기[ | ]

6 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}