InfoGrab Docs

Kubernetes 애플리케이션 자동 검색 참조

요약

Kubernetes 애플리케이션 자동 검색에는 Teleport Discovery Service, Teleport Application Service 및 Kubernetes 서비스의 어노테이션이 포함됩니다. 차트의 kubernetesDiscovery 값을 설정하여 서비스 검색 범위를 설정할 수 있습니다.

Kubernetes 애플리케이션 자동 검색에는 Teleport Discovery Service, Teleport Application Service 및 Kubernetes 서비스의 어노테이션이 포함됩니다. 이 가이드에서는 Kubernetes 클러스터에서 Kubernetes 애플리케이션 자동 검색을 관리하기 위해 각각을 설정하는 방법을 보여줍니다.

Teleport 에이전트 Helm 차트 설정#

차트의 kubernetesDiscovery 값을 설정하여 서비스 검색 범위를 설정할 수 있습니다. 자세한 내용은 helm 차트 문서를 참조하세요.

values.yaml 예시:

kubernetesDiscovery:
- types: ["app"]
  namespaces: [ "toronto", "porto" ]
  labels:
    env: staging
- types: ["app"]
  namespaces: [ "seattle", "oakland" ]
  labels:
    env: testing

Kubernetes 앱 자동 검색 수동 설정#

teleport-kube-agent Helm 차트가 자동으로 설정을 구성하지만 필요한 서비스를 수동으로 설정할 수도 있습니다. 이를 위해 Teleport Application Service 및 Teleport Discovery Service의 설정 파일을 조정한 다음 이러한 서비스를 실행하는 에이전트를 다시 시작합니다.

Discovery Service의 설정은 kubernetes 필드로 제어되며, 예시는 다음과 같습니다:

# 이 섹션은 Discovery Service를 설정합니다
discovery_service:
  enabled: true
  discovery_group: main-cluster
  kubernetes:
  - types: ["app"]
    namespaces: [ "toronto", "porto" ]
    labels:
      env: staging
  - types: ["app"]
    namespaces: [ "seattle", "oakland" ]
    labels:
      env: testing

Application Service의 설정은 resources 필드로 제어되며, 예시는 다음과 같습니다:

app_service:
  enabled: true
  resources:
  - labels:
    "teleport.dev/kubernetes-cluster": "main-cluster"
    "teleport.dev/origin": "discovery-kubernetes"

teleport.dev/kubernetes-cluster 레이블은 Discovery Service 설정의 discovery_group 필드 값과 일치해야 합니다.

자세한 내용은 discovery_serviceapp_service 설정 참조를 확인하세요.

어노테이션#

서비스의 Kubernetes 어노테이션을 사용하여 서비스에서 앱으로의 변환을 세밀하게 조정할 수 있습니다. 모든 어노테이션은 선택 사항입니다. 기본 동작을 재정의하지만 서비스 가져오기에 필수적이지는 않습니다.

teleport.dev/discovery-type#

이 서비스가 어떤 유형으로 간주되는지를 제어합니다. 어노테이션이 없으면 기본적으로 모든 서비스가 "app" 유형으로 간주됩니다. Discovery Service 설정의 매처가 서비스 유형과 일치하면 가져옵니다. 현재 지원되는 유일한 값은 app으로, 이 서비스에서 Teleport 애플리케이션을 가져올 것을 의미합니다. 향후 데이터베이스 가져오기로 확장할 계획이 있습니다.

teleport.dev/protocol#

생성하는 Teleport 앱의 URI에 대한 프로토콜을 제어합니다. 어노테이션이 설정되지 않으면 노출된 포트의 프로토콜을 결정하기 위해 휴리스틱이 사용됩니다. 모든 휴리스틱이 작동하지 않으면 포트는 건너뜁니다. tcp 프로토콜로 앱을 가져오려면 서비스에 명시적인 어노테이션 teleport.dev/protocol: "tcp"가 있어야 합니다.

teleport.dev/port#

Kubernetes 서비스의 선호 포트를 제어하며, 서비스에 여러 노출된 포트가 있어도 이 포트만 사용됩니다. 해당 값은 노출된 서비스 포트 중 하나여야 합니다. 그렇지 않으면 앱을 가져오지 않습니다. 값은 숫자 값이나 서비스에 정의된 포트 이름으로 일치시킬 수 있습니다.

teleport.dev/name#

결과 앱 이름을 제어합니다. 있는 경우 기본 앱 이름 패턴 $SERVICE_NAME-$NAMESPACE-$KUBE_CLUSTER_NAME을 재정의합니다. 여러 포트가 노출된 경우 결과 앱은 $APP_NAME-$PORT1_NAME, $APP_NAME-$PORT2_NAME 등과 같이 어노테이션 값에 포트 이름을 접미사로 추가합니다. 여기서 $APP_NAME은 어노테이션으로 설정된 이름입니다.

teleport.dev/description#

검색된 앱의 기본 설명을 재정의합니다.

teleport.dev/insecure-skip-verify#

이 앱에 대한 TLS 인증서 검증을 건너뛸지 여부를 제어합니다. 있고 true로 설정되어 있으면 TLS 인증서 검증이 건너뜁니다.

annotations:
  teleport.dev/insecure-skip-verify: "true"

teleport.dev/ignore#

Discovery Service가 이 서비스를 무시해야 하는지 여부를 제어합니다. 이 어노테이션은 Discovery Service 설정과 일치하는 레이블을 공유하지만 앱으로 가져오지 않으려는 서비스를 제외하고 싶을 때 유용합니다.

annotations:
  teleport.dev/ignore: "true"

teleport.dev/app-rewrite#

필요한 경우 Teleport 앱의 재작성 설정을 제어합니다. 동적 등록 구문으로 앱을 설정할 때 사용하는 것과 동일한 YAML 형식의 전체 재작성 설정을 포함해야 합니다(문서 참조).

annotations:
  teleport.dev/app-rewrite: |
    redirect:
    - "localhost"
    - "jenkins.internal.dev"
    headers:
    - name: "X-Custom-Header"
      value: "example"
    - name: "Authorization"
      value: "Bearer {{internal.jwt}}"

teleport.dev/public-addr#

필요한 경우 생성하는 Teleport 앱의 공개 주소를 제어합니다.

annotations:
  teleport.dev/public-addr: "custom.teleport.dev"

teleport.dev/path#

경로는 HTTP 서비스의 하위 경로에서 애플리케이션이 제공되는 경우 Teleport 앱에 대해 생성된 URI에 추가됩니다.

annotations:
  teleport.dev/path: "foo/bar"

Kubernetes 애플리케이션 자동 검색 참조

원문 보기
요약

Kubernetes 애플리케이션 자동 검색에는 Teleport Discovery Service, Teleport Application Service 및 Kubernetes 서비스의 어노테이션이 포함됩니다. 차트의 kubernetesDiscovery 값을 설정하여 서비스 검색 범위를 설정할 수 있습니다.

Kubernetes 애플리케이션 자동 검색에는 Teleport Discovery Service, Teleport Application Service 및 Kubernetes 서비스의 어노테이션이 포함됩니다. 이 가이드에서는 Kubernetes 클러스터에서 Kubernetes 애플리케이션 자동 검색을 관리하기 위해 각각을 설정하는 방법을 보여줍니다.

Teleport 에이전트 Helm 차트 설정#

차트의 kubernetesDiscovery 값을 설정하여 서비스 검색 범위를 설정할 수 있습니다. 자세한 내용은 helm 차트 문서를 참조하세요.

values.yaml 예시:

kubernetesDiscovery:
- types: ["app"]
  namespaces: [ "toronto", "porto" ]
  labels:
    env: staging
- types: ["app"]
  namespaces: [ "seattle", "oakland" ]
  labels:
    env: testing

Kubernetes 앱 자동 검색 수동 설정#

teleport-kube-agent Helm 차트가 자동으로 설정을 구성하지만 필요한 서비스를 수동으로 설정할 수도 있습니다. 이를 위해 Teleport Application Service 및 Teleport Discovery Service의 설정 파일을 조정한 다음 이러한 서비스를 실행하는 에이전트를 다시 시작합니다.

Discovery Service의 설정은 kubernetes 필드로 제어되며, 예시는 다음과 같습니다:

# 이 섹션은 Discovery Service를 설정합니다
discovery_service:
  enabled: true
  discovery_group: main-cluster
  kubernetes:
  - types: ["app"]
    namespaces: [ "toronto", "porto" ]
    labels:
      env: staging
  - types: ["app"]
    namespaces: [ "seattle", "oakland" ]
    labels:
      env: testing

Application Service의 설정은 resources 필드로 제어되며, 예시는 다음과 같습니다:

app_service:
  enabled: true
  resources:
  - labels:
    "teleport.dev/kubernetes-cluster": "main-cluster"
    "teleport.dev/origin": "discovery-kubernetes"

teleport.dev/kubernetes-cluster 레이블은 Discovery Service 설정의 discovery_group 필드 값과 일치해야 합니다.

자세한 내용은 discovery_serviceapp_service 설정 참조를 확인하세요.

어노테이션#

서비스의 Kubernetes 어노테이션을 사용하여 서비스에서 앱으로의 변환을 세밀하게 조정할 수 있습니다. 모든 어노테이션은 선택 사항입니다. 기본 동작을 재정의하지만 서비스 가져오기에 필수적이지는 않습니다.

teleport.dev/discovery-type#

이 서비스가 어떤 유형으로 간주되는지를 제어합니다. 어노테이션이 없으면 기본적으로 모든 서비스가 "app" 유형으로 간주됩니다. Discovery Service 설정의 매처가 서비스 유형과 일치하면 가져옵니다. 현재 지원되는 유일한 값은 app으로, 이 서비스에서 Teleport 애플리케이션을 가져올 것을 의미합니다. 향후 데이터베이스 가져오기로 확장할 계획이 있습니다.

teleport.dev/protocol#

생성하는 Teleport 앱의 URI에 대한 프로토콜을 제어합니다. 어노테이션이 설정되지 않으면 노출된 포트의 프로토콜을 결정하기 위해 휴리스틱이 사용됩니다. 모든 휴리스틱이 작동하지 않으면 포트는 건너뜁니다. tcp 프로토콜로 앱을 가져오려면 서비스에 명시적인 어노테이션 teleport.dev/protocol: "tcp"가 있어야 합니다.

teleport.dev/port#

Kubernetes 서비스의 선호 포트를 제어하며, 서비스에 여러 노출된 포트가 있어도 이 포트만 사용됩니다. 해당 값은 노출된 서비스 포트 중 하나여야 합니다. 그렇지 않으면 앱을 가져오지 않습니다. 값은 숫자 값이나 서비스에 정의된 포트 이름으로 일치시킬 수 있습니다.

teleport.dev/name#

결과 앱 이름을 제어합니다. 있는 경우 기본 앱 이름 패턴 $SERVICE_NAME-$NAMESPACE-$KUBE_CLUSTER_NAME을 재정의합니다. 여러 포트가 노출된 경우 결과 앱은 $APP_NAME-$PORT1_NAME, $APP_NAME-$PORT2_NAME 등과 같이 어노테이션 값에 포트 이름을 접미사로 추가합니다. 여기서 $APP_NAME은 어노테이션으로 설정된 이름입니다.

teleport.dev/description#

검색된 앱의 기본 설명을 재정의합니다.

teleport.dev/insecure-skip-verify#

이 앱에 대한 TLS 인증서 검증을 건너뛸지 여부를 제어합니다. 있고 true로 설정되어 있으면 TLS 인증서 검증이 건너뜁니다.

annotations:
  teleport.dev/insecure-skip-verify: "true"

teleport.dev/ignore#

Discovery Service가 이 서비스를 무시해야 하는지 여부를 제어합니다. 이 어노테이션은 Discovery Service 설정과 일치하는 레이블을 공유하지만 앱으로 가져오지 않으려는 서비스를 제외하고 싶을 때 유용합니다.

annotations:
  teleport.dev/ignore: "true"

teleport.dev/app-rewrite#

필요한 경우 Teleport 앱의 재작성 설정을 제어합니다. 동적 등록 구문으로 앱을 설정할 때 사용하는 것과 동일한 YAML 형식의 전체 재작성 설정을 포함해야 합니다(문서 참조).

annotations:
  teleport.dev/app-rewrite: |
    redirect:
    - "localhost"
    - "jenkins.internal.dev"
    headers:
    - name: "X-Custom-Header"
      value: "example"
    - name: "Authorization"
      value: "Bearer {{internal.jwt}}"

teleport.dev/public-addr#

필요한 경우 생성하는 Teleport 앱의 공개 주소를 제어합니다.

annotations:
  teleport.dev/public-addr: "custom.teleport.dev"

teleport.dev/path#

경로는 HTTP 서비스의 하위 경로에서 애플리케이션이 제공되는 경우 Teleport 앱에 대해 생성된 URI에 추가됩니다.

annotations:
  teleport.dev/path: "foo/bar"