command: helm init --client-only --local-repo-url {{ local_repo_url }} --stable-repo-url {{ stable_repo_url }}
register: helm_init_result
changed_when: true
+ when: helm_version is version('v3', '<')
+
+- name: Check if stable helm repo exists (helm v3+)
+ command: "helm repo list"
+ changed_when: true
+ failed_when: false
+ register: helm_repo_list_result
+
+- name: Add stable helm repo (helm v3+)
+ command: "helm repo add stable {{ stable_repo_url }}"
+ register: helm_repo_add_stable_result
+ changed_when: true
+ when: >
+ helm_version is version('v3.0.0', '>=')
+ and execution_mode == "online-deployment"
+ and helm_repo_list_result is not search(stable_repo_url)
- name: Clone Helm Charts repository
git:
- name: Install Prometheus using helm
command: >
helm install
- --name "{{ prometheus_service }}"
+ {% if helm_version is version('v3.0.0', '<') %} --name {% endif %}"{{ prometheus_service }}"
--namespace "{{ prometheus_namespace }}"
- --timeout 900
+ --timeout "900{% if helm_version is version('v3.0.0', '>=') %}s{% endif %}"
{{ config_path }}/repos/charts/stable/prometheus
register: prometheus_helm_log
changed_when: true
command: helm init --client-only --local-repo-url {{ local_repo_url }} --stable-repo-url {{ stable_repo_url }}
register: helm_init_result
changed_when: true
+ when: helm_version is version('v3', '<')
+
+- name: Check if stable helm repo exists (helm v3+)
+ command: "helm repo list"
+ changed_when: true
+ failed_when: false
+ register: helm_repo_list_result
+
+- name: Add stable helm repo (helm v3+)
+ command: "helm repo add stable {{ stable_repo_url }}"
+ register: helm_repo_add_stable_result
+ changed_when: true
+ when: >
+ helm_version is version('v3.0.0', '>=')
+ and execution_mode == "online-deployment"
+ and helm_repo_list_result is not search(stable_repo_url)
- name: Clone Helm Charts repository
git:
- name: Install Spinnaker using helm
command: >
helm install
- --name "{{ spinnaker_service }}"
+ {% if helm_version is version('v3.0.0', '<')%} --name {% endif %}"{{ spinnaker_service }}"
--namespace "{{ spinnaker_namespace }}"
- --timeout 900
+ --timeout "900{% if helm_version is version('v3.0.0', '>=') %}s{% endif %}"
{{ engine_cache }}/repos/charts/stable/spinnaker
register: spinnaker_helm_log
changed_when: true
- nodelocaldns
- pod_infra
- registry_proxy
- - tiller
- weave_kube
- weave_npc
become: true
changed_when: false
+- name: Pull tiller container image (helm v2 only)
+ command: "docker pull {{ downloads['tiller'].repo }}:{{ downloads['tiller'].tag }}"
+ become: true
+ changed_when: false
+ when: helm_version is version('v3.0.0', '<')
+
- name: Pull misc container images
command: "docker pull {{ downloads[item].repo }}:{{ downloads[item].tag }}"
loop: "{{ k8s_misc_images }}"
become: true
changed_when: false
+- name: Save tiller container image (helm v2 only)
+ command: |-
+ docker save {{ downloads['tiller'].repo }}:{{ downloads['tiller'].tag }}
+ -o {{ downloads['tiller'].repo }} -o {{ downloads['tiller'].repo | replace('/', '_') }}_{{ downloads['tiller'].tag }}.tar
+ args:
+ chdir: "{{ containers_folder }}"
+ become: true
+ changed_when: false
+ when: helm_version is version('v3.0.0', '<')
+
- name: Save other container images
command: |-
docker save {{ other_images[item.key].repo }}:{{ other_images[item.key].tag }}
remote_src: true
dest: /tmp
-- name: Place helm and tiller binaries to /usr/local/bin
+- name: Place helm binaries to /usr/local/bin
copy:
- src: "/tmp/linux-amd64/{{ item }}"
+ src: "/tmp/linux-amd64/helm"
remote_src: true
- dest: "/usr/local/bin/{{ item }}"
+ dest: "/usr/local/bin/helm"
owner: root
group: root
mode: 0755
- with_items:
- - helm
- - tiller
+
+- name: Place tiller binaries to /usr/local/bin
+ copy:
+ src: "/tmp/linux-amd64/tiller"
+ remote_src: true
+ dest: "/usr/local/bin/tiller"
+ owner: root
+ group: root
+ mode: 0755
+ when: helm_version is version('v3.0.0', '<')
- name: Delete temporary files and folders
file:
src: "{{ engine_cache }}/repos/kubespray/inventory/engine/artifacts/admin.conf"
dest: "/home/{{ ansible_env.SUDO_USER }}/.kube/config"
owner: "{{ ansible_env.SUDO_USER }}"
- mode: 0644
+ mode: 0600
- name: Download kubectl and place it to /usr/local/bin
get_url:
remote_src: true
dest: /tmp
-- name: Place helm and tiller binaries to /usr/local/bin
+- name: Place helm binaries to /usr/local/bin
copy:
- src: "/tmp/linux-amd64/{{ item }}"
+ src: "/tmp/linux-amd64/helm"
remote_src: true
- dest: "/usr/local/bin/{{ item }}"
+ dest: "/usr/local/bin/helm"
owner: root
group: root
mode: 0755
- with_items:
- - helm
- - tiller
+
+- name: Place tiller binaries to /usr/local/bin
+ copy:
+ src: "/tmp/linux-amd64/tiller"
+ remote_src: true
+ dest: "/usr/local/bin/tiller"
+ owner: root
+ group: root
+ mode: 0755
+ when: helm_version is version('v3.0.0', '<')
- name: Delete temporary files and folders
file:
# -------------------------------------------------------------------------------
# Kubernetes: App versions
# -------------------------------------------------------------------------------
-helm_version: "v2.16.1"
+helm_version: "v3.3.4"
charts_version: "0b64349aeb537d0fd038df0e1d40ec5cf1206609"
istio_version: "1.3.1"