서비스2 Kubernetes - Headless Service Headless Service 정의 ClusterIP가 없는 서비스로 단일 진입점이 필요 없을 때 사용 Service와 연결된 Pod의 endpoint로 DNS 레코드가 생성됨 쿠버네티스 coreDNS에 등록되며 DNS resolving Service로 요청이 가능해진다. Pod의 DNS 주소: pod-ip-addr.namespace.pod.cluster.local 생성 사전에 Deployment를 먼저 생성하고 그 다음에 Service를 생성하여 묶어준다. root@master:~# cat > deploy-nginx.yaml apiVersion: apps/v1 kind: Deployment metadata: name: webui spec: replicas: 3 selector: matchLabels: .. 2021. 11. 30. Kubernetes - Service (서비스) Service (서비스) 정의 동일한 서비스를 제공하는 Pod 그룹의 단일 진입점을 제공 파드들의 하나의 IP로 묶어서 관리를 해줌 Service 종류 ClusterIP selector의 label가 동일한 파드들의 그룹으로 묶어 단일 진입점 (Virtual_IP)을 생성 클러스터 내부에서만 사용가능 type 생략 시 default 값으로 10.96.0.0/12 범위에서 할당됨 생성 사전에 Deployment를 먼저 생성하고 그 다음에 Service를 생성하여 ClusterIP로 묶어준다. root@master:~# cat > deploy-nginx.yaml apiVersion: apps/v1 kind: Deployment metadata: name: webui spec: replicas: 3 selec.. 2021. 11. 30. 이전 1 다음 728x90 반응형