가상 노드가 있는 OCI Kubernetes 엔진에서 OCI 고유 수신 컨트롤러 설정
소개
이 사용지침서에서는 가상 노드 노드 노드 풀을 사용하여 Oracle Cloud Infrastructure Kubernetes Engine(OKE)에서 OCI(Oracle Cloud Infrastructure) 고유 수신 컨트롤러를 설정하는 프로세스를 안내합니다. 가상 노드는 기본 컴퓨팅 인스턴스를 추상화하는 서버리스 솔루션이기 때문에 일반 인스턴스 기반 작업자 노드와는 다릅니다. 특정 가상 머신 인스턴스에 의존하는 기존 작업자 노드와 달리 가상 노드는 워크로드 요구에 따라 동적으로 확장되며 기본 인프라의 수동 관리가 필요하지 않습니다. 따라서 자동 확장 및 운영 오버헤드 감소가 필요한 워크로드에 이상적입니다.
이 자습서에서는 가상 노드를 사용하여 OKE에서 OCI 고유 수신 컨트롤러를 설정합니다. 워크로드 ID 정책을 구성하고, 수신 애드온을 활성화하고, Kubernetes 매니페스트를 통해 수신 리소스를 배포할 예정입니다.
이러한 작업을 수행하면 가상 노드의 운영 단순성을 활용하면서 OCI 로드 밸런서 기능을 사용하여 애플리케이션을 노출하고 수신 트래픽을 관리할 수 있습니다. 이 설정은 트래픽 관리를 간소화하고 확장 가능하고 비용 효율적인 방식으로 운영급 워크로드를 지원합니다.
목표
- 수신 리소스를 효율적으로 관리하도록 OKE에서 OCI 고유 수신 컨트롤러를 설정하고 구성합니다.
작업 1: 작업 로드 ID 주체 정책 생성
OCI 고유 수신 컨트롤러를 사용으로 설정하기 전에 작업로드 ID 주체 정책을 생성합니다. 가상 노드는 서버리스이며 OCI 컴퓨팅 인스턴스를 사용하지 않으므로 인스턴스 주체 대신 워크로드 ID가 필요합니다. 이 정책을 사용하면 수신 컨트롤러가 컴파트먼트의 리소스를 관리할 수 있습니다.
-
OCI 콘솔로 이동하여 ID 및 보안, ID로 이동하고 정책을 누릅니다.
-
정책 생성 및 정책 이름 입력. 자세한 내용은 OCI 콘솔을 사용하여 정책 생성을 참조하십시오.
-
수동 편집기 표시를 누르고
location
및cluster-ocid
를 특정 값으로 바꾸어 다음 정책 문을 입력합니다.참고:
<location>
은 리소스가 있는 구획으로 바꿔야 합니다.<cluster-ocid>
는 OKE 클러스터의 OCID로 바꿔야 합니다.
Allow any-user to manage load-balancers in <location> where all {request.principal.type = 'workload', request.principal.namespace = 'native-ingress-controller-system', request.principal.service_account = 'oci-native-ingress-controller', request.principal.cluster_id = '<cluster-ocid>'} Allow any-user to use virtual-network-family in <location> where all {request.principal.type = 'workload', request.principal.namespace = 'native-ingress-controller-system', request.principal.service_account = 'oci-native-ingress-controller', request.principal.cluster_id = '<cluster-ocid>'} Allow any-user to manage cabundles in <location> where all {request.principal.type = 'workload', request.principal.namespace = 'native-ingress-controller-system', request.principal.service_account = 'oci-native-ingress-controller', request.principal.cluster_id = '<cluster-ocid>'} Allow any-user to manage cabundle-associations in <location> where all {request.principal.type = 'workload', request.principal.namespace = 'native-ingress-controller-system', request.principal.service_account = 'oci-native-ingress-controller', request.principal.cluster_id = '<cluster-ocid>'} Allow any-user to manage leaf-certificates in <location> where all {request.principal.type = 'workload', request.principal.namespace = 'native-ingress-controller-system', request.principal.service_account = 'oci-native-ingress-controller', request.principal.cluster_id = '<cluster-ocid>'} Allow any-user to read leaf-certificate-bundles in <location> where all {request.principal.type = 'workload', request.principal.namespace = 'native-ingress-controller-system', request.principal.service_account = 'oci-native-ingress-controller', request.principal.cluster_id = '<cluster-ocid>'} Allow any-user to manage leaf-certificate-versions in <location> where all {request.principal.type = 'workload', request.principal.namespace = 'native-ingress-controller-system', request.principal.service_account = 'oci-native-ingress-controller', request.principal.cluster_id = '<cluster-ocid>'} Allow any-user to manage certificate-associations in <location> where all {request.principal.type = 'workload', request.principal.namespace = 'native-ingress-controller-system', request.principal.service_account = 'oci-native-ingress-controller', request.principal.cluster_id = '<cluster-ocid>'} Allow any-user to read certificate-authorities in <location> where all {request.principal.type = 'workload', request.principal.namespace = 'native-ingress-controller-system', request.principal.service_account = 'oci-native-ingress-controller', request.principal.cluster_id = '<cluster-ocid>'} Allow any-user to manage certificate-authority-associations in <location> where all {request.principal.type = 'workload', request.principal.namespace = 'native-ingress-controller-system', request.principal.service_account = 'oci-native-ingress-controller', request.principal.cluster_id = '<cluster-ocid>'} Allow any-user to read certificate-authority-bundles in <location> where all {request.principal.type = 'workload', request.principal.namespace = 'native-ingress-controller-system', request.principal.service_account = 'oci-native-ingress-controller', request.principal.cluster_id = '<cluster-ocid>'} Allow any-user to read public-ips in <location> where all {request.principal.type = 'workload', request.principal.namespace = 'native-ingress-controller-system', request.principal.service_account = 'oci-native-ingress-controller', request.principal.cluster_id = '<cluster-ocid>'} Allow any-user to manage floating-ips in <location> where all {request.principal.type = 'workload', request.principal.namespace = 'native-ingress-controller-system', request.principal.service_account = 'oci-native-ingress-controller', request.principal.cluster_id = '<cluster-ocid>'} Allow any-user to manage waf-family in <location> where all {request.principal.type = 'workload', request.principal.namespace = 'native-ingress-controller-system', request.principal.service_account = 'oci-native-ingress-controller', request.principal.cluster_id = '<cluster-ocid>'} Allow any-user to read cluster-family in <location> where all {request.principal.type = 'workload', request.principal.namespace = 'native-ingress-controller-system', request.principal.service_account = 'oci-native-ingress-controller', request.principal.cluster_id = '<cluster-ocid>'} Allow any-user to use tag-namespaces in <location> where all {request.principal.type = 'workload', request.principal.namespace = 'native-ingress-controller-system', request.principal.service_account = 'oci-native-ingress-controller', request.principal.cluster_id = '<cluster-ocid>'}
작업 2: OCI 고유 수신 컨트롤러 애드온 사용
필요한 작업 로드 ID 주체 정책이 설정되면 OKE 클러스터에 대해 OCI 고유 수신 컨트롤러 추가 기능을 사용으로 설정할 수 있습니다. 이 추가 기능을 통해 OCI 로드 밸런서를 사용하여 수신 트래픽을 효율적으로 관리할 수 있습니다.
-
OCI 콘솔에서 OKE 클러스터로 이동합니다.
-
아래로 스크롤하여 부가 기능을 누릅니다.
-
추가 기능 페이지에서 고유 수신 컨트롤러를 누릅니다.
-
고유 수신 제어기 편집 페이지의 고유 수신 제어기 사용을 선택하고 옵션에 다음 정보를 입력합니다.
compartmentId
: 컴파트먼트 OCID를 입력합니다.loadBalancerSubnetId
: 로드 밸런서 서브넷 OCID를 입력합니다.authType
:workloadIdentity
를 입력합니다.
-
변경사항 저장을 눌러 설정을 적용합니다.
주: 이 구성은 가상 노드 풀에 필요합니다. 앞서 언급했듯이 서버리스이며 인스턴스 주체 인증을 지원하지 않습니다. 이 경우 작업 로드 ID는 지원되는 인증 방법입니다.
작업 3: 고유 수신 기능을 사용으로 설정하기 위해 수신 리소스 배치
이 작업에서 OCI 고유 수신 컨트롤러를 사용하여 수신 기능을 사용으로 설정하는 데 필요한 Kubernetes 리소스를 생성합니다. 여기에는 IngressClassParameters
, IngressClass
및 실제 Ingress
객체가 포함됩니다.
-
각 리소스의 목적을 검토합니다.
- IngressClassParameters: 구획 OCID, 서브넷 및 대역폭과 같은 OCI 관련 구성을 지정합니다.
- IngressClass: Kubernetes 수신 기능을 OCI의 수신 컨트롤러에 연결합니다.
- Ingress: 트래픽 경로 지정 방법을 정의합니다.
-
YAML에서 자리 표시자 값을 바꿉니다.
<your compartment ocid>
를 실제 컴파트먼트 OCID로 바꿉니다.<your load balancer subnet ocid>
를 로드 밸런서 서브넷의 OCID로 바꿉니다.
-
YAML 매니페스트를 적용합니다. 다음 YAML 코드를 파일에 저장합니다(예:
native-ingress.yaml
).apiVersion: apps/v1 kind: Deployment metadata: name: test-web-app namespace: default spec: replicas: 2 selector: matchLabels: app: test-web template: metadata: labels: app: test-web spec: containers: - name: nginx image: nginx:latest ports: - containerPort: 80 readinessProbe: httpGet: path: / port: 80 initialDelaySeconds: 3 periodSeconds: 5 resources: requests: cpu: "100m" memory: "128Mi" limits: cpu: "500m" memory: "256Mi" apiVersion: v1 kind: Service metadata: name: test-web-service namespace: default spec: selector: app: test-web ports: - protocol: TCP port: 80 targetPort: 80 apiVersion: ingress.oraclecloud.com/v1beta1 kind: IngressClassParameters metadata: name: native-ic-params namespace: native-ingress-controller-system spec: compartmentId: "ocid1.compartment.oc1..aaaaaaaa2eimxxxxxxxxxxz4lkcety52hfdg6wdoff6744yn4hrshofla" subnetId: "ocid1.subnet.oc1.iad.aaaaaaaaa72ie4xxxxxxxxxrxxrly6nmkb77qxt6mi2t5pvrdhge32q" loadBalancerName: "test-web-ingress" isPrivate: false maxBandwidthMbps: 400 minBandwidthMbps: 100 apiVersion: networking.k8s.io/v1 kind: IngressClass metadata: name: native-ic-ingress-class annotations: ingressclass.kubernetes.io/is-default-class: "true" spec: controller: oci.oraclecloud.com/native-ingress-controller parameters: apiGroup: ingress.oraclecloud.com kind: IngressClassParameters name: native-ic-params scope: Namespace namespace: native-ingress-controller-system apiVersion: networking.k8s.io/v1 kind: Ingress metadata: name: test-web-ingress-quickstart namespace: default annotations: oci.oraclecloud.com/load-balancer-type: "lb" oci.oraclecloud.com/healthcheck-protocol: "HTTP" oci.oraclecloud.com/healthcheck-port: "80" oci.oraclecloud.com/healthcheck-path: "/" oci.oraclecloud.com/healthcheck-return-code: "200" spec: ingressClassName: native-ic-ingress-class rules: - host: test.example.com http: paths: - path: / pathType: Prefix backend: service: name: test-web-service port: number: 80 - http: paths: - path: / pathType: Prefix backend: service: name: test-web-service port: number: 80
-
다음 명령을 실행하여 매니페스트를 적용합니다.
kubectl apply -f native-ingress.yaml
-
리소스 만들기를 확인합니다.
kubectl get ingressclassparameters kubectl get ingressclass kubectl get ingress
작업 4: OCI 고유 수신 컨트롤러 로드 밸런서 테스트
주: OCI 로드 밸런서 IP 주소를 테스트하기 전에 필요한 포트(예:
80
및/또는443
)가 VCN의 보안 목록 및/또는 네트워크 보안 그룹(NSG)에 열려 있는지 확인하십시오.
OCI 고유 수신 컨트롤러가 올바르게 작동하는지 확인하려면 다음 단계를 수행하십시오.
-
kubectl
를 사용하여 수신 리소스의 IP 주소를 검색합니다.kubectl get ingress
-
출력에 표시된 IP 주소를 복사합니다.
-
웹 브라우저를 열고 주소 표시줄에 IP 주소를 붙여 넣습니다.
-
설정이 올바른 경우 배치된 서비스의 기본 응답이 표시됩니다.
탐색 메뉴로 이동하여 OCI 로드 밸런서가 OCI 콘솔에 제대로 생성되었는지 확인하고, 네트워킹을 선택하고, 로드 밸런서를 누를 수도 있습니다.
다음 단계
이 자습서에서는 가상 노드를 사용하여 OKE에서 고유 수신 컨트롤러를 성공적으로 구성했습니다. 이 설정을 사용하면 OCI 로드 밸런서 서비스로 수신 트래픽을 관리하는 동시에 서버리스 Kubernetes 환경의 확장성과 단순성을 활용할 수 있습니다. 이제 간소화된 트래픽 관리와 최소한의 인프라 오버헤드로 운영급 워크로드를 배포할 준비가 되었습니다.
관련 링크
승인
- 작성자 – JP Santana(Master Cloud Architect)
추가 학습 자원
docs.oracle.com/learn에서 다른 랩을 탐색하거나 Oracle Learning YouTube 채널에서 더 많은 무료 학습 콘텐츠에 액세스하세요. 또한 education.oracle.com/learning-explorer를 방문하여 Oracle Learning Explorer가 되십시오.
제품 설명서는 Oracle Help Center를 참조하십시오.
Set Up the OCI Native Ingress Controller on OCI Kubernetes Engine with Virtual Nodes
G34288-03
Copyright ©2025, Oracle and/or its affiliates.