Ubuntu microk8s와 fluentd 설치하기

fluentd는 데이터 인제스쳔(Data ingestion) 레이어를 구성하는데 매우 유용한 도구입니다.

fluentd를 microk8s로 구성하는 방법입니다.

우분투(Ubuntu)에 microk8s 설치하기

microk8s는 snap으로 설치해야 합니다.

그래서 snap이 없는 우분투 구버전은 먼저 snap부터 설치합니다. 최근 우분투에는 snap이 기본 설치되어 있습니다.

snap설치

sudo apt-get install snapd

microk8s 설치

sudo snap install microk8s –classic

helm3 활성화

계정을 root로 전환합니다. 일반 사용자로 해도 되지만 몇 가지 선행작업이 있어서 조금 귀찮습니다. 여기서는 그냥 root로 하겠습니다.

sudo su –
microk8s enable helm3
microk8s helm3 init

init을 하면 이런 에러가 발생할수도 있습니다.

Adding stable repo with URL: https://kubernetes-charts.storage.googleapis.com
Error: error initializing: Looks like “https://kubernetes-charts.storage.googleapis.com” is not a valid chart repository or cannot be reached: Failed to fetch https://kubernetes-charts.storage.googleapis.com/index.yaml : 403 Forbidden

이럴 때는 다음과 같이 해결합니다.

해결법

Use the –stable-repo-url argument to specify the new repository:

helm init –stable-repo-url https://charts.helm.sh/stable –service-account tiller
Use the –skip-refresh argument and replace the stable repo:

해결법 실행명령

helm init –client-only –skip-refresh
helm repo rm stable
helm repo add stable https://charts.helm.sh/stable
Upgrade helm to 2.17.0 or later.

이제 fluentd의 helm 레파지토리를 추가합니다.

fluentd helm 레파지토리 추가

microk8s helm3 repo add fluent https://fluent.github.io/helm-charts
microk8s helm3 repo update

fluentd 설치

fluentd를 설치합니다.

microk8s helm3 install fluentd fluent/fluentd

fleuntd의 기본 values를 봅니다.

microk8s helm3 show values fluent/fluentd

fluend가 실행되어 있는지 서비스 확인

root@pr-01:~# microk8s kubectl get services
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
Kubernetes ClusterIP 10.152.183.1 443/TCP 3h16m
fluentd ClusterIP 10.152.183.249 24231/TCP 26m

Author: 떰학

답글 남기기