Ubuntu 22.04
Sponsored Link

MicroK8s : Helm3 を有効にする2022/09/02

 
MicroK8s ビルトイン の Helm3 を有効にする場合は以下のように設定します。
[1] プライマリーノードで、Helm3 アドオンを有効にします。
root@dlp:~#
microk8s enable helm3

Infer repository core for addon helm3
Enabling Helm 3
Fetching helm version v3.8.0.
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 12.9M  100 12.9M    0     0  4497k      0  0:00:02  0:00:02 --:--:-- 4497k
Helm 3 is enabled

root@dlp:~#
microk8s helm3 version

WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /var/snap/microk8s/3597/credentials/client.config
version.BuildInfo{Version:"v3.8.0", GitCommit:"d14138609b01886f544b2025f5000351c9eb092e", GitTreeState:"clean", GoVersion:"go1.17.5"}
[2] Helm3 の基本操作です。
# Helm Hub からキーワードが含まれるチャートを検索

root@dlp:~#
microk8s helm3 search hub wordpress

URL                                                     CHART VERSION   APP VERSION             DESCRIPTION                     
https://artifacthub.io/packages/helm/kube-wordp...      0.1.0           1.1                     this is my wordpress package    
https://artifacthub.io/packages/helm/bitnami/wo...      15.1.5          6.0.2                   WordPress is the world's most popular blogging ...
https://artifacthub.io/packages/helm/bitnami-ak...      15.0.19         6.0.1                   WordPress is the world's most popular blogging ...
.....
.....

# リポジトリを追加
# 以下は以前のオフィシャル Stable リポジトリに代わるリポジトリ

root@dlp:~#
microk8s helm3 repo add bitnami https://charts.bitnami.com/bitnami

$ helm install my-release bitnami/<chart>           # Helm 3

# リポジトリ一覧

root@dlp:~#
microk8s helm3 repo list

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

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

root@dlp:~#
microk8s helm3 search repo bitnami

NAME                                            CHART VERSION   APP VERSION     DESCRIPTION                                     
bitnami/airflow                                 13.1.3          2.3.4           Apache Airflow is a tool to express and execute...
bitnami/apache                                  9.2.2           2.4.54          Apache HTTP Server is an open-source HTTP serve...
bitnami/argo-cd                                 4.1.2           2.4.8           Argo CD is a continuous delivery tool for Kuber...
bitnami/argo-workflows                          2.4.2           3.3.9           Argo Workflows is meant to orchestrate Kubernet...
bitnami/aspnet-core                             3.5.2           6.0.8           ASP.NET Core is an open-source framework for we...
.....
.....

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

root@dlp:~#
microk8s helm3 show chart bitnami/wordpress

annotations:
  category: CMS
apiVersion: v2
appVersion: 6.0.2
dependencies:
- condition: memcached.enabled
  name: memcached
  repository: https://charts.bitnami.com/bitnami
  version: 6.x.x
- condition: mariadb.enabled
  name: mariadb
  repository: https://charts.bitnami.com/bitnami
  version: 11.x.x
- name: common
  repository: https://charts.bitnami.com/bitnami
  tags:
  - bitnami-common
  version: 2.x.x
description: WordPress is the world's most popular blogging and content management
  platform. Powerful yet simple, everyone from students to global corporations use
  it to build beautiful, functional websites.
home: https://github.com/bitnami/charts/tree/master/bitnami/wordpress
icon: https://bitnami.com/assets/stacks/wordpress/img/wordpress-stack-220x234.png
keywords:
- application
- blog
- cms
- http
- php
- web
- wordpress
maintainers:
- name: Bitnami
  url: https://github.com/bitnami/charts
name: wordpress
sources:
- https://github.com/bitnami/containers/tree/main/bitnami/wordpress
- https://wordpress.org/
version: 15.1.5

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

root@dlp:~#
microk8s helm3 install wordpress bitnami/wordpress

NAME: wordpress
LAST DEPLOYED: Fri Sep  2 07:36:13 2022
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
CHART NAME: wordpress
CHART VERSION: 15.1.5
APP VERSION: 6.0.2

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

Your WordPress site can be accessed through the following DNS name from within your cluster:

    wordpress.default.svc.cluster.local (port 80)

To access your WordPress site from outside the cluster follow the steps below:

1. Get the WordPress URL by running these commands:

  NOTE: It may take a few minutes for the LoadBalancer IP to be available.
        Watch the status with: 'kubectl get svc --namespace default -w wordpress'

   export SERVICE_IP=$(kubectl get svc --namespace default wordpress --include "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}")
   echo "WordPress URL: http://$SERVICE_IP/"
   echo "WordPress Admin URL: http://$SERVICE_IP/admin"

2. Open a browser and access WordPress using the obtained URL.

3. Login with the following credentials below to see your blog:

  echo Username: user
  echo Password: $(kubectl get secret --namespace default wordpress -o jsonpath="{.data.wordpress-password}" | base64 -d)

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

root@dlp:~#
microk8s helm3 list

NAME            NAMESPACE       REVISION        UPDATED                                 STATUS          CHART                  APP VERSION
wordpress       default         1               2022-09-02 07:36:13.018733392 +0000 UTC deployed        wordpress-15.1.5       6.0.2

root@dlp:~#
microk8s kubectl get pods

NAME                                   READY   STATUS    RESTARTS   AGE
wordpress-mariadb-0           0/1     Running   0          35s
wordpress-67885bf5cb-x59f9    0/1     Running   0          35s

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

root@dlp:~#
microk8s helm3 status wordpress

NAME: wordpress
LAST DEPLOYED: Fri Sep  2 07:36:13 2022
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
NOTES:
CHART NAME: wordpress
CHART VERSION: 15.1.5
APP VERSION: 6.0.2
.....
.....

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

root@dlp:~#
microk8s helm3 uninstall wordpress

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