Add Helm 3.x support (#5441)

* Add Helm 3.x support

* tiller enabled when helm < 3.0.0
pull/5447/head
Bort Verwilst 2019-12-12 18:24:32 +01:00 committed by Kubernetes Prow Robot
parent f0f8379e1b
commit db2ca014cb
4 changed files with 18 additions and 3 deletions

View File

@ -177,6 +177,10 @@ in the form of dicts of key-value pairs of configuration parameters that will be
* *kube_kubeadm_controller_extra_args* * *kube_kubeadm_controller_extra_args*
* *kube_kubeadm_scheduler_extra_args* * *kube_kubeadm_scheduler_extra_args*
## App variables
* *helm_version* - Defaults to v2.x, set to a v3 version (e.g. `v3.0.1` ) to install Helm 3.x (no more Tiller!). When changing this to 3 in an existing cluster, Tiller will be left alone and has to be removed manually.
## User accounts ## User accounts
By default, a user with admin rights is created, named `kube`. By default, a user with admin rights is created, named `kube`.

View File

@ -364,7 +364,7 @@ test_image_repo: "{{ docker_image_repo }}/library/busybox"
test_image_tag: latest test_image_tag: latest
busybox_image_repo: "{{ docker_image_repo }}/library/busybox" busybox_image_repo: "{{ docker_image_repo }}/library/busybox"
busybox_image_tag: 1.29.2 busybox_image_tag: 1.29.2
helm_version: "v2.16.0" helm_version: "v2.16.1"
helm_image_repo: "{{ docker_image_repo }}/lachlanevenson/k8s-helm" helm_image_repo: "{{ docker_image_repo }}/lachlanevenson/k8s-helm"
helm_image_tag: "{{ helm_version }}" helm_image_tag: "{{ helm_version }}"
tiller_image_repo: "{{ gcr_image_repo }}/kubernetes-helm/tiller" tiller_image_repo: "{{ gcr_image_repo }}/kubernetes-helm/tiller"
@ -793,7 +793,7 @@ downloads:
- kube-node - kube-node
tiller: tiller:
enabled: "{{ helm_enabled }}" enabled: "{{ helm_enabled and helm_version is version('v3.0.0', '<') }}"
container: true container: true
repo: "{{ tiller_image_repo }}" repo: "{{ tiller_image_repo }}"
tag: "{{ tiller_image_tag }}" tag: "{{ tiller_image_tag }}"

View File

@ -17,6 +17,7 @@
when: when:
- dns_mode != 'none' - dns_mode != 'none'
- inventory_hostname == groups['kube-master'][0] - inventory_hostname == groups['kube-master'][0]
- helm_version is version('v3.0.0', '<')
- name: Helm | Apply Helm Manifests (RBAC) - name: Helm | Apply Helm Manifests (RBAC)
kube: kube:
@ -30,11 +31,14 @@
when: when:
- dns_mode != 'none' - dns_mode != 'none'
- inventory_hostname == groups['kube-master'][0] - inventory_hostname == groups['kube-master'][0]
- helm_version is version('v3.0.0', '<')
# Generate necessary certs for securing Helm and Tiller connection with TLS # Generate necessary certs for securing Helm and Tiller connection with TLS
- name: Helm | Set up TLS - name: Helm | Set up TLS
include_tasks: "gen_helm_tiller_certs.yml" include_tasks: "gen_helm_tiller_certs.yml"
when: tiller_enable_tls when:
- tiller_enable_tls
- helm_version is version('v3.0.0', '<')
- name: Helm | Install client on all masters - name: Helm | Install client on all masters
command: > command: >
@ -44,6 +48,8 @@
--client-only --client-only
environment: "{{ proxy_env }}" environment: "{{ proxy_env }}"
changed_when: false changed_when: false
when:
- helm_version is version('v3.0.0', '<')
# FIXME: https://github.com/helm/helm/issues/6374 # FIXME: https://github.com/helm/helm/issues/6374
- name: Helm | Install/upgrade helm - name: Helm | Install/upgrade helm
@ -67,6 +73,7 @@
register: install_helm register: install_helm
when: when:
- inventory_hostname == groups['kube-master'][0] - inventory_hostname == groups['kube-master'][0]
- helm_version is version('v3.0.0', '<')
changed_when: false changed_when: false
environment: "{{ proxy_env }}" environment: "{{ proxy_env }}"
@ -91,6 +98,7 @@
changed_when: false changed_when: false
when: when:
- inventory_hostname == groups['kube-master'][0] - inventory_hostname == groups['kube-master'][0]
- helm_version is version('v3.0.0', '<')
environment: "{{ proxy_env }}" environment: "{{ proxy_env }}"
- name: Make sure bash_completion.d folder exists - name: Make sure bash_completion.d folder exists

View File

@ -8,3 +8,6 @@ container_manager: containerd
etcd_deployment_type: host etcd_deployment_type: host
deploy_netchecker: true deploy_netchecker: true
dns_min_replicas: 1 dns_min_replicas: 1
helm_enabled: true
helm_version: v3.0.1