Istio 를 설치하고 Pod 를 생성했는데, 다음과 같이 오류가 발생했다.
| 
					 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19  | 
						]$ kubectl describe pod/employee-producer-866cfb8cf8-s2qk4 Init Containers:   istio-init:     Container ID:  containerd://eb85c7971088c72e64b432a38f419a392182a44735281993c0c2b44460acd8fc     Image:         docker.io/istio/proxyv2:1.13.1     Image ID:      docker.io/istio/proxyv2@sha256:099ee79c150829471270a14520506b83117bb7448cc80ba215617785237c1eb0     Port:          <none>     Host Port:     <none>     Args:       istio-iptables ....     State:          Waiting       Reason:       CrashLoopBackOff     Last State:     Terminated       Reason:       Error       Exit Code:    255       Started:      Mon, 28 Feb 2022 13:07:52 +0900       Finished:     Mon, 28 Feb 2022 13:07:52 +0900 ...  | 
					
istio-init 컨테이너가 오류가 발생한 것을 알 수 있다. Pod 안에 컨테이너가 여러개일 경우에 컨테이너 로그를 봐야하는데 다음과 같이 Pod 에 속한 컨테이너 로그를 볼수 있다.
| 
					 1 2 3 4 5 6 7 8  | 
						]$ kubectl logs employee-producer-866cfb8cf8-spnqs -c istio-init COMMIT 2022-02-28T04:16:59.895565Z     info    Running command: iptables-restore --noflush /tmp/iptables-rules-1646021819895421411.txt3256082129 2022-02-28T04:16:59.896995Z     error   Command error output: xtables parameter problem: iptables-restore: unable to initialize table 'nat' Error occurred at line: 1 Try `iptables-restore -h' or 'iptables-restore --help' for more information. 2022-02-28T04:16:59.897030Z     error   Failed to execute: iptables-restore --noflush /tmp/iptables-rules-1646021819895421411.txt3256082129, exit status 2  | 
					
이 문제는 istio cni 컴포넌트를 함께 설치해주면 된다. 보통 Istio 를 설치할때에 Profile 만 지정하는데, demo 프로파일에 경우에 CNI 를 설치하지 않는다. 다음과 같이 재설치를 해준다.
| 
					 1 2  | 
						]$ istioctl x uninstall --purge # 삭제 ]$ istioctl install --set profile=demo --set components.cni.enabled=true -y  | 
					
이렇게 CNI 를 활성화해서 재설치를 하면 문제없이 작동 된다.
문제점
여기서 한가지 문제가 있다. CNI 는 보통 Flannel, Calico 등을 이용하는데, 이것과 별도로 Istio-cni 를 설치하게 되는 것이다. 이왕이면 기존에 있는 것을 활용하는 방안을 고려해야 한다.
Calico 의 경우에 이에 대해서 기술하고 있는 문서가 있으니 참고해서 한번 해볼만 하다.