셀프 등록
서비스 인스턴스가 시작 시 서비스 레지스트리에 스스로 등록하고 종료 시 해제되는 서비스 아키텍처 패턴
구조와 동작 원리
구성 요소와 배치 원칙 (조사 기반 개념 설명 · 연결 순서나 토폴로지는 특정하지 않음)
서비스 레지스트리는 마이크로서비스 인스턴스로 요청을 디스패치하는 정보를 담는 데이터베이스
등록 정보의 소스는 서비스 프로바이더 자신이며 레지스트리에 기록됨
서비스 인스턴스의 레지스트리 등록·해제를 어떻게 처리할지가 핵심 문제
기대 효과
애플리케이션이 자신의 준비 상태를 레지스트리에 직접 반영할 수 있음
트레이드오프
프로세스가 신원·네트워크에 접근해야 하는 부트스트랩 의존성이 생김
비정상 종료(SIGKILL/OOM/전원 손실) 시 해제가 누락되어 유령 인스턴스가 레지스트리에 남을 수 있음
운영 및 적용 가이드
종합 설명 · 원문 인용으로 검증된 항목과 구분됩니다. 실제 적용 전 확인이 필요합니다.
언제 사용하는가
마이크로서비스 인스턴스가 동적으로 늘고 줄며 위치가 바뀌는 환경에서 클라이언트가 살아 있는 인스턴스를 발견하도록 할 때 적합하다.
시나리오
예를 들어 월 수백만 요청을 처리하는 이커머스가 수십~수백 개 주문·결제 마이크로서비스 인스턴스를 오토스케일링한다고 하자. 각 인스턴스는 시작 시 레지스트리에 자신을 등록하고 종료 시 해제해야 하며, 롤링 배포와 장애로 인한 비정상 종료에도 죽은 주소가 빠르게 제거되어야 한다.
배치 원칙
- 서비스 인스턴스는 시작 시 레지스트리에 자신의 주소·헬스 정보를 등록
- 레지스트리는 가용성·일관성 요구에 맞춰 복제 배치
- 클라이언트/게이트웨이는 레지스트리 조회 결과를 캐시
- Kubernetes에서는 readiness 상태를 엔드포인트 반영에 사용
- TTL·하트비트·헬스체크를 레지스트리 측에서 관리
온프레미스
온프레미스에서는 레지스트리·서비스·모니터링을 내부 네트워크에 배치하고, 노드·인스턴스가 레지스트리에 접근할 수 있는 DNS/방화벽/인증 부트스트랩을 먼저 보장한다. 수동 등록이 필요한 노드는 자동화 스크립트로 표준화하고 TTL·헬스체크를 필수로 둔다.
클라우드
클라우드에서는 오토스케일링 그룹·관리형 레지스트리·로드밸런서를 연계해 등록/해제를 자동화하고, 가용영역 장애를 고려해 레지스트리를 다중 AZ로 배치한다. 등록 실패가 서비스 시작 실패로 이어지도록 하고 재시도·백오프·경보를 구성한다.
Kubernetes
Kubernetes에서는 readiness/liveness probe와 Service 엔드포인트 동기화를 활용하고, Pod 종료 시 graceful shutdown으로 해제를 보장한다. 레지스트리 외부 등록이 필요하면 init/sidecar 또는 운영자 패턴으로 등록·해제를 일원화하고 RBAC·네트워크 정책을 적용한다.
장애 대응
대표 장애는 등록 실패로 서비스가 보이지 않는 경우, 비정상 종료 후 유령 인스턴스가 남는 경우, 네트워크 분할로 오래된 주소가 전파되는 경우다. 등록 실패율·하트비트·TTL·헬스체크를 모니터링하고, 실패 시 시작 차단·지수 백오프 재시도·강제 해제·트래픽 우회 및 레지스트리 캐시 폴백 순으로 대응한다.
14개 관점별 근거
조사 당시 근거 보유 여부입니다. 출처의 정확성과 최신성을 별도로 판단하세요.
정의·개요근거 있음
서비스 인스턴스가 시작 시 서비스 레지스트리에 스스로 등록하고 종료 시 해제되는 서비스 아키텍처 패턴
Service instances must be registered with the service registry on startup so that they can be discovered and unregistered on shutdown.해결하는 문제근거 있음
서비스 인스턴스의 레지스트리 등록·해제를 어떻게 처리할지가 핵심 문제
How are service instances registered with and unregistered from the service registry?주요 구성 컴포넌트·리소스근거 있음
서비스 레지스트리는 마이크로서비스 인스턴스로 요청을 디스패치하는 정보를 담는 데이터베이스
The service registry is a database populated with information on how to dispatch requests to microservice instances.데이터·에셋 배치 원칙근거 있음
등록 정보의 소스는 서비스 프로바이더 자신이며 레지스트리에 기록됨
Self registration: the service provider registers itself into service registry.대표 유스케이스근거 있음
클라이언트/서버 사이드 서비스 디스커버리를 쓰는 마이크로서비스 환경에서 인스턴스 발견을 가능하게 함
You have applied either the Client-side Service Discovery pattern or the Server-side Service Discovery pattern.시나리오 예시근거 있음
K3s 클러스터를 기존 Rancher 환경에 셀프 등록해 대규모 Kubernetes 배포를 자동화하는 사례
configuring a self-registration of those same clusters onto their existing Rancher environment부적합 상황·주의근거 있음
비정상 종료(SIGKILL/OOM/전원 손실) 시 해제가 누락되어 유령 인스턴스가 레지스트리에 남을 수 있음
a process that is `SIGKILL` ed, OOM-killed, or on a node that lost power never deregisters.온프레미스 관점(개발·배포·운영)근거 있음
온프레미스에서는 컴퓨트 노드를 수동 프로비저닝한 뒤 등록해야 하는 경우가 있음
For on-premises infrastructure and other cloud providers, you provision compute nodes manually and register them with Cloudfleet.클라우드 관점(개발·배포·운영)근거 있음
클라우드/엣지에서 셀프 등록으로 Kubernetes 클러스터를 자동 등록·관리 가능
on-prem, on a public cloud, or at the edgeKubernetes 관점(개발·배포·운영)근거 있음
Kubernetes에서는 readiness probe 실패 인스턴스를 Service 엔드포인트 집합에서 제거
In Kubernetes, configure readiness probes — an instance failing its readiness probe is removed from the Service's endpoint set장애 대응 관점근거 있음
등록 실패 시 서비스 시작을 실패시키고 재시도·모니터링해야 함
Mitigation: fail service startup if registration fails (do not run unregistered). Implement registration retries with exponential backoff.장점근거 있음
애플리케이션이 자신의 준비 상태를 레지스트리에 직접 반영할 수 있음
Self-registration can represent application readiness directly단점·트레이드오프근거 있음
프로세스가 신원·네트워크에 접근해야 하는 부트스트랩 의존성이 생김
creates a bootstrap dependency: the process needs identity, network access대표 기술·도구근거 있음
Consul의 자동 해제 설정과 Kubernetes readiness probe가 대표적으로 언급됨
In Consul, set `deregister_critical_service_after` to a value like `2m` to automatically purge long-failed instances.추가 참고 문헌 (23)
- Pattern: Self Registration ↗
- Self Registration - WSO2 Identity Platform ↗
- Navigate service discovery in a microservices architecture | TechTarget ↗
- reference-architecture | The Reference Architecture for Agility is a technology-neutral logical architecture based on a disaggregated cloud-based model. ↗
- Self-Registration - Identity Authority – IAM & Access Control Knowledge Hub ↗
- An Introduction to Microservices, Part 3: The Service Registry ↗
- Plan self-service registration flows | Okta Developer ↗
- Service Discovery: A Survey | Xinyu Ma ↗
- New K3s Appliance with Rancher Self-Registration ↗
- Provisioning MKS clusters in HPE Private Cloud Enterprise | HPE Developer Portal ↗
- Self-managed nodes ↗
- Registering Existing Clusters | SUSE® Rancher for AWS Latest ↗
- Kubernetes on your own servers: Kubespray clusters and read-only cluster registration — CloudOps Docs ↗
- Build a hybrid cloud cluster by adding ECS instances to a registered cluster - Container Service for Kubernetes - Alibaba Cloud ↗
- Deploy Amazon EKS clusters across cloud and on-premises environments - Amazon EKS ↗
- Kubernetes Deployment Options for On-Prem Clusters ↗
- Common Failure Modes and Mitigation Strategies in Service Discovery | Service Discovery - System Overflow ↗
- Service discovery: registry, heartbeats and TTL ↗
- Service Discovery and Service Mesh (System Design) | JJS Academy ↗
- BEE-19007: Service Discovery | Backend Engineering Essentials ↗
- Service Discovery and Control-Plane State | System Design Patterns ↗
- Documentation: changing Eureka renewal frequency *WILL* break the self-preservation feature of the server ↗
- Service Registry Pattern: Eureka, Consul, and etcd ↗