Helm Setup
root@ip-172-31-4-27:~/resource# curl https://raw.githubusercontent.com/helm/helm/master/scripts/get | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 7160 100 7160 0 0 17463 0 --:--:-- --:--:-- --:--:-- 17506
Downloading https://get.helm.sh/helm-v2.17.0-linux-amd64.tar.gz
Preparing to install helm and tiller into /usr/local/bin
helm installed into /usr/local/bin/helm
tiller installed into /usr/local/bin/tiller
Run 'helm init' to configure helm.
서비스어카운트 생성
#@ 틸러라는 이름의 서비스어카운트를 만든다
root@ip-172-31-4-27:~/resource# kubectl create sa --namespace kube-system tiller
serviceaccount/tiller created
clusterrolebinding 리소스 유형의 tiller-cluster-role 을 만들꺼다 --serviceaccount=kube-system:tiller
root@ip-172-31-4-27:~/resource# kubectl create clusterrolebinding tiller-cluster-role --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
clusterrolebinding.rbac.authorization.k8s.io/tiller-cluster-role created
틸러라는 서버가 올라간다.
root@ip-172-31-4-27:~/resource# helm init --service-account tiller
Creating /root/.helm
Creating /root/.helm/repository
Creating /root/.helm/repository/cache
Creating /root/.helm/repository/local
Creating /root/.helm/plugins
Creating /root/.helm/starters
Creating /root/.helm/cache/archive
Creating /root/.helm/repository/repositories.yaml
Adding stable repo with URL: https://charts.helm.sh/stable
Adding local repo with URL: http://127.0.0.1:8879/charts
$HELM_HOME has been configured at /root/.helm.
Tiller (the Helm server-side component) has been installed into your Kubernetes Cluster.
Please note: by default, Tiller is deployed with an insecure 'allow unauthenticated users' policy.
To prevent this, run `helm init` with the --tiller-tls-verify flag.
For more information on securing your installation see: https://v2.helm.sh/docs/securing_installation/
tiller-deploy namespace 확인한다
root@ip-172-31-4-27:~/resource# kubectl get po --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
kube-system tiller-deploy-7b56c8dfb7-tcp8l 1/1 Running 0 3m28s
정상적으로 tiller가 올라갔는지 확인한다.
root@ip-172-31-4-27:~/resource# kubectl -n kube-system logs tiller-deploy-7b56c8dfb7-tcp8l
[main] 2020/12/04 02:11:53 Starting Tiller v2.17.0 (tls=false)
[main] 2020/12/04 02:11:53 GRPC listening on :44134
[main] 2020/12/04 02:11:53 Probes listening on :44135
[main] 2020/12/04 02:11:53 Storage driver is ConfigMap
[main] 2020/12/04 02:11:53 Max history per release is 0
helm 설치 확인/업데이트
root@ip-172-31-4-27:~/resource# helm help
The Kubernetes package manager
To begin working with Helm, run the 'helm init' command:
$ helm init
root@ip-172-31-4-27:~/resource# helm home
/root/.helm
root@ip-172-31-4-27:~/resource# helm version
Client: &version.Version{SemVer:"v2.17.0", GitCommit:"a690bad98af45b015bd3da1a41f6218b1a451dbe", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.17.0", GitCommit:"a690bad98af45b015bd3da1a41f6218b1a451dbe", GitTreeState:"clean"}
최근버전으로 업데이트
root@ip-172-31-4-27:~/resource# helm init --upgrade
$HELM_HOME has been configured at /root/.helm.
Tiller (the Helm server-side component) has been updated to ghcr.io/helm/tiller:v2.17.0 .
root@ip-172-31-4-27:~/resource# helm repo update
Hang tight while we grab the latest from your chart repositories...
...Skip local chart repository
...Successfully got an update from the "stable" chart repository
Update Complete.
#@ DB 서치를 한다.
root@ip-172-31-4-27:~/resource# helm search database
NAME CHART VERSION APP VERSION DESCRIPTION
stable/cockroachdb 3.0.8 19.2.5 DEPRECATED -- CockroachDB is a scalable, survivable, stro...
stable/couchdb 2.3.0 2.3.1 DEPRECATED A database featuring seamless multi-master syn...
stable/dokuwiki 6.0.11 0.20180422.201901061035 DEPRECATED DokuWiki is a standards-compliant, simple to u...
stable/ignite 1.2.2 2.7.6 DEPRECATED - Apache Ignite is an open-source distributed ...
stable/janusgraph 0.2.6 1.0 DEPRECATED - Open source, scalable graph database.
stable/kubedb 0.1.3 0.8.0-beta.2 DEPRECATED KubeDB by AppsCode - Making running production...
stable/mariadb 7.3.14 10.3.22 DEPRECATED Fast, reliable, scalable, and easy to use open...
stable/mediawiki 9.1.9 1.34.0 DEPRECATED Extremely powerful, scalable software and a fe...
stable/mongodb 7.8.10 4.2.4 DEPRECATED NoSQL document-oriented database that stores J...
stable/mongodb-replicaset 3.17.2 3.6 DEPRECATED - NoSQL document-oriented database that stores...
stable/mysql 1.6.9 5.7.30 DEPRECATED - Fast, reliable, scalable, and easy to use op...
stable/mysqldump 2.6.2 2.4.1 DEPRECATED! - A Helm chart to help backup MySQL databases...
stable/neo4j 3.0.1 4.0.4 DEPRECATED Neo4j is the world's leading graph database
stable/pgadmin 1.2.2 4.18.0 pgAdmin is a web based administration tool for PostgreSQL...
stable/postgresql 8.6.4 11.7.0 DEPRECATED Chart for PostgreSQL, an object-relational dat...
stable/prisma 1.2.4 1.29.1 DEPRECATED Prisma turns your database into a realtime Gra...
stable/prometheus 11.12.1 2.20.1 DEPRECATED Prometheus is a monitoring system and time ser...
stable/rethinkdb 1.1.4 0.1.0 DEPRECATED - The open-source database for the realtime web
stable/couchbase-operator 1.0.4 1.2.2 DEPRECATED A Helm chart to deploy the Couchbase Autonomou...
stable/hazelcast 3.3.2 4.0.1 DEPRECATED Hazelcast IMDG is the most widely used in-memo...
stable/influxdb 4.3.2 1.7.9 DEPRECATED Scalable datastore for metrics, events, and re...
stable/percona 1.2.3 5.7.26 DEPRECATED - free, fully compatible, enhanced, open sourc...
stable/percona-xtradb-cluster 1.0.8 5.7.19 DEPRECATED - free, fully compatible, enhanced, open sourc...
stable/redis 10.5.7 5.0.7 DEPRECATED Open source, advanced key-value store. It is o...
#@ 이미 stable이 있는 경에는 add를 하지 말아라
root@ip-172-31-4-27:~/resource# helm repo list
WARNING: "kubernetes-charts-incubator.storage.googleapis.com" is deprecated for "incubator" and will be deleted Nov. 13, 2020.
WARNING: You should switch to "https://charts.helm.sh/incubator"
NAME URL
stable https://charts.helm.sh/stable
local http://127.0.0.1:8879/charts
incubator https://kubernetes-charts-incubator.storage.googleapis.com/
#@ 차트 추가 가능
root@ip-172-31-4-27:~/resource# helm repo add stable http://storage.googleapis.com/kubernetes-charts
"stable" has been added to your repositories
stable/redis-ha 4.4.6 5.0.6 DEPRECATED - Highly available Kubernetes implementation o...
root@ip-172-31-4-27:~/resource# helm repo add incubator https://kubernetes-charts-incubator.storage.googleapis.com/
"incubator" has been added to your repositories
root@ip-172-31-4-27:~/resource# helm search incubator
WARNING: "kubernetes-charts-incubator.storage.googleapis.com" is deprecated for "incubator" and will be deleted Nov. 13, 2020.
WARNING: You should switch to "https://charts.helm.sh/incubator"
NAME CHART VERSION APP VERSION DESCRIPTION
incubator/artifactory 5.2.2 5.2.0 DEPRECATED Universal Repository Manager supporting all ma...
incubator/aws-alb-ingress-controller 1.0.4 v1.1.8 DEPRECATED A Helm chart for AWS ALB Ingress Controller
heml 설치 완료 MariaDB 설치 해보자.
#helm install stable/mariadb --set master.persistence.enabled=false --set slave.persistence.enabled=false
#@ 위의 출력 내용을 통해 DB가 잘 설치 되었는지 확인해 봅니다.
root@ip-172-31-4-27:~/resource# kubectl get all --all-namespaces | grep maria
default pod/idolized-mule-mariadb-master-0 1/1 Running 0 18m
default pod/idolized-mule-mariadb-slave-0 1/1 Running 0 18m
default service/idolized-mule-mariadb ClusterIP 10.99.82.49 <none> 3306/TCP 18m
default service/idolized-mule-mariadb-slave ClusterIP 10.108.83.83 <none> 3306/TCP 18m
default statefulset.apps/idolized-mule-mariadb-master 1/1 18m
default statefulset.apps/idolized-mule-mariadb-slave 1/1 18m
kubectl run nasal-gerbil-mariadb-client --rm --tty -i --restart='Never' --image docker.io/bitnami/mariadb:10.3.22-debian-10-r27 --namespace default --command -- bash
. <(helm completion bash) <= helm 자동완성
#@ helm 자동완성
root@ip-172-31-4-27:~/resource# kubectl run nasal-gerbil-mariadb-client --rm --tty -i --restart='Never' --image docker.io/bitnami/mariadb:10.3.22-debian-10-r27 --namespace default --command -- bash
If you don't see a command prompt, try pressing enter.
I have no name!@nasal-gerbil-mariadb-client:/$ . <(helm completion bash)
bash: helm: command not found
I have no name!@nasal-gerbil-mariadb-client:/$
helm status helm_release
#@ 리포팅 정보를 다시 확인할 수 있다.
ls -R .helm (자세히 살펴 보세요)
#@ 차트를 확인한다.
root@ip-172-31-4-27:~/resource# helm list
WARNING: "kubernetes-charts-incubator.storage.googleapis.com" is deprecated for "incubator" and will be deleted Nov. 13, 2020.
WARNING: You should switch to "https://charts.helm.sh/incubator"
NAME REVISION UPDATED STATUS CHART APP VERSION NAMESPACE
idolized-mule 1 Fri Dec 4 03:12:33 2020 DEPLOYED mariadb-7.3.14 10.3.22 default
#@ idolized-mule는 helm release 이름이다.
root@ip-172-31-4-27:~/resource# helm status idolized-mule
WARNING: "kubernetes-charts-incubator.storage.googleapis.com" is deprecated for "incubator" and will be deleted Nov. 13, 2020.
WARNING: You should switch to "https://charts.helm.sh/incubator"
LAST DEPLOYED: Fri Dec 4 03:12:33 2020
NAMESPACE: default
STATUS: DEPLOYED
RESOURCES:
==> v1/ConfigMap
NAME DATA AGE
idolized-mule-mariadb-master 1 21m
idolized-mule-mariadb-slave 1 21m
idolized-mule-mariadb-tests 1 21m
==> v1/Service
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
idolized-mule-mariadb ClusterIP 10.99.82.49 <none> 3306/TCP 56m
idolized-mule-mariadb-slave ClusterIP 10.108.83.83 <none> 3306/TCP 56m
'클라우드 컴퓨팅 & NoSQL > k8s' 카테고리의 다른 글
statefulset 시나리오 (0) | 2020.12.06 |
---|---|
statefulset (0) | 2020.12.06 |
Helm (0) | 2020.12.06 |
limit range/resource-quota 시나리오 (0) | 2020.12.06 |
Pod의 Resource 관리 (0) | 2020.12.03 |