에 사용자 지정 Istio 게이트웨이 배포 Helm

Istio-관리되는 앱 트래픽에 대한 수신 및 송신 게이트웨이를 정의하는 리소스를 편집하여 게이트웨이를 사용자 지정합니다.

Istio 애드온 버전 1.24 이후의 경우 Helm 로 이동함에 따라 IstioOperator 사용자 지정 리소스는 더 이상 사용되지 않습니다.

Helm 설정

사용자 지정 게이트웨이 배포 및 관리를 시작하기 전에 Helm 3.18.4 또는 그 이전 버전을 설정하세요.

  1. Helm 3.18.4 또는 이전 버전을 설치합니다.

    curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3
    chmod 700 get_helm.sh
    helm_version_pin="v3.18.4"
    DESIRED_VERSION="${helm_version_pin}" ./get_helm.sh
    which helm
    helm version
    rm get_helm.sh
    
  2. Istio 의 Helm 리포지토리를 추가합니다.

    helm repo add istio https://istio-release.storage.googleapis.com/charts
    
  3. helm repo update 명령을 실행하십시오.

    helm repo update
    

기존 기본 게이트웨이 수정

이 애드온은 사용자 지정 가능한 istio-ingressgateway 과 사용자 지정 가능한 istio-egressgateway 을 배포합니다. Helm 차트에 대해 게이트웨이 ConfigMaps 를 사용자 지정하려면 컨트롤 플레인에서와 같이 키-값 쌍을 추가하는 대신 value.yaml 키에서 여러 줄 문자열을 편집합니다.

이러한 value.yaml 파일은 ibm-operators 네임스페이스의 managed-istio-ingressgateway-valuesmanaged-istio-egressgateway-values ConfigMaps 에서 여러 줄 문자열로 찾을 수 있습니다.

apiVersion: v1
kind: ConfigMap
metadata:
  labels:
    addonmanager.kubernetes.io/mode: EnsureExists
  name: managed-istio-egressgateway-values
  namespace: ibm-operators
data:
  values.yaml: |
 ...
      resources:
        requests:
          cpu: 100m
          memory: 128Mi
        limits:
          cpu: 2000m
          memory: 1024Mi

istio-ingressgatewayistio-egressgateway value.yaml 콘텐츠를 편집하려면

  1. 클러스터를 작성합니다.

  2. 관리형 Istio 애드온 설치 1.24 또는 그 이후.

    ibmcloud ks cluster addon enable istio -c $CLUSTERID --version 1.24
    
  3. 클러스터의 kubeconfig 를 가져옵니다.

    ibmcloud ks cluster config -c $CLUSTERID
    
  4. 인그레스 및 익스그레스 게이트웨이에 대한 value.yaml 콘텐츠가 있는 Istio 게이트웨이 ConfigMaps 두 개를 찾습니다.

    kubectl get cm -n ibm-operators
    

    출력:

    NAME                                        DATA   AGE
    istio-ca-root-cert                          1      12m
    kube-root-ca.crt                            1      24h
    managed-istio-base-control-plane-values     2      13m
    managed-istio-custom                        1      13m
    managed-istio-egressgateway-values          2      13m
    managed-istio-ingressgateway-values         2      13m
    managed-istio-istiod-control-plane-values   2      13m
    
  5. 게이트웨이의 values.yaml 을 파일로 출력합니다.

    kubectl get cm -n ibm-operators  managed-istio-ingressgateway-values -o json | jq -r .data.\"values.yaml\" > gateway-values.yaml; open gateway-values.yaml
    

    출력:

    # "_internal_defaults_do_not_set" is a workaround for Helm limitations. Users should NOT set "._internal_defaults_do_not_set" explicitly, but rather directly set the fields internally.
    # For instance, instead of `--set _internal_defaults_do_not_set.foo=bar``, just set `--set foo=bar`.
    _internal_defaults_do_not_set:
    # Name allows overriding the release name. Generally this should not be set
    name: ""
    serviceAccount:
      # If set, a service account will be created. Otherwise, the default is used
      create: true
      # Annotations to add to the service account
      annotations: {}
      # The name of the service account to use.
      # If not set, the release name is used
      name: "istio-ingressgateway-service-account"
    podAnnotations:
        prometheus.io/port: "15020"
        prometheus.io/scrape: "true"
        prometheus.io/path: "/stats/prometheus"
        inject.istio.io/templates: "gateway"
        sidecar.istio.io/inject: "true"
    service:
        # Egress gateways do not need an external LoadBalancer IP so they set "service.type: ClusterIP".
        # Type of service. Set to "None" to disable the service entirely
        type: LoadBalancer
        ports:
        - name: http2
        port: 80
        protocol: TCP
        targetPort: 8080
        - name: https
        port: 443
        protocol: TCP
        targetPort: 8443
        loadBalancerIP: ""
        loadBalancerSourceRanges: []
        externalTrafficPolicy: ""
        externalIPs: []
        ipFamilyPolicy: ""
        ipFamilies: []
        ## Whether to automatically allocate NodePorts (only for LoadBalancers).
        # allocateLoadBalancerNodePorts: false
    resources:
        requests:
        cpu: 100m
        memory: 128Mi
        limits:
        cpu: 2000m
        memory: 1024Mi
    autoscaling:
        enabled: true
        minReplicas: 2
        maxReplicas: 5
        targetCPUUtilizationPercentage: 80
        targetMemoryUtilizationPercentage: {}
        autoscaleBehavior: {}
    tolerations:
    - key: dedicated
        value: edge
    topologySpreadConstraints: []
    affinity:
        podAntiAffinity:
        preferredDuringSchedulingIgnoredDuringExecution:
        - podAffinityTerm:
            labelSelector:
                matchExpressions:
                - key: app
                operator: In
                values:
                - istio-ingressgateway
            topologyKey: kubernetes.io/hostname
            weight: 100
        nodeAffinity:
        preferredDuringSchedulingIgnoredDuringExecution:
        - preference:
            matchExpressions:
            - key: dedicated
                operator: In
                values:
                - edge
            weight: 100
    
  6. 이러한 게이트웨이를 포함한 데이터 플레인을 관리할 수 있습니다. 자동 패치 업데이트, 기본 설정 파드 안티-선호도, 에지 노드에 대한 허용 및 기본 설정이 포함된 기본 구성으로 시작하세요. 사용자 지정에 대한 책임은 회원님에게 있습니다. 컨트롤 플레인 value.yaml 파일과 달리 value.yaml 파일은 ConfigMaps 에서 편집할 수 있습니다.

    다음은 기본 인그레스 구성을 사용하여 istio/게이트웨이 차트에서 생성된 리소스입니다. 이그레스에도 동일한 명명 규칙이 적용됩니다.

    • PodDisruptionBudget, Service, Deployment, HorizontalPodAutoscaleristio-system 네임스페이스의 istio-ingressgateway 에 이름이 지정됩니다. 이러한 이름은 values.yamlname 필드에서 설정합니다.
    • ServiceAccount, Role, Rolebindingistio-system 네임스페이스의 istio-ingressgateway-service-account 에서 이름을 지정합니다. 이러한 이름은 values.yamlserviceAccount.name 필드에서 설정합니다.
  7. 먼저 저장된 gateway-values.yaml 에서 변경 사항을 테스트하여 변경 사항을 테스트합니다. 그런 다음 Helm 드라이런을 사용하여 매니페스트 변경 사항을 확인합니다.

    예:

    아래는 변경 사항의 예입니다. 변경 사항만 표시되며 나머지 values.yaml 콘텐츠는 변경되지 않습니다. 이러한 변경 사항의 예는 다음과 같습니다:

    • 리소스 이름 변경하기

    • 리소스 요청/한도 조정

    • 자동 스케일링 증가

    • 노드 선호도 추가하기

      • 노드 선호도를 사용하여 영역 선호도를 만들려는 경우 topologySpreadConstraints 대신 사용할 수도 있습니다.

    a. 필요에 따라 values.yaml 콘텐츠를 수정합니다.

    name: "custom-gateway"
    serviceAccount:
        name: "custom-ingressgateway-service-account"
    resources:
        requests:
            cpu: 100m
            memory: 128Mi
        limits:
            cpu: 2500m
            memory: 1024Mi
    autoscaling:
        enabled: true
        minReplicas: 3
        maxReplicas: 7
        targetCPUUtilizationPercentage: 80
        targetMemoryUtilizationPercentage: {}
        autoscaleBehavior: {}            
    affinity:
        nodeAffinity:
        requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
            - matchExpressions:
            - key: ibm-cloud.kubernetes.io/zone
                operator: In
                values:
                - "dal10"
    

    b. --dry-run 옵션과 함께 Helm 을 사용하여 구문과 구성이 의도와 일치하는지 확인할 수 있도록 매니페스트를 출력합니다.

    기본 게이트웨이인 istio-ingressgateway 또는 istio-egressgateway 중 하나를 대상으로 하는 경우에는 --dry-run 옵션과 함께 이 명령을 실행하세요. --dry-run 옵션 없이 이 명령을 실행하지 마세요.

    helm upgrade istio-ingressgateway istio/gateway --version 1.29.0 --install -n istio-system -f gateway-values.yaml --dry-run
    
  8. 변경 사항이 만족스럽다면 kubectl edit 을 사용하여 게이트웨이의 values.yaml 을 ConfigMap 에서 편집하세요.

    a. gateway-values.yaml 을 열고 values.yaml 파일의 사본을 4칸 들여쓰기합니다.

    b. kubectl edit 명령을 실행하십시오.

    kubectl edit cm -n ibm-operators managed-istio-ingressgateway-values
    

    c. 이전 values.yaml 의 줄을 삭제합니다.

    d. values.yaml 키를 여러 줄 문자열로 시작합니다. 예: |

    e. values.yaml 키 아래 줄에 4칸 들여쓰기된 values.yaml 파일을 복사합니다.

    예:

    data:
      values.yaml: |
        <Copy values.yaml here.>
      values.yaml.helm.result: |
        <Don't remove these previous Helm logs.>
    
  9. 약 10분 후 해당 ConfigMap 의 values.yaml.helm.result 필드에 업데이트된 Helm 로그가 있는지 확인하고 필요에 따라 디버그합니다.

    kubectl get cm -n ibm-operators managed-istio-ingressgateway-values -o json | jq -r .data.\"values.yaml.helm.result\"
    

    출력 예:

    GMT HELM_SUCCESS: Release "istio-ingressgateway" does not exist. Installing it now.
    NAME: istio-ingressgateway
    LAST DEPLOYED: Fri Sep 5 16:46:30 2025
    NAMESPACE: istio-system
    STATUS: deployed REVISION: 1
    TEST SUITE: None
    NOTES: "istio-ingressgateway" successfully installed!
    To learn more about the release, try:
    $ helm status istio-ingressgateway -n istio-system
    $ helm get all istio-ingressgateway -n istio-system
    Next steps:
    * Deploy an HTTP Gateway: https://istio.io/latest/docs/tasks/traffic-management/ingress/ingress-control/
    * Deploy an HTTPS Gateway: https://istio.io/latest/docs/tasks/traffic-management/ingress/secure-ingress/
    
  10. 구성 옵션을 확인합니다.

    a. 값을 표시합니다.

    helm show values istio/gateway --version 1.29.5
    

    b. 표시할 수 있는 가능한 키를 검토합니다.

        name: # The gateway deployment's and service's name
        serviceAccount:
          name: # The service account, role, and rolebinding name
        resources: # Resource requests and limits
        autoscaling: # Min and Max gateway pods
        tolerations: # Tolerate your taints
        topologySpreadConstraints: # An alternative to node affinities
        affinity: # Where you can specify node affinities
    

추가 게이트웨이 만들기

하나의 게이트웨이가 배포된 기본 게이트웨이를 사용자 지정한 후 추가 게이트웨이를 구성할 수 있습니다. Helm 으로 리소스 매니페스트를 생성한 다음 Helm 으로 적용하거나 YAML 리소스에 대한 CI/CD 파이프라인으로 적용하세요.

  1. helm show values 명령을 실행하십시오.

    helm show values "istio/gateway" --version "1.29.0"
    
  2. 게이트웨이용 values.yaml 파일을 만듭니다. 다음 예는 Istio 1.24.6 에서 사용할 수 있는 옵션을 기반으로 Istio ingressgateway 에 대한 미니멀리스트 values.yaml 입니다.

    rbac:
    # If enabled, roles will be created to enable accessing certificates from Gateways. This is not needed
    # when using http://gateway-api.org/.
      enabled: true
    serviceAccount:
    # If set, a service account will be created. Otherwise, the default is used
      create: true
    # Define the security context for the pod.
    # If unset, this will be automatically set to the minimum privileges required to bind to port 80 and 443.
    # On Kubernetes 1.22+, this only requires the `net.ipv4.ip_unprivileged_port_start` sysctl.
    securityContext:
      runAsGroup: 1337
      runAsNonRoot: true
      runAsUser: 1337
      seccompProfile:
        type: RuntimeDefault
    service:
    # Egress gateways do not need an external LoadBalancer IP so they set "service.type: ClusterIP".
    # Type of service. Set to "None" to disable the service entirely
      type: LoadBalancer
      ports:
      - name: http2
        port: 80
        protocol: TCP
        targetPort: 8080
      - name: https
        port: 443
        protocol: TCP
        targetPort: 8443
    autoscaling:
      enabled: true
      minReplicas: 2
      maxReplicas: 5
    # Deployment Update strategy
    strategy:
      rollingUpdate:
        maxSurge: 100%
        maxUnavailable: 25%
    tolerations:
    - key: dedicated
      value: edge
    affinity:
      podAntiAffinity:
        preferredDuringSchedulingIgnoredDuringExecution:
        - podAffinityTerm:
            labelSelector:
            matchExpressions:
            - key: app
              operator: In
              values:
              - istio-ingressgateway
            topologyKey: kubernetes.io/hostname
        weight: 100
      nodeAffinity:
        preferredDuringSchedulingIgnoredDuringExecution:
        - preference:
            matchExpressions:
            - key: dedicated
              operator: In
              values:
              - edge
        weight: 100
    podDisruptionBudget:
      minAvailable: 1
    # Sets the per-pod terminationGracePeriodSeconds setting.
    terminationGracePeriodSeconds: 30
    # Configure this to a higher priority class in order to make sure that your Istio gateway pods
    # will not be killed because of low priority class.
    # Refer to https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/#priorityclass
    # for more detail.
    priorityClassName: ibm-app-cluster-critical
    

    또는 기본 게이트웨이의 values.yaml 을 시작점으로 사용할 수도 있습니다.

    kubectl get cm -n ibm-operators  managed-istio-ingressgateway-values -o json | jq -r .data.\"values.yaml\"
    
  3. Helm 릴리스 이름과 네임스페이스를 선택할 때는 다음 조건을 고려하세요.

    • Helm 릴리스 이름 및 네임스페이스는 게이트웨이의 배포 이름 및 네임스페이스와 일치해야 합니다.
    • Istio 관리형 애드온은 이러한 릴리스 이름을 사용하므로 istio-base, istiod, istio-ingressgateway, istio-egressgateway 을 피하세요.
    • 추가 게이트웨이 중 다른 게이트웨이의 릴리스 이름을 사용하지 마세요.
  4. 드라이런을 수행하여 게이트웨이에 대한 YAML 리소스의 매니페스트를 확인합니다. Istio 1.25.4 이전 버전의 경우 Helm v3.18.4 을 사용해야 합니다.

    helm upgrade --dry-run RELEASE_NAME istio/gateway --version ISTIO_VERSION --install -n NAMESPACE -f values.yaml
    
  5. 다음 방법 중 하나를 사용하여 해당 리소스를 적용하세요:

    • --dry-run 옵션 없이 Helm upgrade 명령을 사용합니다.
    • 클러스터의 CI/CD 사용 사례에 따라 YAML 리소스의 매니페스트를 가져와서 다른 Istio 데이터 플레인 YAML과 마찬가지로 적용하세요.

사용자 지정 예제

이그레스 게이트웨이

송신 게이트웨이에는 LoadBalancer IP가 필요하지 않으므로 서비스 유형이 ClusterIP 여야 합니다.

service:
  type: ClusterIP

리소스 요청 및 한계

필드를 지정하지 않으면 Istio 기본값이 사용됩니다.

resources:
  requests:
    cpu: 100m
    memory: 128Mi
  limits:
    cpu: 2000m
    memory: 1024Mi

자동 스케일링

autoscaling.enabled=true 이 설정되어 있으면 수평 포드 자동 스케일러의 최소 및 최대 리플리카를 설정할 수 있습니다.

autoscaling:
  enabled: true
  minReplicas: 2
  maxReplicas: 5

유예 종료

유예 종료는 게이트웨이가 종료되는 동안 기존 연결을 처리할 수 있는 추가 시간을 제공합니다. 이 기능은 TERMINATION_DRAIN_DURATION 환경 변수를 지정하는 것을 대체합니다. 필요한 경우 이 설정의 값을 늘릴 수 있습니다.

# Sets the per-pod terminationGracePeriodSeconds setting.
terminationGracePeriodSeconds: 30

구역 유사성

토폴로지 스프레드 제약 조건은 topologySpreadConstraints 필드로 설정할 수 있습니다. 사용 사례에 따라 이 솔루션은 이전 영역 선호도 솔루션보다 더 나은 대안이 될 수 있습니다.

topologySpreadConstraints: []

영역 선호도는 서비스 어노테이션과 노드 선호도를 추가하여 지정할 수 있습니다.

service:
  annotations:
    service.kubernetes.io/ibm-load-balancer-cloud-provider-zone: "dal10"
affinity:
  nodeAffinity:
    requiredDuringSchedulingIgnoredDuringExecution:
      nodeSelectorTerms:
      - matchExpressions:
        - key: ibm-cloud.kubernetes.io/zone
          operator: In
          values:
          - "dal10"

loadBalancerIP 를 지정할 수 있습니다.

Service.spec.loadBalancerIP Kubernetes 에서 버전 1.24 으로 대체 되었습니다. 이 옵션은 Kubernetes 가 필드 제거를 완료하면 더 이상 작동하지 않습니다. 클러스터의 다른 곳에서 이미 사용 중인 IP를 지정하면 해당 서비스의 외부 IP가 보류 중 상태로 유지됩니다.

service:
  type: LoadBalancer
  loadBalancerIP: ""

Istio 버전 고정하기

Istio 게이트웨이에는 image: auto 이 있으므로 포드 생성 시 예상되는 사이드카 proxyv2 이미지를 가져옵니다. 이 설정은 파드 어노테이션으로 재정의할 수 있습니다. 이 오버라이드를 사용하여 이미지 태그를 고정하는 경우 각 Istio 패치 및 마이너 업데이트에서 해당 핀을 업데이트할 책임은 회원님에게 있습니다.

podAnnotations:
  "sidecar.istio.io/proxyImage": "icr.io/ext/istio/proxyv2:1.24.0"

게이트웨이 비활성화하기

서비스 유형을 None 으로 변경하여 서비스를 비활성화할 수 있습니다. 게이트웨이 배포를 축소할 수도 있습니다. Istio 1.24 및 1.25 에서 replicaCount 에 최소 1 가 있는 문제가 있습니다. Istio 1.26.0 이후 버전에서는 replicaCount0 으로 설정할 수 있습니다. ingressgateway 의 서비스 유형이 LoadBalancer 에서 None 로 변경되면 해당 LoadBalancer IP는 결국 양도됩니다. 서비스 유형이 LoadBalancer 로 다시 변경된 경우 새 IP가 할당됩니다.

replicaCount: 0
service:
  type: None
autoscaling:
  enabled: false

게이트웨이 배포 제거

istio-ingressgateway-public-2, istio-ingressgateway-public-3 을 사용 설정했거나 제거하려는 다른 사용자 지정 게이트웨이가 있는 경우 이러한 리소스를 찾아 삭제하세요.

  1. 게이트웨이를 찾습니다. 게이트웨이가 Helm 와 함께 설치된 경우 helm get all RELEASE_NAME -n NAMESPACE 을 바로 가기로 사용할 수 있습니다.

    kubectl get PodDisruptionBudget -n NAMESPACE GATEWAY_NAME --ignore-not-found
    kubectl get Service -n NAMESPACE GATEWAY_NAME --ignore-not-found
    kubectl get Deployment -n NAMESPACE GATEWAY_NAME --ignore-not-found
    kubectl get HorizontalPodAutoscaler -n NAMESPACE GATEWAY_NAME --ignore-not-found
    kubectl get ServiceAccount -n NAMESPACE --ignore-not-found | grep GATEWAY_NAME
    kubectl get Role -n NAMESPACE --ignore-not-found | grep GATEWAY_NAME
    kubectl get RoleBinding -n NAMESPACE --ignore-not-found | grep GATEWAY_NAME
    
  2. 게이트웨이를 제거합니다. 게이트웨이가 Helm 와 함께 설치된 경우 helm uninstall RELEASE_NAME -n NAMESPACE 을 바로 가기로 사용할 수 있습니다.

    istio-system 네임스페이스에서 istio-ingressgateway-public-2 제거의 예입니다:

    kubectl delete PodDisruptionBudget -n istio-system istio-ingressgateway-public-2 --ignore-not-found
    kubectl delete Service -n istio-system istio-ingressgateway-public-2 --ignore-not-found
    kubectl delete Deployment -n istio-system istio-ingressgateway-public-2 --ignore-not-found
    kubectl delete HorizontalPodAutoscaler -n istio-system istio-ingressgateway-public-2 --ignore-not-found
    kubectl delete ServiceAccount -n istio-system istio-ingressgateway-public-2-service-account --ignore-not-found
    kubectl delete Role -n istio-system istio-ingressgateway-public-2-sds --ignore-not-found
    kubectl delete RoleBinding -n istio-system istio-ingressgateway-public-2-sds --ignore-not-found
    

    출력 예:

    NAME                            MIN AVAILABLE   MAX UNAVAILABLE   ALLOWED DISRUPTIONS   AGE
    istio-ingressgateway-public-2   N/A             N/A               0                     2m33s
    NAME                            TYPE           CLUSTER-IP     EXTERNAL-IP     PORT(S)                      AGE
    istio-ingressgateway-public-2   LoadBalancer   172.21.227.3   169.46.62.156   80:32705/TCP,443:31154/TCP   2m32s
    NAME                            READY   UP-TO-DATE   AVAILABLE   AGE
    istio-ingressgateway-public-2   2/2     2            2           2m33s
    NAME                            REFERENCE                                  TARGETS              MINPODS   MAXPODS   REPLICAS   AGE
    istio-ingressgateway-public-2   Deployment/istio-ingressgateway-public-2   cpu: <unknown>/80%   2         5         2          2m34s
    istio-ingressgateway-public-2-service-account   0         2m34s
    istio-ingressgateway-public-2-sds   2025-09-09T17:20:46Z
    istio-ingressgateway-public-2-sds   Role/istio-ingressgateway-public-2-sds   2m34s