[Resilience] DestinationRule mTLS 설정

y001·2025년 4월 27일

Istio 실전 스터디

목록 보기
20/26
  • DestinationRule을 통해 서비스 간 통신에 mTLS를 적용해 본다.

1. PeerAuthentication 생성

peer-authentication-default.yaml 파일 생성:

apiVersion: security.istio.io/v1beta1
kind: PeerAuthentication
metadata:
  name: default
  namespace: istio-system
spec:
  mtls:
    mode: STRICT

적용:

kubectl apply -f peer-authentication-default.yaml

2. DestinationRule mTLS 설정

기존 DestinationRule 수정하여 TLS 강제 적용:

apiVersion: networking.istio.io/v1beta1
kind: DestinationRule
metadata:
  name: helloworld
spec:
  host: helloworld
  trafficPolicy:
    tls:
      mode: ISTIO_MUTUAL
  subsets:
  - name: v1
    labels:
      version: v1
  - name: v2
    labels:
      version: v2

적용:

kubectl apply -f destination-rule-helloworld-trafficpolicy.yaml

3. 통신 확인

서비스 간 호출이 정상적으로 진행되면, mTLS로 암호화된 통신이 적용된 것이다.

(추가로 Kiali에서 "mTLS" 뱃지를 통해 시각적으로 확인할 수 있다.)

0개의 댓글