Created
November 3, 2017 12:04
-
-
Save wknapik/3b93d93053de458fbc2114cd5a7199b6 to your computer and use it in GitHub Desktop.
Set up a tunnel to tiller to use with the ansible helm module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- set_fact: | |
tun_pid_file: ... | |
- name: set up a tunnel to tiller | |
shell: | | |
tiller_pod="$(kubectl get pod -l app=helm,name=tiller --namespace kube-system -o name|cut -d/ -f2)" | |
nohup kubectl port-forward "$tiller_pod" 44134:44134 --namespace kube-system </dev/null >/dev/null 2>&1 & | |
echo "$!" >{{ tun_pid_file|quote }} | |
creates: "{{ tun_pid_file }}" | |
- helm: ... | |
- name: tear down the tunnel to tiller | |
shell: | | |
kill "$(cat {{ tun_pid_file|quote }})" || true | |
rm -f {{ tun_pid_file|quote }} | |
removes: "{{ tun_pid_file }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just stumbled upon with this after two days without understand why helm Ansible module is not working.
This saved my day. This should be on Ansible official repository!