첫 번째 Ingress 배포

첫 번째 Ingress 배포 (Deploy the First Ingress)

Cilium Service Mesh로 첫 Ingress를 배포하는 예제예요. /details 경로는 details 서비스로, / 경로는 productpage 서비스로 라우팅하는 기본 Ingress를 보여줘요.

출처: Deploy the First Ingress

본문

예제 Ingress 정의는 basic-ingress.yaml에서 찾을 수 있어요.

# Basic ingress for istio bookinfo demo application, which can be found in below
# https://raw.githubusercontent.com/istio/istio/release-1.11/samples/bookinfo/platform/kube/bookinfo.yaml
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: basic-ingress
  namespace: default
spec:
  ingressClassName: cilium
  rules:
  - http:
      paths:
      - backend:
          service:
            name: details
            port:
              number: 9080
        path: /details
        pathType: Prefix
      - backend:
          service:
            name: productpage
            port:
              number: 9080
        path: /
        pathType: Prefix
$ kubectl apply -f https://raw.githubusercontent.com/cilium/cilium/1.20.2/examples/kubernetes/servicemesh/basic-ingress.yaml

이 예제는 /details 경로에 대한 요청을 details 서비스로, /는 productpage 서비스로 라우팅해요.

서비스 목록을 보면 이 ingress에 대해 LoadBalancer 서비스가 자동으로 생성된 것을 볼 수 있어요. 클라우드 제공자가 외부 IP 주소를 자동으로 프로비저닝하지만 약 30초가 걸릴 수 있어요.

# For dedicated load balancer mode
$ kubectl get svc
NAME                           TYPE           CLUSTER-IP       EXTERNAL-IP     PORT(S)        AGE
cilium-ingress-basic-ingress   LoadBalancer   10.98.169.125    10.98.169.125   80:32478/TCP   2m11s
details                        ClusterIP      10.102.131.226   <none>          9080/TCP       2m15s
kubernetes                     ClusterIP      10.96.0.1        <none>          443/TCP        10m
productpage                    ClusterIP      10.97.231.139    <none>          9080/TCP       2m15s
ratings                        ClusterIP      10.108.152.42    <none>          9080/TCP       2m15s
reviews                        ClusterIP      10.111.145.160   <none>          9080/TCP       2m15s

# For shared load balancer mode
$ kubectl get services -n kube-system cilium-ingress
NAME             TYPE           CLUSTER-IP      EXTERNAL-IP     PORT(S)                      AGE
cilium-ingress   LoadBalancer   10.98.169.125   10.98.169.125   80:32690/TCP,443:31566/TCP   18m

외부 IP 주소는 Ingress에도 채워져야 해요:

$ kubectl get ingress
NAME            CLASS    HOSTS   ADDRESS         PORTS   AGE
basic-ingress   cilium   *       10.98.169.125   80      97s

Note EKS 같은 일부 제공자는 IP 주소가 아니라 FQDN(정규화된 도메인 이름)을 사용해요.

더 알아보기 (Learn more)