[네떡스터디🔥kans] Service Mesh: Istio - ambient

CloudNet@ 가시다님이 진행하는 쿠버네티스 네트워크 스터디 KANS 3기 내용을 정리한 글입니다.

 

 

Ambient Mesh란 ?

기존의 sidecar방식의 메시는 sidecar를 설치하지 않은 파드의 경우 mesh로 넣을 수 없고, 파드마다 컨테이너를 추가해줘야했기 때문의 오버헤드가 컸습니다. Ambient Mesh에서는 모든 파드간 네트워크 통신은 Ztunnel이라는 경량화된 데이터 플레인 엔티티를 통해 처리됩니다. 이 Ztunnel은 각 노드에서 트래픽을 수집하고 제어하는 역할을 하며, 마이크로서비스 간의 통신을 간접적으로 처리합니다. 또한, 프록시 업그레이드나 배포 시의 오류 가능성도 줄어들게 됩니다.

 

직접 설치해보기

cilium 설정 변경하기

ambient mesh의 경우 istio-cni를 필요로 하는데 이번에는 cilium cni와 함께 사용하며 테스트를 해보기 위해 일부 cilium의 설정을 변경하겠습니다. chaining cni를 사용할 수 있도록 다음의 설정을 false로 변경합니다.  추가로 socketLB.hostNamespaceOnly도 true여야 했습니다. 이걸 몰라서.. 엄청 고생했는데 cilium과 istio를 같이 설치하기 위한 가이드는 아래의 링크에서 확인부탁드립니다. 

https://docs.cilium.io/en/latest/network/servicemesh/istio/

 

다음의 명령어 입력시 cilium이 재시작 되기 때문에 주의하세요

cilium config set cni-exclusive false
cilium config set bpf-lb-sock-hostns-only true

 

더보기
export KUBE_API_SERVER_IP=$( kubectl get nodes -l node-role.kubernetes.io/control-plane -o yaml | yq '.items[0].status.addresses[] | select(.type=="InternalIP").address' );
cilium install --version 1.16.2 \
    --set kubeProxyReplacement=true \
    --set gatewayAPI.enabled=false \
    --set hubble.enabled=true \
    --set hubble.relay.enabled=true \
    --set hubble.ui.enabled=true \
    --set l2announcements.enabled=true \
    --set k8sServiceHost=${KUBE_API_SERVER_IP} \
    --set k8sServicePort=6443 \
    --set externalIPs.enabled=true \
    --set cni.exclusive=false \
    --set socketLB.hostNamespaceOnly=true

 

istioctl을 이용하여 설치하기

istio에서 제공해주는 프로필 중 ambient 매시를 설정할 수 있는 프로필이있습니다. 이 설정을 사용하여 구성하게 되는 경우 cni도 istio의 cni로 설치 되게 됩니다.  사용하면서 테스트를 해보기 위해 ambient 프로필에 일부를 수정해서 설치해보도록 하겠습니다. 

apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
spec:
  components:
    base:
      enabled: true
    cni:
      enabled: true
    egressGateways:
    - enabled: false
      name: istio-egressgateway
    ingressGateways:
    - enabled: true
      name: istio-ingressgateway
    pilot:
      enabled: true
    ztunnel:
      enabled: true
  hub: docker.io/istio
  profile: ambient
  tag: 1.23.2
  values:
    defaultRevision: ""
    gateways:
      istio-egressgateway: {}
      istio-ingressgateway: {}
    global:
      configValidation: true
      istioNamespace: istio-system
    profile: ambient

 

이 파일을 이용하여 설치해보겠습니다. 

istioctl install -f ambient.yaml

 

다 설치가 되고 나면 istio-cni, ztunnel, istiod 그리고 ingressgateway가 설치된 것을 확인할 수 있습니다. 

ztunnel같은 경우 daemonsets로 구성되게 됩니다.