From 4ef76e0c75de67ff3ed114b09155e695fcf010f2 Mon Sep 17 00:00:00 2001 From: FengyunPan Date: Fri, 21 Apr 2017 10:51:27 +0800 Subject: [PATCH] Specify a dir and attach it to helm for HELM_HOME --- roles/kubernetes-apps/helm/defaults/main.yml | 3 +++ roles/kubernetes-apps/helm/tasks/main.yml | 3 +++ roles/kubernetes-apps/helm/templates/helm-container.j2 | 1 + 3 files changed, 7 insertions(+) diff --git a/roles/kubernetes-apps/helm/defaults/main.yml b/roles/kubernetes-apps/helm/defaults/main.yml index ae139556d..b1b2dfca9 100644 --- a/roles/kubernetes-apps/helm/defaults/main.yml +++ b/roles/kubernetes-apps/helm/defaults/main.yml @@ -1 +1,4 @@ helm_enabled: false + +# specify a dir and attach it to helm for HELM_HOME. +helm_home_dir: "/root/.helm" diff --git a/roles/kubernetes-apps/helm/tasks/main.yml b/roles/kubernetes-apps/helm/tasks/main.yml index 551b0375e..3060bcda2 100644 --- a/roles/kubernetes-apps/helm/tasks/main.yml +++ b/roles/kubernetes-apps/helm/tasks/main.yml @@ -1,4 +1,7 @@ --- +- name: Helm | Make sure HELM_HOME directory exists + file: path={{ helm_home_dir }} state=directory + - name: Helm | Set up helm launcher template: src: helm-container.j2 diff --git a/roles/kubernetes-apps/helm/templates/helm-container.j2 b/roles/kubernetes-apps/helm/templates/helm-container.j2 index 598daa73a..68210ea30 100644 --- a/roles/kubernetes-apps/helm/templates/helm-container.j2 +++ b/roles/kubernetes-apps/helm/templates/helm-container.j2 @@ -3,6 +3,7 @@ --net=host \ --name=helm \ -v /etc/ssl:/etc/ssl:ro \ + -v {{ helm_home_dir }}:{{ helm_home_dir }}:rw \ {% for dir in ssl_ca_dirs -%} -v {{ dir }}:{{ dir }}:ro \ {% endfor -%}