Skip to content

Commit d81e8e9

Browse files
author
Josh Woodcock
committed
Add helm addon
1 parent b73ec8c commit d81e8e9

File tree

7 files changed

+209
-0
lines changed

7 files changed

+209
-0
lines changed

Diff for: cmd/minikube/cmd/config/config.go

+6
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,12 @@ var settings = []Setting{
248248
validations: []setFn{IsValidAddon, IsContainerdRuntime},
249249
callbacks: []setFn{EnableOrDisableAddon},
250250
},
251+
{
252+
name: "helm",
253+
set: SetBool,
254+
validations: []setFn{IsValidAddon},
255+
callbacks: []setFn{EnableOrDisableAddon},
256+
},
251257
{
252258
name: "hyperv-virtual-switch",
253259
set: SetString,

Diff for: deploy/addons/helm/README.md

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## helm Addon
2+
[Kubernetes Helm](https://helm.sh) - The Kubernetes Package Manager
3+
4+
### Enabling helm
5+
To enable this addon, simply run:
6+
7+
```shell script
8+
minikube addons enable helm
9+
```
10+
11+
In a minute or so tiller will be installed into your cluster. You could run `helm init` each time you create a new minikube instance or you could just enable this addon.
12+
Each time you start a new minikube instance tiller will be automatically installed.
13+
14+
### Testing installation
15+
16+
```shell script
17+
helm ls
18+
```
19+
20+
If everything wen't well you shouldn't get any errors about tiller not being installed in your cluster. If you haven't deployed any releases `helm ls` won't return anything.
21+
22+
### Deprecation of Tiller
23+
When tiller is finally deprecated this addon won't be necessary anymore. If your version of helm doesn't use tiller, you don't need this addon.

Diff for: deploy/addons/helm/helm-dp.tmpl

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# Copyright 2019 The Kubernetes Authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
apiVersion: apps/v1
16+
kind: Deployment
17+
metadata:
18+
labels:
19+
app: helm
20+
name: tiller
21+
addonmanager.kubernetes.io/mode: Reconcile
22+
kubernetes.io/minikube-addons: helm
23+
name: tiller-deploy
24+
namespace: kube-system
25+
spec:
26+
replicas: 1
27+
selector:
28+
matchLabels:
29+
app: helm
30+
name: tiller
31+
strategy:
32+
rollingUpdate:
33+
maxSurge: 1
34+
maxUnavailable: 1
35+
type: RollingUpdate
36+
template:
37+
metadata:
38+
labels:
39+
app: helm
40+
name: tiller
41+
spec:
42+
automountServiceAccountToken: true
43+
containers:
44+
- env:
45+
- name: TILLER_NAMESPACE
46+
value: kube-system
47+
- name: TILLER_HISTORY_MAX
48+
value: "0"
49+
image: gcr.io/kubernetes-helm/tiller:v2.14.3
50+
imagePullPolicy: IfNotPresent
51+
livenessProbe:
52+
failureThreshold: 3
53+
httpGet:
54+
path: /liveness
55+
port: 44135
56+
scheme: HTTP
57+
initialDelaySeconds: 1
58+
periodSeconds: 10
59+
successThreshold: 1
60+
timeoutSeconds: 1
61+
name: tiller
62+
ports:
63+
- containerPort: 44134
64+
name: tiller
65+
protocol: TCP
66+
- containerPort: 44135
67+
name: http
68+
protocol: TCP
69+
readinessProbe:
70+
failureThreshold: 3
71+
httpGet:
72+
path: /readiness
73+
port: 44135
74+
scheme: HTTP
75+
initialDelaySeconds: 1
76+
periodSeconds: 10
77+
successThreshold: 1
78+
timeoutSeconds: 1
79+
resources: {}
80+
terminationMessagePath: /dev/termination-log
81+
terminationMessagePolicy: File
82+
serviceAccount: tiller
83+
serviceAccountName: tiller

Diff for: deploy/addons/helm/helm-rbac.tmpl

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Copyright 2019 The Kubernetes Authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
apiVersion: v1
16+
kind: ServiceAccount
17+
metadata:
18+
name: tiller
19+
namespace: kube-system
20+
labels:
21+
app: helm
22+
name: tiller
23+
addonmanager.kubernetes.io/mode: Reconcile
24+
kubernetes.io/minikube-addons: helm
25+
---
26+
kind: ClusterRoleBinding
27+
apiVersion: rbac.authorization.k8s.io/v1beta1
28+
metadata:
29+
name: tiller-clusterrolebinding
30+
labels:
31+
app: helm
32+
name: tiller
33+
addonmanager.kubernetes.io/mode: Reconcile
34+
kubernetes.io/minikube-addons: helm
35+
subjects:
36+
- kind: ServiceAccount
37+
name: tiller
38+
namespace: kube-system
39+
roleRef:
40+
kind: ClusterRole
41+
name: cluster-admin
42+
apiGroup: ""

Diff for: deploy/addons/helm/helm-svc.tmpl

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Copyright 2019 The Kubernetes Authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
apiVersion: v1
16+
kind: Service
17+
metadata:
18+
labels:
19+
app: helm
20+
name: tiller
21+
addonmanager.kubernetes.io/mode: Reconcile
22+
kubernetes.io/minikube-addons: helm
23+
name: tiller-deploy
24+
namespace: kube-system
25+
spec:
26+
type: ClusterIP
27+
ports:
28+
- name: tiller
29+
port: 44134
30+
protocol: TCP
31+
targetPort: tiller
32+
selector:
33+
app: helm
34+
name: tiller

Diff for: pkg/minikube/assets/addons.go

+20
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,26 @@ var Addons = map[string]*Addon{
327327
"0640",
328328
true),
329329
}, false, "gvisor"),
330+
"helm": NewAddon([]*BinAsset{
331+
MustBinAsset(
332+
"deploy/addons/helm/helm-dp.tmpl",
333+
constants.GuestAddonsDir,
334+
"helm-dp.yaml",
335+
"0640",
336+
true),
337+
MustBinAsset(
338+
"deploy/addons/helm/helm-rbac.tmpl",
339+
constants.GuestAddonsDir,
340+
"helm-rbac.yaml",
341+
"0640",
342+
true),
343+
MustBinAsset(
344+
"deploy/addons/helm/helm-svc.tmpl",
345+
constants.GuestAddonsDir,
346+
"helm-svc.yaml",
347+
"0640",
348+
true),
349+
}, false, "helm"),
330350
}
331351

332352
// AddMinikubeDirAssets adds all addons and files to the list

Diff for: site/content/en/docs/Tasks/addons.md

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ minikube has a set of built-in addons that, when enabled, can be used within Kub
2222
* [logviewer](https://github.com/ivans3/minikube-log-viewer)
2323
* [gvisor](../deploy/addons/gvisor/README.md)
2424
* [storage-provisioner-gluster](../deploy/addons/storage-provisioner-gluster/README.md)
25+
* [helm](../deploy/addons/helm/README.md)
2526

2627
## Listing available addons
2728

0 commit comments

Comments
 (0)