Kubernetes : Helm インストール2023/07/28 |
Helm をインストールすると、Kubernetes アプリケーションのイントール等々の管理が容易になります。 当例では以下のように 3 台のノードを使用して Kubernetes クラスターを構成しています。 -----------+---------------------------+--------------------------+------------ | | | eth0|10.0.0.25 eth0|10.0.0.71 eth0|10.0.0.72 +----------+-----------+ +-----------+-----------+ +-----------+-----------+ | [ ctrl.srv.world ] | | [snode01.srv.world] | | [snode02.srv.world] | | Control Plane | | Worker Node | | Worker Node | +----------------------+ +-----------------------+ +-----------------------+ |
[1] | Helm をインストールします。 |
root@ctrl:~#
curl -O https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
root@ctrl:~#
root@ctrl:~# bash ./get-helm-3 Downloading https://get.helm.sh/helm-v3.12.2-linux-amd64.tar.gz Verifying checksum... Done. Preparing to install helm into /usr/local/bin helm installed into /usr/local/bin/helm helm version version.BuildInfo{Version:"v3.12.2", GitCommit:"1e210a2c8cc5117d1055bfaa5d40f51bbc2e345e", GitTreeState:"clean", GoVersion:"go1.20.5"} |
[2] | Helm の基本操作です。 |
# Helm Hub からキーワードが含まれるチャートを検索 root@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/shubham-wo... 0.1.0 1.16.0 A Helm chart for Kubernetes ..... ..... # リポジトリを追加 # 以下はオフィシャル Helm Stable リポジトリ root@ctrl:~# helm repo add stable https://charts.helm.sh/stable "stable" has been added to your repositories root@ctrl:~# helm repo add bitnami https://charts.bitnami.com/bitnami "bitnami" has been added to your repositories # リポジトリ一覧 root@ctrl:~# helm repo list NAME URL stable https://charts.helm.sh/stable bitnami https://charts.bitnami.com/bitnami # リポジトリからキーワードが含まれるチャートを検索 root@ctrl:~# helm search repo stable 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.3.5 v4.5.0.5 DEPRECATED A Helm chart for Aerospike in Kubern... stable/airflow 7.13.3 1.10.12 DEPRECATED - please use: https://github.com/air... stable/ambassador 5.3.2 0.86.1 DEPRECATED A Helm chart for Datawire Ambassador stable/anchore-engine 1.7.0 0.7.3 Anchore container analysis and policy evaluatio... stable/apm-server 2.1.7 7.0.0 DEPRECATED The server receives data from the El... ..... ..... # チャートの情報を表示 # helm show [all|chart|readme|values] [チャート名] root@ctrl:~# helm show chart bitnami/wordpress annotations: category: CMS licenses: Apache-2.0 apiVersion: v2 appVersion: 6.2.2 dependencies: - condition: memcached.enabled name: memcached repository: oci://registry-1.docker.io/bitnamicharts version: 6.x.x - condition: mariadb.enabled name: mariadb repository: oci://registry-1.docker.io/bitnamicharts version: 12.x.x - name: common repository: oci://registry-1.docker.io/bitnamicharts 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://bitnami.com icon: https://bitnami.com/assets/stacks/wordpress/img/wordpress-stack-220x234.png keywords: - application - blog - cms - http - php - web - wordpress maintainers: - name: VMware, Inc. url: https://github.com/bitnami/charts name: wordpress sources: - https://github.com/bitnami/charts/tree/main/bitnami/wordpress version: 16.1.34 # チャートからアプリケーションをデプロイ # helm install [任意の名称] [チャート名] root@ctrl:~# helm install wordpress bitnami/wordpress NAME: wordpress LAST DEPLOYED: Fri Jul 28 01:28:20 2023 NAMESPACE: default STATUS: deployed REVISION: 1 TEST SUITE: None NOTES: CHART NAME: wordpress CHART VERSION: 16.1.34 APP VERSION: 6.2.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 --template "{{ 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@ctrl:~# helm list NAME NAMESPACE REVISION UPDATED STATUS CHART APP VERSION wordpress default 1 2023-07-28 01:28:20.140568936 -0500 CDT deployed wordpress-16.1.34 6.2.2 # デプロイ済みアプリケーションのステータスを表示 root@ctrl:~# helm status wordpress NAME: wordpress LAST DEPLOYED: Fri Jul 28 01:28:20 2023 NAMESPACE: default STATUS: deployed REVISION: 1 TEST SUITE: None NOTES: CHART NAME: wordpress CHART VERSION: 16.1.34 APP VERSION: 6.2.2 ..... ..... # デプロイ済みアプリケーションをアンインストール root@ctrl:~# helm uninstall wordpress release "registry" uninstalled |
Sponsored Link |