망지로그

CKA - ingress 본문

Kubernetes

CKA - ingress

망지v 2024. 7. 4. 15:02

https://kubernetes.io/docs/concepts/services-networking/ingress/#path-types

 

Ingress

Make your HTTP (or HTTPS) network service available using a protocol-aware configuration mechanism, that understands web concepts like URIs, hostnames, paths, and more. The Ingress concept lets you map traffic to different backends based on rules you defin

kubernetes.io

 

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: simple-fanout-example
spec:
  rules:
  - host: foo.bar.com
    http:
      paths:
      - path: /foo
        pathType: Prefix
        backend:
          service:
            name: service1
            port:
              number: 4200
      - path: /bar
        pathType: Prefix
        backend:
          service:
            name: service2
            port:
              number: 8080

여기서 port number는 svc의 포트를 넣어줄 것 ! pod 포트가 아닙니다.

 

'Kubernetes' 카테고리의 다른 글

CKA -trouble shooting  (0) 2024.07.04
CKA- kubeadm  (0) 2024.07.04
CKA - core DNS in k8s  (0) 2024.07.03
CKA - service networking  (0) 2024.07.03
CKA - Networking weave  (0) 2024.07.03