From 0ee74fbe8f7aa6a520e126cdcd310baa8e51906e Mon Sep 17 00:00:00 2001 From: tei-k Date: Thu, 26 Nov 2020 15:45:25 +0900 Subject: [PATCH 1/5] Add awscli role for bastion --- playbooks/playbook-install-tools.yml | 2 ++ playbooks/roles/awscli/tasks/main.yml | 6 ++++++ 2 files changed, 8 insertions(+) create mode 100644 playbooks/roles/awscli/tasks/main.yml diff --git a/playbooks/playbook-install-tools.yml b/playbooks/playbook-install-tools.yml index f9560f1a9..31ed12d5d 100644 --- a/playbooks/playbook-install-tools.yml +++ b/playbooks/playbook-install-tools.yml @@ -23,5 +23,7 @@ roles: - kubectl - helm + - role: awscli + when: install_awscli | default(False) | bool tags: - tools diff --git a/playbooks/roles/awscli/tasks/main.yml b/playbooks/roles/awscli/tasks/main.yml new file mode 100644 index 000000000..9a263a10a --- /dev/null +++ b/playbooks/roles/awscli/tasks/main.yml @@ -0,0 +1,6 @@ +--- +- name: Install awscli + pip: + name: awscli + state: present + executable: pip3 From 311affff715364682b91d2d7756f07f436a62b03 Mon Sep 17 00:00:00 2001 From: tei-k Date: Thu, 26 Nov 2020 15:59:36 +0900 Subject: [PATCH 2/5] Fix doc --- docs/PrepareBastionTool.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/PrepareBastionTool.md b/docs/PrepareBastionTool.md index 22158b1d7..d235dc73b 100644 --- a/docs/PrepareBastionTool.md +++ b/docs/PrepareBastionTool.md @@ -72,7 +72,7 @@ Now let's install the tools in the bastion as follows. ```console $ cd ${SCALAR_K8S_HOME} -$ ansible-playbook -i ${SCALAR_K8S_CONFIG_DIR}/inventory.ini playbooks/playbook-install-tools.yml +$ ansible-playbook -i ${SCALAR_K8S_CONFIG_DIR}/inventory.ini playbooks/playbook-install-tools.yml [-e "install_awscli=true"] PLAY [Install necessary kubernetes binary on bastion] **************************************************************************************************************************************************************************************************************** From b9b988716b0ef3fc2abd8bcceaeefd3a768607d5 Mon Sep 17 00:00:00 2001 From: tei-k Date: Fri, 27 Nov 2020 11:23:13 +0900 Subject: [PATCH 3/5] Fix ci fail --- .github/workflows/operation_pluto_deprecated.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/operation_pluto_deprecated.yml b/.github/workflows/operation_pluto_deprecated.yml index 2ae094ded..5b2ea1da1 100644 --- a/.github/workflows/operation_pluto_deprecated.yml +++ b/.github/workflows/operation_pluto_deprecated.yml @@ -24,7 +24,7 @@ jobs: tar xf pluto_3.0.1_linux_amd64.tar.gz rm -rf pluto_3.0.1_linux_amd64.tar.gz mv pluto $GITHUB_WORKSPACE/bin/pluto - echo "::add-path::$GITHUB_WORKSPACE/bin" + echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH chmod +x $GITHUB_WORKSPACE/bin/pluto - name: Run pluto on playbooks folder From 66c0024c7f631128a1b8096c8b0c1064118fb24e Mon Sep 17 00:00:00 2001 From: tei-k Date: Fri, 4 Dec 2020 15:28:27 +0900 Subject: [PATCH 4/5] Add description for install awscli --- docs/PrepareBastionTool.md | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/docs/PrepareBastionTool.md b/docs/PrepareBastionTool.md index d235dc73b..75cd939b3 100644 --- a/docs/PrepareBastionTool.md +++ b/docs/PrepareBastionTool.md @@ -46,30 +46,32 @@ The kubeconfig file should look like below. ```yml apiVersion: v1 clusters: -- cluster: - certificate-authority-data: LS0tLS1... - server: https://scalar-k8s-c1eae570.fdc2c430-cd60-4952-b269-28d1c1583ca7.privatelink.eastus.azmk8s.io:443 - name: scalar-kubernetes + - cluster: + certificate-authority-data: LS0tLS1... + server: https://scalar-k8s-c1eae570.fdc2c430-cd60-4952-b269-28d1c1583ca7.privatelink.eastus.azmk8s.io:443 + name: scalar-kubernetes contexts: -- context: - cluster: scalar-kubernetes - user: clusterUser_exemple-k8s-azure-znmhbo_scalar-kubernetes - name: scalar-kubernetes + - context: + cluster: scalar-kubernetes + user: clusterUser_exemple-k8s-azure-znmhbo_scalar-kubernetes + name: scalar-kubernetes current-context: scalar-kubernetes kind: Config preferences: {} users: -- name: clusterUser_exemple-k8s-azure-znmhbo_scalar-kubernetes - user: - client-certificate-data: LS0tLS1C.... - client-key-data: LS0tLS... - token: 48fdda... + - name: clusterUser_exemple-k8s-azure-znmhbo_scalar-kubernetes + user: + client-certificate-data: LS0tLS1C.... + client-key-data: LS0tLS... + token: 48fdda... ``` ## Install tools in the bastion Now let's install the tools in the bastion as follows. +Note: When using Amazon EKS, you need to add `-e "install_awscli=true"` option to install `awscli` for cluster authentication. + ```console $ cd ${SCALAR_K8S_HOME} $ ansible-playbook -i ${SCALAR_K8S_CONFIG_DIR}/inventory.ini playbooks/playbook-install-tools.yml [-e "install_awscli=true"] From d0cf6b98952d85883243df32d49f8049915ce031 Mon Sep 17 00:00:00 2001 From: Hiroyuki Yamada Date: Fri, 4 Dec 2020 16:20:47 +0900 Subject: [PATCH 5/5] Update docs/PrepareBastionTool.md Co-authored-by: Yusuke Morimoto --- docs/PrepareBastionTool.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/PrepareBastionTool.md b/docs/PrepareBastionTool.md index 75cd939b3..650ba9b1e 100644 --- a/docs/PrepareBastionTool.md +++ b/docs/PrepareBastionTool.md @@ -74,7 +74,7 @@ Note: When using Amazon EKS, you need to add `-e "install_awscli=true"` option t ```console $ cd ${SCALAR_K8S_HOME} -$ ansible-playbook -i ${SCALAR_K8S_CONFIG_DIR}/inventory.ini playbooks/playbook-install-tools.yml [-e "install_awscli=true"] +$ ansible-playbook -i ${SCALAR_K8S_CONFIG_DIR}/inventory.ini playbooks/playbook-install-tools.yml PLAY [Install necessary kubernetes binary on bastion] ****************************************************************************************************************************************************************************************************************