Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
minLevel1
maxLevel6
outlinefalse
typelist
printablefalse

Github

아래 예제들에 대한 전체 helm chart는 https://github.com/snetsystems/K8s-Objects/tree/master/helm-charts 에서 볼 수 있다.

Walkthrough overview

Code Block
languagenone
[Telegraf] ---8086--> [InfluxDB] <---8086--- [CH Srv] <---443--- [External]
                          /\                    /\
                       8086|                     |
                           |9094                 |2379
                           \/                   \/
                      [Kapacitor]          [ETCD Cluster]

...

필자 생각에는 참고 삼아 배포하거나 show values 등의 명령을 사용하여 리서치할 용도가 아니라, 본인의 K8s에 배포를 목적으로 한다면, 위 1번이 버전을 따로 관리하기에도 편하고 charts 구조 및 내용을 탐색하기에도 편한 듯 하다.
캐바캐이니, 편한대로 하여도 좋으나, 여기서는 1번 방식으로 배포하도록 하겠다.

Values override

influxdata/influxdb 내부의 values를 상황에 맞게 override 하자.

...

Code Block
languagebash
# helm install -n helm-test -g -f etcd_override.yaml ./etcd
NAME: etcd-1688819715
LAST DEPLOYED: Sat Jul  8 21:35:15 2023
NAMESPACE: helm-test
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
CHART NAME: etcd
CHART VERSION: 9.0.2
APP VERSION: 3.5.9

** Please be patient while the chart is being deployed **

etcd can be accessed via port 2379 on the following DNS name from within your cluster:

    etcd-1688819715.helm-test.svc.cluster.local

To create a pod that you can use as a etcd client run the following command:

    kubectl run etcd-1688819715-client --restart='Never' --image docker.io/bitnami/etcd:3.5.9-debian-11-r18 --env ROOT_PASSWORD=$(kubectl get secret --namespace helm-test etcd-1688819715 -o jsonpath="{.data.etcd-root-password}" | base64 -d) --env ETCDCTL_ENDPOINTS="etcd-1688819715.helm-test.svc.cluster.local:2379" --namespace helm-test --command -- sleep infinity

Then, you can set/get a key using the commands below:

    kubectl exec --namespace helm-test -it etcd-1688819715-client -- bash
    etcdctl --user root:$ROOT_PASSWORD put /message Hello
    etcdctl --user root:$ROOT_PASSWORD get /message

To connect to your etcd server from outside the cluster execute the following commands:

    kubectl port-forward --namespace helm-test svc/etcd-1688819715 2379:2379 &
    echo "etcd URL: http://127.0.0.1:2379"

 * As rbac is enabled you should add the flag `--user root:$ETCD_ROOT_PASSWORD` to the etcdctl commands. Use the command below to export the password:

    export ETCD_ROOT_PASSWORD=$(kubectl get secret --namespace helm-test etcd-1688819715 -o jsonpath="{.data.etcd-root-password}" | base64 -d)

Deploy CloudHub

위의 예제들과 기본적 개념은 유사하므로, https://github.com/snetsystems/K8s-Objects/tree/master/helm-charts 를 참고하도록 한다.