CentOS Stream 10
Sponsored Link

Kubernetes : Helm インストール2025/01/23

 

Helm をインストールすると、Kubernetes アプリケーションのイントール等々の管理が容易になります。

当例では以下のように 4 台のノードを使用して Kubernetes クラスターを構成しています。

+----------------------+   +----------------------+
|  [ ctrl.srv.world ]  |   |   [ dlp.srv.world ]  |
|     Manager Node     |   |     Control Plane    |
+-----------+----------+   +-----------+----------+
        eth0|10.0.0.25             eth0|10.0.0.30
            |                          |
------------+--------------------------+-----------
            |                          |
        eth0|10.0.0.51             eth0|10.0.0.52
+-----------+----------+   +-----------+----------+
| [ node01.srv.world ] |   | [ node02.srv.world ] |
|     Worker Node#1    |   |     Worker Node#2    |
+----------------------+   +----------------------+

[1] Helm をインストールします。
[root@ctrl ~]#
dnf -y install git
[root@ctrl ~]#
curl -O https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
[root@ctrl ~]#
bash ./get-helm-3

Downloading https://get.helm.sh/helm-v3.17.0-linux-amd64.tar.gz
Verifying checksum... Done.
Preparing to install helm into /usr/local/bin
helm installed into /usr/local/bin/helm

[root@ctrl ~]#
helm version

version.BuildInfo{Version:"v3.17.0", GitCommit:"301108edc7ac2a8ba79e4ebf5701b0b6ce6a31e4", GitTreeState:"clean", GoVersion:"go1.23.4"}
[2] Helm の基本操作です。
# Helm Hub からキーワードが含まれるチャートを検索

[cent@ctrl ~]$
helm search hub wordpress

URL                                                     CHART VERSION   APP VERSION             DESCRIPTION                     
https://artifacthub.io/packages/helm/wordpress-...      1.0.2           1.0.0                   A Helm chart for deploying Wordpress+Mariadb st...
https://artifacthub.io/packages/helm/kube-wordp...      0.1.0           1.1                     this is my wordpress package    
https://artifacthub.io/packages/helm/bitnami/wo...      24.1.7          6.7.1                   WordPress is the world's most popular blogging ...
.....
.....

# リポジトリを追加 (下例は bitnami リポジトリ)

[cent@ctrl ~]$
helm repo add bitnami https://charts.bitnami.com/bitnami

"bitnami" has been added to your repositories
# リポジトリ一覧

[cent@ctrl ~]$
helm repo list

NAME    URL
bitnami https://charts.bitnami.com/bitnami

# リポジトリからキーワードが含まれるチャートを検索

[cent@ctrl ~]$
helm search repo bitnami

NAME                                            CHART VERSION   APP VERSION     DESCRIPTION                                     
bitnami/airflow                                 22.4.7          2.10.4          Apache Airflow is a tool to express and execute...
bitnami/apache                                  11.3.1          2.4.62          Apache HTTP Server is an open-source HTTP serve...
bitnami/apisix                                  4.0.0           3.11.0          Apache APISIX is high-performance, real-time AP...
bitnami/appsmith                                5.1.7           1.57.0          Appsmith is an open source platform for buildin...
bitnami/argo-cd                                 7.1.4           2.13.3          Argo CD is a continuous delivery tool for Kuber...
bitnami/argo-workflows                          11.1.2          3.6.2           Argo Workflows is meant to orchestrate Kubernet...
bitnami/aspnet-core                             6.3.2           8.0.12          ASP.NET Core is an open-source framework for we...
bitnami/cassandra                               12.1.1          5.0.2           Apache Cassandra is an open source distributed ...
bitnami/cert-manager                            1.4.3           1.16.3          cert-manager is a Kubernetes add-on to automate...
.....
.....

# チャートの情報を表示
# helm show [all|chart|readme|values] [チャート名]

[cent@ctrl ~]$
helm show chart bitnami/haproxy

annotations:
  category: Infrastructure
  images: |
    - name: haproxy
      image: docker.io/bitnami/haproxy:3.1.2-debian-12-r1
  licenses: Apache-2.0
apiVersion: v2
appVersion: 3.1.2
dependencies:
- name: common
  repository: oci://registry-1.docker.io/bitnamicharts
  tags:
  - bitnami-common
  version: 2.x.x
description: HAProxy is a TCP proxy and a HTTP reverse proxy. It supports SSL termination
  and offloading, TCP and HTTP normalization, traffic regulation, caching and protection
  against DDoS attacks.
home: https://bitnami.com
icon: https://bitnami.com/assets/stacks/haproxy/img/haproxy-stack-220x234.png
keywords:
- haproxy
- proxy
- infrastructure
maintainers:
- name: Broadcom, Inc. All Rights Reserved.
  url: https://github.com/bitnami/charts
name: haproxy
sources:
- https://github.com/bitnami/charts/tree/main/bitnami/haproxy
version: 2.2.4

# チャートからアプリケーションをデプロイ
# helm install [任意の名称] [チャート名]

[cent@ctrl ~]$
helm install haproxy bitnami/haproxy

NAME: haproxy
LAST DEPLOYED: Thu Jan 23 15:54:33 2025
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
CHART NAME: haproxy
CHART VERSION: 2.2.4
APP VERSION: 3.1.2

Did you know there are enterprise versions of the Bitnami catalog? For enhanced secure software supply chain features, unlimited pulls from Docker, LTS support, or application customization, see Bitnami Premium or Tanzu Application Catalog. See https://www.arrow.com/globalecs/na/vendors/bitnami for more information.

** Please be patient while the chart is being deployed **
1. HAproxy has been started. You can find out the port numbers being used by HAProxy by running:

    $ kubectl describe svc haproxy --namespace default
2. Get HAProxy's load balancer IP/hostname:

    NOTE: It may take a few minutes for this to become available.

    You can watch the status by running:

        $ kubectl get svc haproxy --namespace default -w

    Once 'EXTERNAL-IP' is no longer '<pending>':

        $ kubectl describe svc haproxy --namespace default | grep Ingress | awk '{print $3}'

3. Configure DNS records corresponding to Kubernetes ingress resources to point to the load balancer IP/hostname found in step 3

WARNING: There are "resources" sections in the chart not set. Using "resourcesPreset" is not recommended for production. For production installations, please set the following values according to your workload needs:
  - resources
+info https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/

# デプロイ済みアプリケーションの一覧

[cent@ctrl ~]$
helm list

NAME    NAMESPACE       REVISION        UPDATED                                 STATUS          CHART           APP VERSION
haproxy default         1               2025-01-23 15:54:33.563492193 +0900 JST deployed        haproxy-2.2.4   3.1.2

# デプロイ済みアプリケーションのステータスを表示

[cent@ctrl ~]$
helm status haproxy

NAME: haproxy
LAST DEPLOYED: Thu Jan 23 15:54:33 2025
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
CHART NAME: haproxy
CHART VERSION: 2.2.4
APP VERSION: 3.1.2
.....
.....

[cent@ctrl ~]$
kubectl get pods

NAME                       READY   STATUS    RESTARTS   AGE
haproxy-59b498ddc5-kd642   1/1     Running   0          2m3s

# デプロイ済みアプリケーションをアンインストール

[cent@ctrl ~]$
helm uninstall haproxy

release "haproxy" uninstalled
関連コンテンツ