Skip to content

Commit

Permalink
Merge pull request #5363 from woodcockjosh/add-helm-addon
Browse files Browse the repository at this point in the history
Add helm-tiller addon
  • Loading branch information
tstromberg authored Sep 24, 2019
2 parents fb34a99 + dba30af commit b75d4ab
Show file tree
Hide file tree
Showing 7 changed files with 209 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/minikube/cmd/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,12 @@ var settings = []Setting{
validations: []setFn{IsValidAddon, IsContainerdRuntime},
callbacks: []setFn{EnableOrDisableAddon},
},
{
name: "helm-tiller",
set: SetBool,
validations: []setFn{IsValidAddon},
callbacks: []setFn{EnableOrDisableAddon},
},
{
name: "hyperv-virtual-switch",
set: SetString,
Expand Down
23 changes: 23 additions & 0 deletions deploy/addons/helm-tiller/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## helm-tiller Addon
[Kubernetes Helm](https://helm.sh) - The Kubernetes Package Manager

### Enabling helm-tiller
To enable this addon, simply run:

```shell script
minikube addons enable helm-tiller
```

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.
Each time you start a new minikube instance tiller will be automatically installed.

### Testing installation

```shell script
helm ls
```

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.

### Deprecation of Tiller
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.
83 changes: 83 additions & 0 deletions deploy/addons/helm-tiller/helm-tiller-dp.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Copyright 2019 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: helm
name: tiller
addonmanager.kubernetes.io/mode: Reconcile
kubernetes.io/minikube-addons: helm
name: tiller-deploy
namespace: kube-system
spec:
replicas: 1
selector:
matchLabels:
app: helm
name: tiller
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template:
metadata:
labels:
app: helm
name: tiller
spec:
automountServiceAccountToken: true
containers:
- env:
- name: TILLER_NAMESPACE
value: kube-system
- name: TILLER_HISTORY_MAX
value: "0"
image: gcr.io/kubernetes-helm/tiller:v2.14.3
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 3
httpGet:
path: /liveness
port: 44135
scheme: HTTP
initialDelaySeconds: 1
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
name: tiller
ports:
- containerPort: 44134
name: tiller
protocol: TCP
- containerPort: 44135
name: http
protocol: TCP
readinessProbe:
failureThreshold: 3
httpGet:
path: /readiness
port: 44135
scheme: HTTP
initialDelaySeconds: 1
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
serviceAccount: tiller
serviceAccountName: tiller
42 changes: 42 additions & 0 deletions deploy/addons/helm-tiller/helm-tiller-rbac.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Copyright 2019 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: v1
kind: ServiceAccount
metadata:
name: tiller
namespace: kube-system
labels:
app: helm
name: tiller
addonmanager.kubernetes.io/mode: Reconcile
kubernetes.io/minikube-addons: helm
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1beta1
metadata:
name: tiller-clusterrolebinding
labels:
app: helm
name: tiller
addonmanager.kubernetes.io/mode: Reconcile
kubernetes.io/minikube-addons: helm
subjects:
- kind: ServiceAccount
name: tiller
namespace: kube-system
roleRef:
kind: ClusterRole
name: cluster-admin
apiGroup: ""
34 changes: 34 additions & 0 deletions deploy/addons/helm-tiller/helm-tiller-svc.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright 2019 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

apiVersion: v1
kind: Service
metadata:
labels:
app: helm
name: tiller
addonmanager.kubernetes.io/mode: Reconcile
kubernetes.io/minikube-addons: helm
name: tiller-deploy
namespace: kube-system
spec:
type: ClusterIP
ports:
- name: tiller
port: 44134
protocol: TCP
targetPort: tiller
selector:
app: helm
name: tiller
20 changes: 20 additions & 0 deletions pkg/minikube/assets/addons.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,26 @@ var Addons = map[string]*Addon{
"0640",
true),
}, false, "gvisor"),
"helm-tiller": NewAddon([]*BinAsset{
MustBinAsset(
"deploy/addons/helm-tiller/helm-tiller-dp.tmpl",
constants.GuestAddonsDir,
"helm-tiller-dp.yaml",
"0640",
true),
MustBinAsset(
"deploy/addons/helm-tiller/helm-tiller-rbac.tmpl",
constants.GuestAddonsDir,
"helm-tiller-rbac.yaml",
"0640",
true),
MustBinAsset(
"deploy/addons/helm-tiller/helm-tiller-svc.tmpl",
constants.GuestAddonsDir,
"helm-tiller-svc.yaml",
"0640",
true),
}, false, "helm-tiller"),
}

// AddMinikubeDirAssets adds all addons and files to the list
Expand Down
1 change: 1 addition & 0 deletions site/content/en/docs/Tasks/addons.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ minikube has a set of built-in addons that, when enabled, can be used within Kub
* [logviewer](https://github.com/ivans3/minikube-log-viewer)
* [gvisor](../deploy/addons/gvisor/README.md)
* [storage-provisioner-gluster](../deploy/addons/storage-provisioner-gluster/README.md)
* [helm-tiller](../deploy/addons/helm-tiller/README.md)

## Listing available addons

Expand Down

0 comments on commit b75d4ab

Please sign in to comment.