Helm is the package manager for Kubernetes, you can think it as yum/apt/homebrew. It contains two parts: Server (tiller) and Client (helm). helm client can be installed on Linux/Mac/Windows, the package can be found here.
Helm manages the Kubernetes charts which are pre-configured Kubernetes resources. In the following example, I will show you how to install Prometheus by using helm.
-
- Setup RABC for helm (tiller) to use, the sample config file:
apiVersion: v1 kind: ServiceAccount metadata: name: tiller namespace: kube-system --- apiVersion: rbac.authorization.k8s.io/v1beta1 kind: ClusterRoleBinding metadata: name: tiller roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: cluster-admin subjects: - kind: ServiceAccount name: tiller namespace: kube-system
- Initialize helm and update repository
helm init --service-account tiller helm repo update
- Install Prometheus and configure the ingress for the services. I use the Kubernetes cluster that is built by kops, and I will continue use the example domain k8s-01.nprod.my.com. Please change it accordingly.
helm install stable/Prometheus \ --set alertmanager.ingress.enabled=true \ --set "alertmanager.ingress.hosts={alertmanager.k8s-01.nprod.my.com}" \ --set pushgateway.ingress.enabled=true \ --set "pushgateway.ingress.hosts={pushgateway.k8s-01.nprod.my.com}" \ --set server.ingress.enabled=true \ --set "server.ingress.hosts={server.k8s-01.nprod.my.com}"
- If you installed it successfully, it should like this:
- Add alias records in Route 53 for server.k8s-01.nprod.my.com and other services to point to ELB. Then test it, you should see the Prometheus page.
- Setup RABC for helm (tiller) to use, the sample config file: