diff --git a/cmd/minikube/cmd/config/config.go b/cmd/minikube/cmd/config/config.go index c282909debe1..15d441b2b8d9 100644 --- a/cmd/minikube/cmd/config/config.go +++ b/cmd/minikube/cmd/config/config.go @@ -248,6 +248,12 @@ var settings = []Setting{ validations: []setFn{IsValidAddon, IsContainerdRuntime}, callbacks: []setFn{EnableOrDisableAddon}, }, + { + name: "helm", + set: SetBool, + validations: []setFn{IsValidAddon}, + callbacks: []setFn{EnableOrDisableAddon}, + }, { name: "hyperv-virtual-switch", set: SetString, diff --git a/deploy/addons/helm/helm-dp.tmpl b/deploy/addons/helm/helm-dp.tmpl new file mode 100644 index 000000000000..c130220e7926 --- /dev/null +++ b/deploy/addons/helm/helm-dp.tmpl @@ -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 \ No newline at end of file diff --git a/deploy/addons/helm/helm-rbac.tmpl b/deploy/addons/helm/helm-rbac.tmpl new file mode 100644 index 000000000000..1cc15e26f4fb --- /dev/null +++ b/deploy/addons/helm/helm-rbac.tmpl @@ -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: "" \ No newline at end of file diff --git a/deploy/addons/helm/helm-svc.tmpl b/deploy/addons/helm/helm-svc.tmpl new file mode 100644 index 000000000000..b115b284fa07 --- /dev/null +++ b/deploy/addons/helm/helm-svc.tmpl @@ -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 \ No newline at end of file diff --git a/pkg/minikube/assets/addons.go b/pkg/minikube/assets/addons.go index 47cd7eb5122b..177c9c5bd58a 100644 --- a/pkg/minikube/assets/addons.go +++ b/pkg/minikube/assets/addons.go @@ -327,6 +327,26 @@ var Addons = map[string]*Addon{ "0640", true), }, false, "gvisor"), + "helm": NewAddon([]*BinAsset{ + MustBinAsset( + "deploy/addons/helm/helm-dp.tmpl", + constants.GuestAddonsDir, + "helm-dp.yaml", + "0640", + true), + MustBinAsset( + "deploy/addons/helm/helm-rbac.tmpl", + constants.GuestAddonsDir, + "helm-rbac.yaml", + "0640", + true), + MustBinAsset( + "deploy/addons/helm/helm-svc.tmpl", + constants.GuestAddonsDir, + "helm-svc.yaml", + "0640", + true), + }, false, "helm"), } // AddMinikubeDirAssets adds all addons and files to the list