3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Windowsでhelmを使う

Posted at

環境

  • Windows10 Pro
  • minikube

helmとは

  • k8s用のパッケージマネージャー Linuxでyumとかにあたるもの
  • kubectlコマンドでymalファイルを使う場合、そのyamlファイルを作ってあげないといけない。それらの置き場所がインターネット上のリポジトリにあり、そこを参照してダウンロード、デプロイまでしてくれる

手順

準備

mkdir C:\tools\helm\
Invoke-WebRequest -Uri https://storage.googleapis.com/kubernetes-helm/helm-v2.13.0-windows-amd64.zip -OutFile C:\tools\helm\helm-v2.13.0-windows-amd64.zip
cd C:\tools\helm\
Expand-Archive -Path C:\tools\helm\helm-v2.13.0-windows-amd64.zip
move .\helm-v2.13.0-windows-amd64\windows-amd64\helm.exe .

環境変数設定

image.png

初期設定

helm init

インストール確認

helm version

サンプルアプリケーションをデプロイする

こちらを参考

クラスタロールを作成する

Tillerを使うために必要で、helmコマンド実行時に動作するPod。
helmでデプロイされるPodたちを管理するPod的なイメージだと思う

clusterrole.yaml
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  annotations:
    rbac.authorization.kubernetes.io/autoupdate: "true"
  labels:
    kubernetes.io/bootstrapping: rbac-defaults
  name: cluster-admin
rules:
- apiGroups:
  - '*'
  resources:
  - '*'
  verbs:
  - '*'
- nonResourceURLs:
  - '*'
  verbs:
  - '*'

クラスタロールをデプロイ

kubectl create -f .\cluserrole.yaml
.\kubectl.exe create serviceaccount -n kube-system tiller
.\kubectl.exe create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
helm init --service-account tiller

デプロイされているか確認

.\kubectl.exe --namespace kube-system get pods

Redisをインストール

helm install stable/redis --set serviceType=NodePort

デプロイされているか確認

PS C:\Users\yuta> .\kubectl.exe get pod
NAME                             READY   STATUS    RESTARTS   AGE
linting-sparrow-redis-master-0   1/1     Running   0          88s
linting-sparrow-redis-slave-0    1/1     Running   0          88s
linting-sparrow-redis-slave-1    1/1     Running   0          32s
PS C:\Users\yuta>
3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?