diff options
author | Michal Zegan <m.zegan@samsung.com> | 2019-04-23 16:34:58 +0200 |
---|---|---|
committer | Petr OspalĂ˝ <p.ospaly@partner.samsung.com> | 2019-05-17 08:09:57 +0000 |
commit | 119f760bc517ca037fbbc90bc741902c75c4696c (patch) | |
tree | e91d80624ebee447338721aaaef2820ec19bbf2f /ansible/roles/kubectl | |
parent | fe49ee9006e9396c79f90365b9e814ee70c9fcee (diff) |
Add setup for kubectl and helm
the kubeconfig is copied from the cluster config directory to ~/.kube/config.
Also, the playbook runs kubectl and helm roles to install tools.
Change-Id: I29ee98f6502bbb7923b1ae6812dd642ca206dbce
Issue-ID: OOM-1778
Signed-off-by: Petr OspalĂ˝ <p.ospaly@partner.samsung.com>
Signed-off-by: Michal Zegan <m.zegan@samsung.com>
Diffstat (limited to 'ansible/roles/kubectl')
-rw-r--r-- | ansible/roles/kubectl/defaults/main.yml | 3 | ||||
-rw-r--r-- | ansible/roles/kubectl/tasks/main.yml | 10 | ||||
-rw-r--r-- | ansible/roles/kubectl/templates/kube_config.j2 | 19 |
3 files changed, 0 insertions, 32 deletions
diff --git a/ansible/roles/kubectl/defaults/main.yml b/ansible/roles/kubectl/defaults/main.yml index 78c15c75..b922fb58 100644 --- a/ansible/roles/kubectl/defaults/main.yml +++ b/ansible/roles/kubectl/defaults/main.yml @@ -1,5 +1,2 @@ --- kubectl_bin_dir: /usr/local/bin -kube_directory: ~/.kube -# Defaulting to rancher setup -kube_server: "https://{{ ansible_host }}:8080/r/projects/{{ k8s_env_id | mandatory }}/kubernetes:6443"
\ No newline at end of file diff --git a/ansible/roles/kubectl/tasks/main.yml b/ansible/roles/kubectl/tasks/main.yml index 9ecb5c44..7c77c3c5 100644 --- a/ansible/roles/kubectl/tasks/main.yml +++ b/ansible/roles/kubectl/tasks/main.yml @@ -5,13 +5,3 @@ dest: "{{ kubectl_bin_dir }}/kubectl" remote_src: true mode: 0755 - -- name: Ensure .kube directory exists - file: - path: "{{ kube_directory }}" - state: directory - -- name: Create kube config - template: - src: kube_config.j2 - dest: "{{ kube_directory }}/config" diff --git a/ansible/roles/kubectl/templates/kube_config.j2 b/ansible/roles/kubectl/templates/kube_config.j2 deleted file mode 100644 index 586c59d4..00000000 --- a/ansible/roles/kubectl/templates/kube_config.j2 +++ /dev/null @@ -1,19 +0,0 @@ -apiVersion: v1 -kind: Config -clusters: -- cluster: - api-version: v1 - insecure-skip-tls-verify: true - server: "{{ kube_server }}" - name: "{{ app_name }}" -contexts: -- context: - cluster: "{{ app_name }}" - user: "{{ app_name }}" - name: "{{ app_name }}" -current-context: "{{ app_name }}" -users: -- name: "{{ app_name }}" - user: - token: "{{ (['Basic', [key_public, key_private] | join(':') | b64encode] | join(' ')) | b64encode }}" - |