티스토리 뷰

728x90
반응형

지금부터 살펴볼 내용은 Kubernetes Helm Package Manage입니다. Helm을 통해 애플리케이션을 배포하고, 원격지에 있는 chart repository를 관리할 수 있습니다.

지난 시간까지 Kubernetes의 다양한 Component들을 설치하고 구성하는 과정과 이를 간편히 진행할 수 있도록 ShellScript를 통해 원스탭 부트 과정까지 살펴보았습니다.

 

이전 포스팅은 아래를 참고해 주시기 바랍니다.

[Container Management] Kubernetes Master Node 설치

[Container Management] Kubernetes Dashboard Install & Setting

[Container Management] Kubernetes Woker Node Install & Setting

[Container Management] Kubernetes Pod 생성 가이드

[Container Management] Kubernetes Service 생성 가이드

[Container Management] Kubernetes 애플리케이션 관리

[Container Management] Kubernetes ingress & ingress controller

 

OneStep Install & Boot & Setting 과정은 다음을 참고해 주세요.

[Container Management] Kubernetes OneStep Install & Boot & Setting (Part 1. Install)

[Container Management] Kubernetes OneStep Install & Boot & Setting (Part 2. Boot & Setting)

 

Github Pages 구성 과정은 다음을 참고해 주세요.

[Container Management] Github Pages 생성 및 관리

Helm 구조

Helm은 Client - Server 구조로 구성되어 있으며, Client를 위한 Helm Client, Server를 위한 Helm tiller로 구성되어 있습니다.

또한 Client가 요구하는 애플리케이션의 구성요소들을 정의하고 설정하는 모듈을 Helm Chart라고하며, 마지막으로 이를 Kubernetes 위에 배포하는 과정을 Helm Release라고 합니다.

Helm Client가 애플리케이션을 Release 하는 과정을 살펴보자면 다음과 같습니다.

1) 사용자는 애플리케이션을 배포하기위해 Helm Chart를 정의합니다.

2) 사용자가 Chart를 Release하기 위해 helm install을 실행하면, Helm Client는 gRPC 프로토콜을 통해 Helm Tiller와 통신하며 Chart를 전송합니다.

3) Helm Tiller는 받은 Chart를 재해석하여 Manifest 파일을 생성합니다.

4) 이를 기반으로 Kubernetes에 배포를 수행합니다.

Helm 설치

먼저 Helm을 설치해 보도록 하겠습니다. Helm을 설치하기 위해서는 Kubernetes Cluster 환경이 구성되어 있어야 합니다.

Kubernetes Cluster 환경을 구축하기 위해서는 앞서 살펴본 포스팅 글을 참고하세요.

 

1) Helm 설치

먼저 Helm 설치를 위한 get_helm.sh 파일을 받아 설치를 진행합니다.

 

[root@kubemaster kubernetes_onestepboot]# curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  7034  100  7034    0     0   7368      0 --:--:-- --:--:-- --:--:--  7365
Downloading https://get.helm.sh/helm-v2.14.3-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@kubemaster kubernetes_onestepboot]#

설치는 기본 다음 경로에 진행됩니다.

[root@kubemaster kubernetes_onestepboot]# ls -la /usr/local/bin
total 82700
drwxr-xr-x.  2 root root       32 Sep 15 23:29 .
drwxr-xr-x. 12 root root      131 Sep 11 22:48 ..
-rwxr-xr-x.  1 root root 41819776 Sep 15 23:29 helm
-rwxr-xr-x.  1 root root 42864160 Sep 15 23:29 tiller
[root@kubemaster kubernetes_onestepboot]#

 

2) Helm Initialize

Helm 설치가 완료되면 server side helm 모듈인 tiller를 구성하고 helm init 명령어로 helm을 Kubernetes Cluster에 등록합니다.

[root@kubemaster kubernetes_onestepboot]# kubectl --namespace kube-system create serviceaccount tiller
serviceaccount/tiller created
[root@kubemaster kubernetes_onestepboot]# kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
clusterrolebinding.rbac.authorization.k8s.io/tiller created
[root@kubemaster kubernetes_onestepboot]# helm init --service-account tiller --wait
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://kubernetes-charts.storage.googleapis.com 
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://docs.helm.sh/using_helm/#securing-your-helm-installation
[root@kubemaster kubernetes_onestepboot]# 

Helm의 서버인 tiller의 service account를 생성하고 해당 service account에 클러스터를 관리할 수 있는 권한을 부여합니다.

3) Helm Chart 확인

repository update 및 list를 확인합니다.

[root@kubemaster kubernetes_onestepboot]# 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.
[root@kubemaster kubernetes_onestepboot]# helm search
NAME                                    CHART VERSION   APP VERSION                     DESCRIPTION                                                 
stable/acs-engine-autoscaler            2.2.2           2.1.1                           DEPRECATED Scales worker nodes within agent pools           
stable/aerospike                        0.2.8           v4.5.0.5                        A Helm chart for Aerospike in Kubernetes                    
stable/airflow                          4.0.8           1.10.4                          Airflow is a platform to programmatically author, schedul...
stable/ambassador                       4.0.0           0.78.0                          A Helm chart for Datawire Ambassador                        
stable/anchore-engine                   1.3.0           0.5.0                           Anchore container analysis and policy evaluation engine s...
stable/apm-server                       2.1.4           7.0.0                           The server receives data from the Elastic APM agents and ...
stable/ark                              4.2.2           0.10.2                          DEPRECATED A Helm chart for ark                             
stable/artifactory                      7.3.1           6.1.0                           DEPRECATED Universal Repository Manager supporting all ma...
stable/artifactory-ha                   0.4.1           6.2.0                           DEPRECATED Universal Repository Manager supporting all ma...
stable/atlantis                         3.8.2           v0.8.2                          A Helm chart for Atlantis https://www.runatlantis.io        
stable/auditbeat                        1.1.0           6.7.0                           A lightweight shipper to audit the activities of users an...
stable/aws-cluster-autoscaler           0.3.3                                           Scales worker nodes within autoscaling groups.              
stable/aws-iam-authenticator            0.1.1           1.0                             A Helm chart for aws-iam-authenticator                      
stable/bitcoind                         0.2.2           0.17.1                          Bitcoin is an innovative payment network and a new kind o...
stable/bookstack                        1.1.0           0.25.2                          BookStack is a simple, self-hosted, easy-to-use platform ...
stable/buildkite                        0.2.4           3                               DEPRECATED Agent for Buildkite                              
stable/burrow                           1.3.0           0.25.1                          Burrow is a permissionable smart contract machine           
stable/centrifugo                       3.1.0           2.1.0                           Centrifugo is a real-time messaging server.                 
stable/cerebro                          1.2.0           0.8.4                           A Helm chart for Cerebro - a web admin tool that replaces...
stable/cert-manager                     v0.6.7          v0.6.2                          A Helm chart for cert-manager                               
stable/chaoskube                        3.1.2           0.14.0                          Chaoskube periodically kills random pods in your Kubernet...
stable/chartmuseum                      2.3.2           0.8.2                           Host your own Helm Chart Repository                         
stable/chronograf                       1.1.0           1.7.12                          Open-source web application written in Go and React.js th...
stable/clamav                           1.0.3           1.6                             An Open-Source antivirus engine for detecting trojans, vi...
stable/cloudserver                      1.0.3           8.1.5                           An open-source Node.js implementation of the Amazon S3 pr...
stable/cluster-autoscaler               3.2.0           1.13.1                          Scales worker nodes within autoscaling groups.              
stable/cluster-overprovisioner          0.2.3           1.0                             Installs the a deployment that overprovisions the cluster   
stable/cockroachdb                      2.1.12          19.1.3                          CockroachDB is a scalable, survivable, strongly-consisten...
stable/collabora-code                   1.0.5           4.0.3.1                         A Helm chart for Collabora Office - CODE-Edition            
stable/concourse                        8.2.5           5.5.0                           Concourse is a simple and scalable CI system.               
stable/consul                           3.8.1           1.5.3                           Highly available and distributed service discovery and ke...
stable/coredns                          1.7.1           1.6.2                           CoreDNS is a DNS server that chains plugins and provides ...
stable/cosbench                         1.0.1           0.0.6                           A benchmark tool for cloud object storage services          
stable/coscale                          1.0.0           3.16.0                          CoScale Agent                                               
stable/couchbase-operator               1.0.1           1.2.1                           A Helm chart to deploy the Couchbase Autonomous Operator ...
stable/couchdb                          2.2.0           2.3.1                           A database featuring seamless multi-master sync, that sca...
stable/dask                             3.0.0           1.1.5                           Distributed computation in Python with task scheduling      
stable/dask-distributed                 2.0.2                                           DEPRECATED: Distributed computation in Python               
stable/datadog                          1.33.0          6.13.0                          DataDog Agent                                               
stable/dex                              2.3.1           2.19.0                          CoreOS Dex                                                  
stable/distributed-jmeter               1.0.1           3.3                             A Distributed JMeter Helm chart                             
stable/distributed-tensorflow           0.1.1           1.6.0                           A Helm chart for running distributed TensorFlow on Kubern...
stable/distribution                     0.4.2           1.1.0                           DEPRECATED A Helm chart for JFrog Distribution              
stable/dmarc2logstash                   1.2.0           1.0.3                           Provides a POP3-polled DMARC XML report injector into Ela...
stable/docker-registry                  1.8.2           2.7.1                           A Helm chart for Docker Registry                            
stable/dokuwiki                         5.2.6           0.20180422.201901061035         DokuWiki is a standards-compliant, simple to use wiki opt...
stable/drone                            2.1.0           1.3.1                           Drone is a Continuous Delivery system built on container ...
stable/drupal                           5.2.3           8.7.7                           One of the most versatile open source content management ...
stable/efs-provisioner                  0.7.0           v2.2.0-k8s1.12                  A Helm chart for the AWS EFS external storage provisioner   
stable/elastabot                        1.2.0           1.1.0                           A Helm chart for Elastabot - a Slack bot companion for El...
stable/elastalert                       1.2.0           0.2.1                           ElastAlert is a simple framework for alerting on anomalie...
stable/elastic-stack                    1.8.0           6                               A Helm chart for ELK                                        
stable/elasticsearch                    1.31.1          6.8.2                           Flexible and powerful open source, distributed real-time ...
stable/elasticsearch-curator            2.0.1           5.5.4                           A Helm chart for Elasticsearch Curator                      
stable/elasticsearch-exporter           1.10.1          1.1.0                           Elasticsearch stats exporter for Prometheus                 
stable/envoy                            1.5.0           1.9.0                           Envoy is an open source edge and service proxy, designed ...
stable/etcd-operator                    0.9.0           0.9.4                           CoreOS etcd-operator Helm chart for Kubernetes              
stable/ethereum                         1.0.0           v1.7.3                          private Ethereum network Helm chart for Kubernetes          
stable/eventrouter                      0.2.1           0.2                             A Helm chart for eventruter (https://github.com/heptiolab...
stable/express-gateway                  1.6.2           1.16.8                          Express Gateway is an API Gateway that sits at the heart ...
stable/external-dns                     2.6.1           0.5.16                          ExternalDNS is a Kubernetes addon that configures public ...
stable/factorio                         1.0.0           0.15.39                         Factorio dedicated server.                                  
stable/falco                            1.0.7           0.17.0                          Falco                                                       
stable/filebeat                         3.0.1           7.0.1                           A Helm chart to collect Kubernetes logs with filebeat       
stable/fluent-bit                       2.7.0           1.2.2                           Fast and Lightweight Log/Data Forwarder for Linux, BSD an...
stable/fluentd                          2.0.3           v2.4.0                          A Fluentd Elasticsearch Helm chart for Kubernetes.          
stable/fluentd-elasticsearch            2.0.7           2.3.2                           DEPRECATED! - A Fluentd Helm chart for Kubernetes with El...
stable/g2                               0.3.3           0.5.0                           DEPRECATED G2 by AppsCode - Gearman in Golang               
stable/gangway                          0.1.5           3.0.0                           An application that can be used to easily enable authenti...
stable/gce-ingress                      1.2.0           1.4.0                           A GCE Ingress Controller                                    
stable/gcloud-endpoints                 0.1.2           1                               DEPRECATED Develop, deploy, protect and monitor your APIs...
stable/gcloud-sqlproxy                  0.6.1           1.11                            DEPRECATED Google Cloud SQL Proxy                           
stable/gcp-night-king                   1.0.2           1                               A Helm chart for GCP Night King                             
stable/ghost                            7.2.4           2.31.0                          A simple, powerful publishing platform that allows you to...
stable/gitlab-ce                        0.2.2           9.4.1                           GitLab Community Edition                                    
stable/gitlab-ee                        0.2.2           9.4.1                           GitLab Enterprise Edition                                   
stable/gocd                             1.17.0          19.8.0                          GoCD is an open-source continuous delivery server to mode...
stable/goldpinger                       1.1.4           1.5.0                           Goldpinger makes calls between its instances for visibili...
stable/grafana                          3.8.13          6.3.5                           The leading tool for querying and visualizing time series...
stable/graphite                         0.2.2           1.1.5-3                         DEPRECATED! - Graphite metrics server                       
stable/graylog                          1.3.3           3.0.2-2                         Graylog is the centralized log management solution built ...
stable/hackmd                           1.2.1           1.3.0-alpine                    Realtime collaborative markdown notes on all platforms.     
stable/hadoop                           1.1.1           2.9.0                           The Apache Hadoop software library is a framework that al...
stable/hazelcast                        2.1.0           3.12.2                          Hazelcast IMDG is the most widely used in-memory data gri...
stable/hazelcast-jet                    1.2.0           3.1                             Hazelcast Jet is an application embeddable, distributed c...
stable/heapster                         1.0.1           1.5.4                           Heapster enables Container Cluster Monitoring and Perform...
stable/heartbeat                        1.2.0           6.7.0                           A Helm chart to periodically check the status of your ser...
stable/helm-exporter                    0.3.1           0.4.0                           Exports helm release stats to prometheus                    
stable/hl-composer                      1.0.12          0.20.0                          Hyperledger Composer REST Server chart                      
stable/hlf-ca                           1.1.8           1.3.0                           Hyperledger Fabric Certificate Authority chart (these cha...
stable/hlf-couchdb                      1.0.7           0.4.10                          CouchDB instance for Hyperledger Fabric (these charts are...
stable/hlf-ord                          1.2.6           1.3.0                           Hyperledger Fabric Orderer chart (these charts are create...
stable/hlf-peer                         1.2.10          1.3.0                           Hyperledger Fabric Peer chart (these charts are created b...
stable/hoard                            0.7.0           3.0.1                           Hoard is a stateless, deterministically encrypted, conten...
stable/home-assistant                   0.9.7           0.98.0                          Home Assistant                                              
stable/horovod                          1.0.0           0.12.1                          A Helm chart for deploying Horovod                          
stable/hubot                            1.0.0           3.3.2                           Hubot chatbot for Slack                                     
stable/ignite                           1.0.0           2.7.0                           Apache Ignite is an open-source distributed database, cac...
stable/inbucket                         3.1.0           2.0.0                           Inbucket is an email testing application                    
stable/influxdb                         1.4.0           1.7.6                           Scalable datastore for metrics, events, and real-time ana...
stable/ingressmonitorcontroller         1.0.48          1.0.47                          IngressMonitorController chart that runs on kubernetes      
stable/instana-agent                    1.0.13          1                               Instana Agent for Kubernetes                                
stable/ipfs                             0.3.0           v0.4.21                         A Helm chart for the Interplanetary File System             
stable/jaeger-operator                  2.9.0           1.13.1                          jaeger-operator Helm chart for Kubernetes                   
stable/janusgraph                       0.2.1           1.0                             Open source, scalable graph database.                       
stable/jasperreports                    6.2.2           7.2.0                           The JasperReports server can be used as a stand-alone or ...
stable/jenkins                          1.7.0           lts                             Open source continuous integration server. It supports mu...
stable/joomla                           6.1.5           3.9.11                          PHP content management system (CMS) for publishing web co...
stable/k8s-spot-rescheduler             0.4.2           v0.2.0                          A k8s-spot-rescheduler Helm chart for Kubernetes            
stable/k8s-spot-termination-handler     1.4.4           1.13.7-1                        The K8s Spot Termination handler handles draining AWS Spo...
stable/kafka-manager                    2.1.6           1.3.3.22                        A tool for managing Apache Kafka.                           
stable/kanister-operator                0.3.0           0.10.0                          Kanister-operator Helm chart for Kubernetes                 
stable/kapacitor                        1.1.3           1.5.2                           InfluxDB's native data processing engine. It can process ...
stable/karma                            1.1.18          v0.42                           A Helm chart for Karma - an UI for Prometheus Alertmanager  
stable/katafygio                        1.0.0           0.8.1                           Continuously backup Kubernetes objets as YAML files in git  
stable/keel                             0.6.1           0.9.5                           DEPRECATED Open source, tool for automating Kubernetes de...
stable/keycloak                         4.10.1          5.0.0                           DEPRECATED - Open Source Identity and Access Management F...
stable/kiam                             2.5.1           3.3                             Integrate AWS IAM with Kubernetes                           
stable/kibana                           3.2.3           6.7.0                           Kibana is an open source data visualization plugin for El...
stable/kong                             0.17.0          1.3                             The Cloud-Native Ingress and Service Mesh for APIs and Mi...
stable/kube-hunter                      1.0.3           312                             A Helm chart for Kube-hunter                                
stable/kube-lego                        0.4.2           v0.1.6                          DEPRECATED Automatically requests certificates from Let's...
stable/kube-ops-view                    1.1.0           0.11                            Kubernetes Operational View - read-only system dashboard ...
stable/kube-slack                       1.1.0           v4.2.0                          Chart for kube-slack, a monitoring service for Kubernetes   
stable/kube-state-metrics               2.3.1           1.7.2                           Install kube-state-metrics to generate and expose cluster...
stable/kube2iam                         2.0.1           0.10.7                          Provide IAM credentials to pods based on annotations.       
stable/kubed                            0.3.3           0.4.0                           DEPRECATED Kubed by AppsCode - Kubernetes daemon            
stable/kubedb                           0.1.3           0.8.0-beta.2                    DEPRECATED KubeDB by AppsCode - Making running production...
stable/kuberhealthy                     1.2.6           v1.0.2                          The official Helm chart for Kuberhealthy.                   
stable/kubernetes-dashboard             1.8.0           1.10.1                          General-purpose web UI for Kubernetes clusters              
stable/kuberos                          0.2.1           2018-07-03                      An OIDC authentication helper for Kubernetes                
stable/kubewatch                        0.8.8           0.0.4                           Kubewatch notifies your slack rooms when changes to your ...
stable/kured                            1.3.1           1.2.0                           A Helm chart for kured                                      
stable/lamp                             1.1.0           7                               Modular and transparent LAMP stack chart supporting PHP-F...
stable/linkerd                          0.4.1           1.1.2                           Service mesh for cloud native apps                          
stable/locust                           1.1.1           0.9.0                           A modern load testing framework                             
stable/logdna-agent                     1.2.0           1.5.6                           Run this, get logs. All cluster containers. LogDNA collec...
stable/logstash                         2.2.0           7.1.1                           Logstash is an open source, server-side data processing p...
stable/luigi                            2.7.5           2.7.2                           Luigi is a Python module that helps you build complex pip...
stable/magento                          5.1.4           2.3.1                           DEPRECATED A feature-rich flexible e-commerce solution. I...
stable/magic-ip-address                 0.1.0           0.9.0                           A Helm chart to assign static IP addresses for node-local...
stable/magic-namespace                  0.5.2           2.8.1                           Elegantly enables a Tiller per namespace in RBAC-enabled ...
stable/mailhog                          2.3.1           1.0.0                           DEPRECATED - An e-mail testing tool for developers          
stable/mariadb                          6.8.10          10.3.18                         Fast, reliable, scalable, and easy to use open-source rel...
stable/mattermost-team-edition          3.1.2           5.9.0                           Mattermost Team Edition server.                             
stable/mcrouter                         1.0.0           0.36.0                          Mcrouter is a memcached protocol router for scaling memca...
stable/mediawiki                        8.2.3           1.33.0                          Extremely powerful, scalable software and a feature-rich ...
stable/memcached                        2.10.0          1.5.12                          Free & open source, high-performance, distributed memory ...
stable/mercure                          1.0.10          0.6.0                           The Mercure hub allows to push data updates using the Mer...
stable/metabase                         0.8.1           v0.32.9                         The easy, open source way for everyone in your company to...
stable/metallb                          0.11.2          0.8.1                           MetalLB is a load-balancer implementation for bare metal ...
stable/metricbeat                       1.7.0           6.7.0                           A Helm chart to collect Kubernetes logs with metricbeat     
stable/metrics-server                   2.8.5           0.3.4                           Metrics Server is a cluster-wide aggregator of resource u...
stable/minecraft                        1.1.0           1.14.4                          Minecraft server                                            
stable/minio                            2.5.13          RELEASE.2019-08-07T01-59-21Z    MinIO is a high performance distributed object storage se...
stable/mission-control                  0.4.3           3.1.2                           DEPRECATED A Helm chart for JFrog Mission Control           
stable/mongodb                          7.2.8           4.0.12                          NoSQL document-oriented database that stores JSON-like do...
stable/mongodb-replicaset               3.9.6           3.6                             NoSQL document-oriented database that stores JSON-like do...
stable/moodle                           6.1.7           3.7.2                           Moodle is a learning platform designed to provide educato...
stable/msoms                            0.2.0           1.0.0-30                        A chart for deploying omsagent as a daemonset Kubernetes    
stable/mssql-linux                      0.10.0          14.0.3023.8                     SQL Server 2017 Linux Helm Chart                            
stable/mysql                            1.3.1           5.7.14                          Fast, reliable, scalable, and easy to use open-source rel...
stable/mysqldump                        2.6.0           2.4.1                           A Helm chart to help backup MySQL databases using mysqldump 
stable/namerd                           0.2.0                                           Service that manages routing for multiple linkerd instances 
stable/nats                             4.1.3           2.0.4                           An open-source, cloud-native messaging system               
stable/neo4j                            1.2.0           3.4.5                           Neo4j is the world's leading graph database                 
stable/newrelic-infrastructure          0.13.8          1.9.4                           A Helm chart to deploy the New Relic Infrastructure Agent...
stable/nextcloud                        1.7.2           16.0.3                          A file sharing server that puts the control and security ...
stable/nfs-client-provisioner           1.2.6           3.1.0                           nfs-client is an automatic provisioner that used your *al...
stable/nfs-server-provisioner           0.3.1           2.2.1-k8s1.12                   nfs-server-provisioner is an out-of-tree dynamic provisio...
stable/nginx-ingress                    1.20.0          0.25.1                          An nginx Ingress controller that uses ConfigMap to store ...
stable/nginx-ldapauth-proxy             0.1.2           1.13.5                          nginx proxy with ldapauth                                   
stable/nginx-lego                       0.3.1                                           Chart for nginx-ingress-controller and kube-lego            
stable/node-problem-detector            1.5.2           v0.7.0                          Installs the node-problem-detector daemonset for monitori...
stable/node-red                         1.3.1           0.20.7                          Node-RED is flow-based programming for the Internet of Th...
stable/oauth2-proxy                     0.14.1          3.2.0                           A reverse proxy that provides authentication with Google,...
stable/odoo                             11.1.4          12.0.20190815                   A suite of web based open source business apps.             
stable/opa                              1.8.0           0.10.2                          Open source, general-purpose policy engine. Enforce fine-...
stable/opencart                         6.2.1           3.0.3-2                         A free and open source e-commerce platform for online mer...
stable/openebs                          1.2.1           1.2.0                           Containerized Storage for Containers                        
stable/openiban                         1.0.0           1.0.1                           OpenIBAN is a self-hosted, free and open-source IBAN vali...
stable/openldap                         1.2.1           2.4.47                          Community developed LDAP software                           
stable/openvpn                          3.13.10         1.1.0                           A Helm chart to install an openvpn server inside a kubern...
stable/orangehrm                        6.2.3           4.3.3-0                         OrangeHRM is a free HR management system that offers a we...
stable/osclass                          6.2.1           3.7.4                           Osclass is a php script that allows you to quickly create...
stable/owncloud                         6.2.3           10.2.1                          A file sharing server that puts the control and security ...
stable/pachyderm                        0.2.1           1.8.6                           Pachyderm is a large-scale container-based workflow engin...
stable/parse                            9.2.4           3.9.0                           Parse is a platform that enables users to add a scalable ...
stable/percona                          1.1.0           5.7.17                          free, fully compatible, enhanced, open source drop-in rep...
stable/percona-xtradb-cluster           1.0.1           5.7.19                          free, fully compatible, enhanced, open source drop-in rep...
stable/phabricator                      7.0.6           2019.36.0                       Collection of open source web applications that help soft...
stable/phpbb                            6.2.1           3.2.7                           Community forum that supports the notion of users and gro...
stable/phpmyadmin                       3.0.5           4.9.0-1                         phpMyAdmin is an mysql administration frontend              
stable/pomerium                         2.0.0           0.3.0                           Pomerium is an identity-aware access proxy.                 
stable/postgresql                       6.3.6           11.5.0                          Chart for PostgreSQL, an object-relational database manag...
stable/prestashop                       8.2.2           1.7.6-1                         A popular open source ecommerce solution. Professional to...
stable/presto                           0.1.1           0.196                           Distributed SQL query engine for running interactive anal...
stable/prisma                           1.2.1           1.29.1                          Prisma turns your database into a realtime GraphQL API      
stable/prometheus                       9.1.1           2.11.1                          Prometheus is a monitoring system and time series database. 
stable/prometheus-adapter               1.3.0           v0.5.0                          A Helm chart for k8s prometheus adapter                     
stable/prometheus-blackbox-exporter     1.3.0           0.15.0                          Prometheus Blackbox Exporter                                
stable/prometheus-cloudwatch-exporter   0.4.10          0.5.0                           A Helm chart for prometheus cloudwatch-exporter             
stable/prometheus-consul-exporter       0.1.4           0.4.0                           A Helm chart for the Prometheus Consul Exporter             
stable/prometheus-couchdb-exporter      0.1.1           1.0                             A Helm chart to export the metrics from couchdb in Promet...
stable/prometheus-mongodb-exporter      2.2.1           v0.7.0                          A Prometheus exporter for MongoDB metrics                   
stable/prometheus-mysql-exporter        0.5.1           v0.11.0                         A Helm chart for prometheus mysql exporter with cloudsqlp...
stable/prometheus-nats-exporter         2.2.1           0.5.0                           A Helm chart for prometheus-nats-exporter                   
stable/prometheus-node-exporter         1.6.0           0.18.0                          A Helm chart for prometheus node-exporter                   
stable/prometheus-operator              6.11.0          0.32.0                          Provides easy monitoring definitions for Kubernetes servi...
stable/prometheus-postgres-exporter     0.7.2           0.5.1                           A Helm chart for prometheus postgres-exporter               
stable/prometheus-pushgateway           1.0.1           0.9.1                           A Helm chart for prometheus pushgateway                     
stable/prometheus-rabbitmq-exporter     0.5.3           v0.29.0                         Rabbitmq metrics exporter for prometheus                    
stable/prometheus-redis-exporter        3.0.1           1.0.4                           Prometheus exporter for Redis metrics                       
stable/prometheus-snmp-exporter         0.0.4           0.14.0                          Prometheus SNMP Exporter                                    
stable/prometheus-to-sd                 0.2.0           0.5.2                           Scrape metrics stored in prometheus format and push them ...
stable/quassel                          0.2.9           0.12.4                          Quassel IRC is a modern, cross-platform, distributed IRC ...
stable/rabbitmq                         6.4.5           3.7.17                          Open source message broker software that implements the A...
stable/rabbitmq-ha                      1.32.0          3.7.15                          Highly available RabbitMQ cluster, the open source messag...
stable/redis                            9.1.10          5.0.5                           Open source, advanced key-value store. It is often referr...
stable/redis-ha                         3.7.7           5.0.5                           Highly available Kubernetes implementation of Redis         
stable/redmine                          12.2.5          4.0.4                           A flexible project management web application.              
stable/reloader                         1.1.3           v0.0.29                         Reloader chart that runs on kubernetes                      
stable/rethinkdb                        1.0.0           0.1.0                           The open-source database for the realtime web               
stable/risk-advisor                     2.0.4           1.0.0                           Risk Advisor add-on module for Kubernetes                   
stable/rocketchat                       1.1.12          1.3.1                           Prepare to take off with the ultimate chat platform, expe...
stable/rookout                          0.1.0           1.0                             A Helm chart for Rookout agent on Kubernetes                
stable/sapho                            0.2.2                                           A micro application development and integration platform ...
stable/satisfy                          1.0.0           3.0.4                           Composer repo hosting with Satisfy                          
stable/schema-registry-ui               0.4.0           v0.9.5                          This is a web tool for the confluentinc/schema-registry i...
stable/sealed-secrets                   1.4.0           0.8.1                           A Helm chart for Sealed Secrets                             
stable/searchlight                      0.3.3           5.0.0                           DEPRECATED Searchlight by AppsCode - Alerts for Kubernetes  
stable/selenium                         1.0.8           3.141.59                        Chart for selenium grid                                     
stable/sematext-agent                   1.0.16          1.0                             Helm chart for deploying Sematext Agent to Kubernetes       
stable/sematext-docker-agent            1.0.1           1.31.53                         DEPRECATED Sematext Docker Agent                            
stable/sensu                            0.2.3           0.28                            Sensu monitoring framework backed by the Redis transport    
stable/sentry                           2.1.1           9.1.1                           Sentry is a cross-platform crash reporting and aggregatio...
stable/seq                              1.0.2           5                               Seq is the easiest way for development teams to capture, ...
stable/signalfx-agent                   0.3.1           3.6.1                           DEPRECATED The SignalFx Kubernetes agent                    
stable/signalsciences                   1.0.0           3.12.1                          SignalSciences is a web application firewall. This chart ...
stable/socat-tunneller                  0.1.0           1.0                             A Helm chart for socat-tunneller                            
stable/sonarqube                        2.2.0           7.9                             Sonarqube is an open sourced code quality scanning tool     
stable/sonatype-nexus                   1.19.0          3.17.0-01                       Sonatype Nexus is an open source repository manager         
stable/spark                            1.0.0           1.5.1                           Fast and general-purpose cluster computing system.          
stable/spark-history-server             1.0.1           2.4.0                           A Helm chart for Spark History Server                       
stable/spartakus                        1.1.6           1.0.0                           Collect information about Kubernetes clusters to help imp...
stable/spinnaker                        1.15.0          1.12.5                          Open source, multi-cloud continuous delivery platform for...
stable/spotify-docker-gc                1.0.0           latest                          A simple Docker container and image garbage collection sc...
stable/spring-cloud-data-flow           2.4.3           2.2.1.RELEASE                   Toolkit for building data processing pipelines.             
stable/stackdriver-exporter             1.2.1           0.6.0                           Stackdriver exporter for Prometheus                         
stable/stash                            0.5.3           0.7.0-rc.1                      DEPRECATED Stash by AppsCode - Backup your Kubernetes Vol...
stable/stellar-core                     1.0.0           10.0.0                          Backbone node of the Stellar cryptocurrency network.        
stable/stolon                           1.1.2           0.13.0                          Stolon - PostgreSQL cloud native High Availability.         
stable/sugarcrm                         1.0.7           6.5.26                          DEPRECATED SugarCRM enables businesses to create extraord...
stable/suitecrm                         7.2.3           7.11.8                          SuiteCRM is a completely open source enterprise-grade Cus...
stable/sumokube                         1.0.0           latest                          Sumologic Log Collector                                     
stable/sumologic-fluentd                1.1.0           2.3.0                           Sumologic Log Collector                                     
stable/superset                         1.1.7           0.28.1                          Apache Superset (incubating) is a modern, enterprise-read...
stable/swift                            0.6.3           0.7.3                           DEPRECATED swift by AppsCode - Ajax friendly Helm Tiller ...
stable/sysdig                           1.4.15          0.92.1                          Sysdig Monitor and Secure agent                             
stable/telegraf                         1.1.5           1.1                             Telegraf is an agent written in Go for collecting, proces...
stable/tensorflow-notebook              0.1.2           1.6.0                           A Helm chart for tensorflow notebook and tensorboard        
stable/tensorflow-serving               1.0.0           1.14.0                          TensorFlow Serving is an open-source software library for...
stable/terracotta                       1.1.0           5.6.0                           Terracotta Ehcache is an improved version of Java's de fa...
stable/testlink                         6.2.1           1.9.19                          Web-based test management system that facilitates softwar...
stable/tomcat                           0.2.0           7                               Deploy a basic tomcat application server with sidecar as ...
stable/traefik                          1.78.0          1.7.14                          A Traefik based Kubernetes ingress controller with Let's ...
stable/uchiwa                           1.0.0           0.22                            Dashboard for the Sensu monitoring framework                
stable/unbound                          1.0.0           1.6.7                           Unbound is a fast caching DNS resolver                      
stable/unifi                            0.4.2           5.10.19                         Ubiquiti Network's Unifi Controller                         
stable/vault-operator                   0.1.1           0.1.9                           CoreOS vault-operator Helm chart for Kubernetes             
stable/velero                           2.1.6           1.1.0                           A Helm chart for velero                                     
stable/verdaccio                        0.7.2           3.11.6                          A lightweight private npm proxy registry (sinopia fork)     
stable/voyager                          3.2.4           6.0.0                           DEPRECATED Voyager by AppsCode - Secure Ingress Controlle...
stable/wavefront                        1.0.0           0.9.7                           Wavefront Kubernetes collector                              
stable/weave-cloud                      0.3.3           1.3.0                           Weave Cloud is a add-on to Kubernetes which provides Cont...
stable/weave-scope                      1.1.5           1.11.5                          A Helm chart for the Weave Scope cluster visualizer.        
stable/wordpress                        7.3.4           5.2.3                           Web publishing platform for building blogs and websites.    
stable/xray                             0.4.2           2.3.0                           DEPRECATED Universal component scan for security and lice...
stable/zeppelin                         1.1.0           0.7.2                           Web-based notebook that enables data-driven, interactive ...
stable/zetcd                            0.1.9           0.0.3                           CoreOS zetcd Helm chart for Kubernetes                      
[root@kubemaster kubernetes_onestepboot]# 

나만의 Helm Chart 만들기

앞선 포스팅에서 생성한 Github Pages를 활용한 Helm Chart를 구성하는 방법에 대해 알아보겠습니다.

1) Github Repository 생성

helm chart를 저장할 Repository를 생성합니다. 위와 같이 helm-chart-repo라는 Github Repository를 생성하였습니다.

2) 생성한 Repository Github Page 설정

앞선 포스팅에서 생성한 Github Page를 활용한 Helm Repository를 posting 하는 방법에 대해 살펴보겠습니다.

 

Github Pages 구성 과정은 다음을 참고해 주세요.

[Container Management] Github Pages 생성 및 관리

 

생성한 helm-chart-repo repository를 Github Pages에 연결하는 과정부터 살펴보겠습니다.

https://github.com/sonnaraon/helm-chart-repo → Settings → GitHub Pages → Source → master branch

3) Helm Repository 블로그 접속

master branch 선택이 완료되면 해당 Repository는 다음과 같이 접속이 가능해 집니다.

https://[signed_in_account].github.io/project_name

저의 경우 https://sonnaraon.github.io/project_name로 접속이 가능합니다.

현재 helm chart repo로 readme.md이 추가되어 있어 위와 같은 화면이 출력됩니다.

Helm chart 생성 및 Github에 추가

먼저 Github Project를 pull 받아 Helm chart를 신규로 생성하고 적용하는 과정에 대해 살펴보겠습니다.

git 관련된 포스팅은 다수 다루었으므로 별도의 설명 없이 명령어를 나열하도록 하겠습니다.

1) Github pull

[root@kubemaster helm]# git init
Reinitialized existing Git repository in /root/helm/.git/
[root@kubemaster helm]# git remote add origin https://github.com/sonnaraon/helm-chart-repo.git
[root@kubemaster helm]# git pull https://github.com/sonnaraon/helm-chart-repo.git
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0), pack-reused 0
Unpacking objects: 100% (3/3), done.
From https://github.com/sonnaraon/helm-chart-repo
 * branch            HEAD       -> FETCH_HEAD
[root@kubemaster helm]# ls
README.md
[root@kubemaster helm]#

2) demo project helm chart 생성

[root@kubemaster helm]# mkdir stable
[root@kubemaster helm]# helm create demo
Creating demo
[root@kubemaster helm]# helm package demo
Successfully packaged chart and saved it to: /root/helm/demo-0.1.0.tgz 
[root@kubemaster helm]# mv demo-0.1.0.tgz stable/
[root@kubemaster helm]# 

먼저 stable 디렉토리를 생성하여 생성한 charts를 저장할 수 있도록 구성합니다.

다음으로 helm create 명령어로 demo chart를 생성합니다. helm package 명령어로 생성한 chart를 패키지로 묶습니다.

마지막으로 해당 package를 생성한 stable 디렉토리로 이동합니다.

3) Github Pages와 연동할 index 생성

[root@kubemaster helm]# helm repo index stable --url https://sonnaraon.github.io/helm-chart-repo/stable
[root@kubemaster helm]#

다음으로 위와 같이 index를 생성하여 git repository와 github pages와 연결고리를 생성합니다.

생성 방법은

helm repo index [INDEX_FILE_PATH] --url [CHART_REPO_URL/INDEX_FILE_NAME]

즉 본 샘플에서는 helm repo index stable --url https://sonnaraon.github.io/helm-chart-repo/stable와 같은 형태로 인덱스를 생성하게 됩니다.

4) Github에 push

[root@kubemaster helm]# git add .
[root@kubemaster helm]# git commit -m "demo chart add"
[master 7b56b59] demo chart add
 Committer: root <root@kubemaster.skbroadband>
Your name and email address were configured automatically based
on your username and hostname. Please check that they are accurate.
You can suppress this message by setting them explicitly:

    git config --global user.name "Your Name"
    git config --global user.email you@example.com

After doing this, you may fix the identity used for this commit with:

    git commit --amend --reset-author

 11 files changed, 275 insertions(+)
 create mode 100644 demo/.helmignore
 create mode 100644 demo/Chart.yaml
 create mode 100644 demo/templates/NOTES.txt
 create mode 100644 demo/templates/_helpers.tpl
 create mode 100644 demo/templates/deployment.yaml
 create mode 100644 demo/templates/ingress.yaml
 create mode 100644 demo/templates/service.yaml
 create mode 100644 demo/templates/tests/test-connection.yaml
 create mode 100644 demo/values.yaml
 create mode 100644 stable/demo-0.1.0.tgz
 create mode 100644 stable/index.yaml
[root@kubemaster helm]# git push -u origin master
Username for 'https://github.com': nara0617@gmail.com
Password for 'https://nara0617@gmail.com@github.com': 
Counting objects: 18, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (16/16), done.
Writing objects: 100% (17/17), 7.02 KiB | 0 bytes/s, done.
Total 17 (delta 0), reused 0 (delta 0)
To https://github.com/sonnaraon/helm-chart-repo.git
   f81a9a0..7b56b59  master -> master
Branch master set up to track remote branch master from origin.
[root@kubemaster helm]#

위와 같이 github에 적용한 파일을 push합니다.

Github Pages 확인 및 Helm Chart 다운로드

1) Github Pages 확인

먼저 github pages에서 index로 추가한 demo chart가 추가되었는지 확인해 보도록 하겠습니다.

확인 URL은 https://[signed_in_account].github.io/[repository_name]/stable/index.yaml 입니다.

저의 경우 https://sonnaraon.github.io/helm-chart-repo/stable/index.yaml로 호출합니다.

위와 같이 해당 stable에는 demo-0.1.0.tgz chart를 제공하고 있습니다.

2) Helm Chart 다운로드

다운로드 받는 방법은 다양합니다.

[직접 URL을 치고 다운로드 받는 방법]

[wget으로 다운로드 받는 방법]

[root@kubemaster helm]# wget https://sonnaraon.github.io/helm-chart-repo/stable/demo-0.1.0.tgz
--2019-09-17 00:39:18--  https://sonnaraon.github.io/helm-chart-repo/stable/demo-0.1.0.tgz
Resolving sonnaraon.github.io (sonnaraon.github.io)... 185.199.110.153, 185.199.108.153, 185.199.111.153, ...
Connecting to sonnaraon.github.io (sonnaraon.github.io)|185.199.110.153|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2825 (2.8K) [application/octet-stream]
Saving to: 쁡emo-0.1.0.tgz

100%[==========================================================================>] 2,825       --.-K/s   in 0s      

2019-09-17 00:39:18 (81.9 MB/s) - 쁡emo-0.1.0.tgzsaved [2825/2825]

[root@kubemaster helm]#

[helm repo 명령어로 다운로드 받는 방법]

마지막으로 helm repo 명령어로 다운로드 받는 방법입니다.

지금까지 추가한 helm charts repository를 다음과 같이 helm repo에 추가합니다.

3) Helm repo 관리

[root@kubemaster helm]# helm repo add helm-chart-repo https://sonnaraon.github.io/helm-chart-repo/stable
"helm-chart-repo" has been added to your repositories
[root@kubemaster helm]# helm repo list | grep sonnaraon
helm-chart-repo https://sonnaraon.github.io/helm-chart-repo/stable
[root@kubemaster helm]# helm search helm-chart-repo
NAME                    CHART VERSION   APP VERSION     DESCRIPTION                
helm-chart-repo/demo    0.1.0           1.0             A Helm chart for Kubernetes
[root@kubemaster helm]#

위와 같이 추가한 helm repository를 local에 추가할 수 있습니다.

- helm repo add [helm_chart_name] [helm_chart_url]

- helm repo list

- helm search [helm_chart_name]

helm repo list로 추가된 리포지토리를 확인할 수 있습니다.

helm search로 chart 정보를 확인할 수 있습니다.

4) Helm install

마지막으로 살펴볼 내용은 Helm으로 추가한 Repository를 적용하는 방법입니다.

Helm으로 demo 패키지를 install 하기 위해서는 당연히 Kubernetes가 먼저 기동되어 있어야 합니다.

[root@kubemaster helm]# helm install helm-chart-repo/demo
NAME:   kubemaster
LAST DEPLOYED: xxx
NAMESPACE: default
STATUS: DEPLOYED

RESOURCES:
==> v1beta2/Deployment
NAME                   AGE
kubemaster-demo  0s

==> v1/Pod(related)

NAME                                    READY  STATUS             RESTARTS  AGE
kubemaster-demo-54dd9c69f8-b77dz  0/1    ContainerCreating  0         0s

==> v1/Service

NAME                   AGE
kubemaster-demo  0s


NOTES:
1. Get the application URL by running these commands:
  export POD_NAME=$(kubectl get pods --namespace default -l "app.kubernetes.io/name=demo,app.kubernetes.io/instance=kubemaster" -o jsonpath="{.items[0].metadata.name}")
  echo "Visit http://127.0.0.1:8080 to use your application"
  kubectl port-forward $POD_NAME 8080:80
[root@kubemaster helm]#

이번 시간에는 Helm Chart를 직접 생성하고 자신만의 Repository에 Chart를 저장하여 호출하는 과정을 살펴보았습니다.

이를 활용하여 Gitlab에 적용한다면, 폐쇄망 환경에서도 적용이 가능하지 않을까 싶습니다.

728x90
반응형