From c5803dcda0ec20462674d4c68fece0afce47ed46 Mon Sep 17 00:00:00 2001 From: Anish Lakhwara Date: Fri, 7 Jul 2023 09:15:18 -0700 Subject: [PATCH] feat: configure kubectl through ansible (#948) Co-authored-by: Anish Lakhwara --- ansible/group_vars/do/main.yml | 1 + ansible/playbooks/do_setup.yml | 4 ++++ docs/deploy/ansible/digitalocean.md | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ansible/group_vars/do/main.yml b/ansible/group_vars/do/main.yml index db1397e4..28873785 100644 --- a/ansible/group_vars/do/main.yml +++ b/ansible/group_vars/do/main.yml @@ -26,6 +26,7 @@ bucket_path: "crawls" domain: "browsertrix.cloud" subdomain: "{{ project_name }}" +configure_kube: false use_do_registry: true image_tag: "latest" diff --git a/ansible/playbooks/do_setup.yml b/ansible/playbooks/do_setup.yml index 50c89ac1..16d5907b 100644 --- a/ansible/playbooks/do_setup.yml +++ b/ansible/playbooks/do_setup.yml @@ -219,6 +219,10 @@ registry_endpoint: "{{ do_registry_result.stdout_lines[1] }}" when: use_do_registry + - name: d_ocean | registry | configure kubectl + ansible.builtin.shell: doctl k8s cluster kubeconfig save {{ my_cluster.data.id }} + when: configure_kubectl + - name: d_ocean | registry | add to new k8s cluster ansible.builtin.shell: set -o pipefail && doctl registry kubernetes-manifest | kubectl apply -f - when: use_do_registry diff --git a/docs/deploy/ansible/digitalocean.md b/docs/deploy/ansible/digitalocean.md index 42301061..25df11ad 100644 --- a/docs/deploy/ansible/digitalocean.md +++ b/docs/deploy/ansible/digitalocean.md @@ -23,7 +23,7 @@ git clone https://github.com/webrecorder/browsertrix-cloud.git cd browsertrix-cloud ``` -2. [Look at the configuration options](https://github.com/webrecorder/browsertrix-cloud/blob/main/ansible/group_vars/do/main.yml) and modify them or pass them as extra variables as shown below. +2. [Look at the configuration options](https://github.com/webrecorder/browsertrix-cloud/blob/main/ansible/group_vars/do/main.yml) and modify them or pass them as extra variables as shown below. If you haven't configured `kubectl`, please enable the `configure_kube` option 3. Run the playbook: ```zsh