Engineering/k8s

CNI(cilium) helm 재설치

망고v 2024. 5. 2. 17:19

kubernetes에 설치하는 자원들이 점점 많아지고, 자원 리소스를 고려한 적절한 배치를 위해 설정할 사항들이 많아진다. 전에 cilium을 helm을 통하지 않고, Cilium CLI로 설치했더니 최적화에 어려움이 많아졌다. 그래서 다른 서비스들과 동일하게 helm을 통해 재설치를 진행하기로 했다.

 

[참고] https://docs.cilium.io/en/stable/installation/k8s-install-helm/

 

Installation using Helm — Cilium 1.15.4 documentation

If you are running an ACK cluster, you should delete the ACK CNI. Cilium will manage ENIs instead of the ACK CNI, so any running DaemonSet from the list below has to be deleted to prevent conflicts. Note If you are using ACK with Flannel (DaemonSet kube-fl

docs.cilium.io

 

 

시행착오

Cilium CLI로 설치하긴 했으나, 실제 k8s의 helm list 상에는 cilium이 존재한다. (다만, repo가 없을 뿐) helm repo가 존재하지 않는 cilium에 대해 upgrade를 진행하려고 했으나, 아래 외 다양한 이슈(ex. chart 경로 필요)로 진행 불가. (cilium CLI가 해당 release를 upgrade하는거라 분명히 될 것 같긴한데, 일단 skip)

[ec2-user@ip-10-180-16-34 cilium]$ helm upgrade cilium cilium/cilium --version 1.15.1 --values ./values.yaml -n kube-system
Error: repo cilium not found

 

결국 아래와 같이 helm values를 추출하고 기존 release 제거 후, helm으로 재설치하기로 결정.

[ec2-user@ip-10-180-16-34 cilium]$ helm get values cilium -n kube-system > values.yaml

 

helm으로 재설치하기

helm 재설치하기로 결심의 과정까지가 복잡했을 뿐, 막상 helm을 통한 설치는 역시나 간단하다. 기존 chart 삭제 필요.

[ec2-user@ip-10-180-16-34 cilium]$ helm repo add cilium https://helm.cilium.io/
"cilium" has been added to your repositories

[ec2-user@ip-10-180-16-34 cilium]$ helm repo update
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "aws-ebs-csi-driver" chart repository
...Successfully got an update from the "elastic" chart repository
...Successfully got an update from the "cilium" chart repository
...Successfully got an update from the "grafana" chart repository
...Successfully got an update from the "prometheus-community" chart repository
Update Complete. ⎈Happy Helming!⎈

[ec2-user@ip-10-180-16-34 cilium]$ helm install cilium cilium/cilium --version 1.15.1 --values ./values.yaml --namespace kube-system
NAME: cilium
LAST DEPLOYED: Thu May  2 07:52:22 2024
NAMESPACE: kube-system
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
You have successfully installed Cilium with Hubble Relay and Hubble UI.

Your release version is 1.15.1.

For any further help, visit https://docs.cilium.io/en/v1.15/gettinghelp

 

기존 설치된 cilum과 동일 환경으로 맞추기 위해 사전에 추출한 values(아래 yaml 파일)를 을 helm install시 적용.

cluster:
  name: kubernetes
hubble:
  relay:
    enabled: true
    nodeSelector:
      role: monitoring
  ui:
    enabled: true
    nodeSelector:
      role: monitoring
operator:
  replicas: 1
  nodeSelector:
    role: monitoring
routingMode: tunnel
tunnelProtocol: vxlan

 

나중에 아래 링크 참고해서 grafana와 연동도 간단히 할 수 있을 것 같고, 이것도 추후 진행해보기로.

https://docs.cilium.io/en/stable/observability/grafana/#deploy-cilium-and-hubble-with-metrics-enabled

 

결론

전에 Cilium CLI로 간단하게 설치를 진행했었지만, 상세 설정(최적화)을 하기 위해서는 helm으로 설치하는게 정신 건강에 이로운 듯 하다. (그나저나 helm repo 없는 release는 대체 왜 upgrade가 되지 않았을까.. 여유있을 때 다시 시도해보기.)

'Engineering > k8s' 카테고리의 다른 글

kubernetes CSI 설치(aws EBS)  (0) 2024.03.19
Hubble UI(cilium) 설정하기  (0) 2024.03.11
kubernetes worker node 수동 추가  (0) 2024.03.08
kubernetes cluster 수동 설치(w/aws)  (0) 2024.03.08
Service mesh(istio) upgrade 하기  (0) 2024.01.23