VM에서 Consul namespace 구성

VM에서 Consul namespace 구성 (Configure Consul namespaces on VMs)

이 페이지에서는 VM에서 Consul namespace를 만들고 등록하는 프로세스를 설명해요. Namespace를 사용하면 데이터와 작업을 팀 간에 격리하여 하나의 Consul 서버 집합이 여러 팀을 동시에 지원할 수 있어요.

출처: 문서

본문

Enterprise

이 기능은 Consul Enterprise가 필요합니다. 자세한 내용은 enterprise feature matrix를 참조하세요.

이 페이지에서는 VM에서 Consul namespace를 만들고 등록하는 프로세스를 설명합니다.

소개 (Introduction)

Namespace를 사용하면 팀 간에 데이터와 작업을 격리하여 하나의 Consul 서버 집합이 여러 팀을 동시에 지원할 수 있습니다.

완전히 격리된 구성에서 각 팀은 자체 namespace를 갖습니다. 각 namespace에는 해당 namespace 내에서 데이터와 액세스를 관리할 책임이 있는 지정된 namespace 운영자 가 있습니다. namespace 운영자의 데이터 보기 및 업데이트 액세스는 자신의 namespace로 제한됩니다.

Namespace는 데이터센터 수준에 존재합니다. 결과적으로 namespace를 구성하고 관리하려면 전체 Consul 데이터센터에 대한 권한이 있는 ACL 토큰이 필요합니다.

Namespace를 만들기 위한 최소 요구 사항은 operator = "write" 정책이 있는 ACL 토큰입니다.

namespace 정의 만들기 (Create namespace definitions)

Consul에서 namespace를 활용하는 첫 번째 단계는 데이터센터에 공존해야 하는 서로 다른 팀에 할당할 namespace를 만드는 것입니다.

이 문서에서는 두 개의 서로 다른 팀이 있다고 가정합니다. 애플리케이션 배포를 담당하는 app-team 과 프로덕션 DBMS 유지 관리를 담당하는 db-team 입니다.

Namespace는 hcl 또는 json 형식의 구성 파일로 정의할 수 있습니다.

HCL:

app-team namespace에 대한 정의 파일을 만듭니다.

app-team.hcl

name = "app-team",
description = "Namespace for the team managing the production application"

db-team namespace에 대한 정의 파일을 만듭니다.

db-team.hcl

name = "db-team",
description = "Namespace for the team managing the production database"

JSON:

app-team 에 대한 정의 파일을 만듭니다.

app-team.json

{
  "name": "app-team",
  "description": "Namespace for the team managing the production application"
}

db-team 에 대한 정의 파일을 만듭니다.

db-team.json

{
  "name": "db-team",
  "description": "Namespace for the team managing the production database"
}

이 예제는 이름과 설명만 있는 기본 namespace 정의를 사용합니다. 구성 가능한 namespace 매개변수의 전체 목록은 Namespace definition reference를 참조하세요.

namespace 등록 (Register namespaces)

consul namespace CLI 명령을 사용하여 Consul 데이터센터에 namespace를 등록하세요.

HCL:

app-team namespace를 만듭니다.

$ consul namespace write app-team.hcl
Name: app-team
Description:
   Namespace for the team managing the production application
Partition:   default

db-team namespace를 만듭니다.

$ consul namespace write db-team.hcl
Name: db-team
Description:
   Namespace for db-team managing the production counting application
Partition:   default

JSON:

app-team namespace를 만듭니다.

$ consul namespace write app-team.json
Name: app-team
Description:
   Namespace for app-team managing the production application
Partition:   default

db-team namespace를 만듭니다.

$ consul namespace write db-team.json
Name: db-team
Description:
   Namespace for db-team managing the production counting application
Partition:   default

Consul 데이터센터에서 namespace 검토 (Review namespaces in a Consul datacenter)

consul namespace list CLI 명령을 사용하여 Consul 데이터센터에 등록된 namespace를 검토하세요.

$ consul namespace list
app-team:
   Description:
      Namespace for the team managing the production application
   Partition:   default
db-team:
   Description:
      Namespace for db-team managing the production database
   Partition:   default

특정 namespace에 대한 정보를 반환하려면 consul namespace read CLI 명령을 사용하세요.

$ consul namespace read app-team
Name: app-team
Description:
   Namespace for the team managing the production application
Partition:   default

namespace 삭제 (Delete namespaces)

namespace를 만든 후 Consul CLI를 사용하여 업데이트하거나 삭제할 수 있습니다. 자세한 내용은 consul namespace update 또는 consul namespace delete를 참조하세요.

다음 단계 (Next steps)

Consul에 namespace를 등록한 후 namespace를 추가로 보호하거나 서비스 검색을 위해 특정 namespace에 서비스를 등록하기 시작할 수 있습니다.

namespace 내 리소스를 보호하는 방법을 배우려면 Delegate ACL token management with namespaces를 참조하세요.

namespace 내에서 서비스를 등록하는 방법을 배우려면 Register services into a namespace을 참조하세요.

더 알아보기 (Learn more)