본문으로 바로가기 본문 바로가기
WIKI 기술 지식 베이스

Flux 워크로드 아이덴티티

원문 보기 위키 갱신

Flux 컨트롤러에 대해 워크로드 아이덴티티(Workload Identity)를 구성하는 방법을 소개합니다.

출처: 문서

본문

AWS EKS, Azure AKS, Google Cloud GKE에서 Flux를 실행할 때 Kubernetes 워크로드 아이덴티티를 활용해 Flux 컨트롤러가 컨테이너 레지스트리, KMS, S3 등의 클라우드 리소스에 접근할 수 있게 할 수 있습니다.

AWS IAM roles for service accounts

IRSA를 사용해 Flux에 AWS 리소스 접근 권한을 부여하려면, bootstrap 중에 flux-system kustomization.yaml에 다음 패치를 추가합니다:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
  - gotk-components.yaml
  - gotk-sync.yaml
patches:
  - patch: |
      apiVersion: v1
      kind: ServiceAccount
      metadata:
        name: controller
        annotations:
          eks.amazonaws.com/role-arn:       
    target:
      kind: ServiceAccount
      name: "(source-controller|image-reflector-controller)"
  - patch: |
      apiVersion: v1
      kind: ServiceAccount
      metadata:
        name: controller
        annotations:
          eks.amazonaws.com/role-arn:       
    target:
      kind: ServiceAccount
      name: "kustomize-controller"

Amazon Web Services 통합

ECR, S3, KMS 접근을 위한 AWS IAM 인증 구성에 대한 전체 가이드는 AWS 통합 문서를 참조하세요.

Azure 워크로드 아이덴티티

Flux에 Azure 리소스 접근 권한을 부여하려면, bootstrap 중에 flux-system kustomization.yaml에 다음 패치를 추가합니다:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
  - gotk-components.yaml
  - gotk-sync.yaml
patches:
  - patch: |
      apiVersion: v1
      kind: ServiceAccount
      metadata:
        name: controller
        annotations:
          azure.workload.identity/client-id: 
          azure.workload.identity/tenant-id:       
    target:
      kind: ServiceAccount
      name: "(source-controller|image-reflector-controller)"
  - patch: |
      apiVersion: apps/v1
      kind: Deployment
      metadata:
        name: controller
        labels:
          azure.workload.identity/use: "true"
      spec:
        template:
          metadata:
            labels:
              azure.workload.identity/use: "true"          
    target:
      kind: Deployment
      name: "(source-controller|image-reflector-controller)"

Microsoft Azure 통합

ACR, Azure DevOps, Blob Storage, Key Vault, Event Hubs 접근을 위한 Microsoft Entra ID 인증 구성에 대한 전체 가이드는 Azure 통합 문서를 참조하세요.

GCP 워크로드 아이덴티티

Flux에 Google Cloud 리소스 접근 권한을 부여하려면, bootstrap 중에 flux-system kustomization.yaml에 다음 패치를 추가합니다:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
  - gotk-components.yaml
  - gotk-sync.yaml
patches:
  - patch: |
      apiVersion: v1
      kind: ServiceAccount
      metadata:
        name: controller
        annotations:
          iam.gke.io/gcp-service-account:       
    target:
      kind: ServiceAccount
      name: "(source-controller|image-reflector-controller)"
  - patch: |
      apiVersion: v1
      kind: ServiceAccount
      metadata:
        name: controller
        annotations:
          iam.gke.io/gcp-service-account:       
    target:
      kind: ServiceAccount
      name: "kustomize-controller"

Google Cloud Platform 통합

GAR, GCS, KMS, Pub/Sub 접근을 위한 GCP IAM 인증 구성에 대한 전체 가이드는 GCP 통합 문서를 참조하세요.