Welcome to new things

[Technical] [Electronic work] [Gadget] [Game] memo writing

Notes on how to use Helm, a Kubernetes package manager

There is a Kubernetes package manager called Helm.

I don't use it that often, but every time I search for how to use it, I make a note of it for myself.

What is Helm?

When adding functionality to Kubernetes, deploy it to the cluster with a YAML file and the kubectl create -f command, just as you would deploy an app.

If there are multiple related resources, it is necessary to edit and deploy a YAML file for each.

Helm is a tool that allows you to template these various deployments that are connected to each other, and to put them all together in a single command.

Configuration values can be changed in parts, mistakes in editing YAML files are less likely to occur, and once deployed, they can be deleted at once.

install

The official website is as follows

binary install

Install the Helm client on a local machine.

Download the file, unzip it, and put the binary in your path, but the following command will do it for you.

curl -L https://git.io/get_helm.sh | bash

The "get_helm.sh" file remains, so delete it.

Create Account

Create a Helm account "tiller" on Kubernates and attach admi authority.

rbac-config.yaml

apiVersion: v1
kind: ServiceAccount
metadata:
  name: tiller
  namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: tiller
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: cluster-admin
subjects:
  - kind: ServiceAccount
    name: tiller
    namespace: kube-system
kubectl create -f rbac-config.yaml

Helm Settings

Set up Helm with the account "tiller" you created.

helm init --service-account tiller --history-max 200

You should add "--history-max 200".

tiller削除

Remove tiller from Kubernetes cluster (to use when starting over from tiller installation)

helm reset -f

Helm Usage

Update repositories to the latest version

helm repo update

package installation

helm install <パッケージ名>

This will give the release a name of *your own accord, so if you want to specify a release name, use the following. (*The name is really given without permission.)

helm install <パッケージ名> --name <リリース名>

Install by namespace specification

helm install <パッケージ名> --namespace <ネームスペース名>

Set parameter values and install

helm install <パッケージ名> \
  --set a=b  # Set {a:b} \c}
  --set a=b,c=d  # Set {a:b, c:d} \cH:d}
  --set a.b=c  # Set {a:{b:c}} \c
  --set a={b,c}  # {a:[b, c]} set\

Parameter values may be read from an external file

helm install <パッケージ名> \
  -f <パラメータYAMLファイル> \

It is safer to file when there are a wide variety of parameters.

Parameter Confirmation

Display of parameter information that can be set in the package

helm inspect values <パッケージ名>

Customize the parameters displayed here by partially overwriting and updating them with "--set" or "-f".

Remove installed packages

helm delete <リリース名> --purge

Confirmation of installed packages

status indication

helm status <リリース名>

Confirmation of set parameters

helm get values <リリース名>

(a) look

helm list --all

Displayed only during operation

helm list

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com