summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonty Taylor <mordred@inaugust.com>2019-02-08 15:11:59 +0000
committerMonty Taylor <mordred@inaugust.com>2019-02-12 18:17:46 +0000
commit0c4a981f739f93ba875b5aab5e8cc2c85be0ce28 (patch)
tree7c7de4235d1ea8bc205bf66fbb88b91d4e57405c
parent07edd9d297dbad8bb9b9bfa1a697eb6e036720ce (diff)
Stop running k8s-on-openstack nested
The current code runs k8s-on-openstack's ansible in an ansible task. This makes debugging failures especially difficult. Instead, move the prep task to update-system-config, which will ensure the repo is cloned, and move the post task to its own playbook. The cinder storage class k8s action can be removed from this completely as it's handled in the rook playbook. Then just run the k8s-on-openstack playbook as usual, but without the cd first so that our normal ansible.cfg works. Change-Id: I6015e58daa940914d46602a2cb64ecac5d59fa2e
Notes
Notes (review): Code-Review+2: Clark Boylan <cboylan@sapwetik.org> Code-Review+2: James E. Blair <corvus@inaugust.com> Workflow+1: James E. Blair <corvus@inaugust.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Tue, 12 Feb 2019 22:22:06 +0000 Reviewed-on: https://review.openstack.org/635857 Project: openstack-infra/system-config Branch: refs/heads/master
-rw-r--r--playbooks/bootstrap-k8s-nodes.yaml11
-rw-r--r--playbooks/run-k8s-on-openstack.yaml35
-rw-r--r--playbooks/update-system-config.yaml8
-rwxr-xr-xrun_all.sh15
-rwxr-xr-xrun_k8s_ansible.sh3
5 files changed, 30 insertions, 42 deletions
diff --git a/playbooks/bootstrap-k8s-nodes.yaml b/playbooks/bootstrap-k8s-nodes.yaml
new file mode 100644
index 0000000..f7a2acc
--- /dev/null
+++ b/playbooks/bootstrap-k8s-nodes.yaml
@@ -0,0 +1,11 @@
1# k8s-on-openstack uses the baked in ubuntu user and ssh keypairs
2# to interact with the host. Our other roles assume that we'll be
3# logging in directly as root. Run base-repos logging in as ubuntu
4# with become: true set so that we can overwrite the root ssh key
5# with the one allowing direct login from bridge.
6- hosts: "kubernetes:!disabled"
7 name: "Base: set up users and base package repositories on all hosts"
8 remote_user: ubuntu
9 become: true
10 roles:
11 - base-repos
diff --git a/playbooks/run-k8s-on-openstack.yaml b/playbooks/run-k8s-on-openstack.yaml
deleted file mode 100644
index 2612f6d..0000000
--- a/playbooks/run-k8s-on-openstack.yaml
+++ /dev/null
@@ -1,35 +0,0 @@
1- hosts: "localhost:!disabled"
2 name: "System-config: Update the system-config repo on bridge"
3 connection: local
4 gather_facts: false
5 tasks:
6 - name: Make sure k8s-on-openstack repo is up to date
7 git:
8 repo: https://github.com/infraly/k8s-on-openstack
9 dest: /opt/k8s-on-openstack
10 # HEAD as of 2019-02-08
11 version: e27a313b1583c377e08385014b9a880da765924b
12 force: yes
13
14 - name: Run kubernetes deploy playbook
15 command: ./run_k8s_ansible.sh
16 args:
17 chdir: /opt/system-config
18
19 - name: Install cinder storage class
20 k8s:
21 context: gitea
22 state: present
23 definition: "{{ lookup('file', 'k8s/storage-class.yaml') | from_yaml }}"
24
25# k8s-on-openstack uses the baked in ubuntu user and ssh keypairs
26# to interact with the host. Our other roles assume that we'll be
27# logging in directly as root. Run base-repos logging in as ubuntu
28# with become: true set so that we can overwrite the root ssh key
29# with the one allowing direct login from bridge.
30- hosts: "kubernetes:!disabled"
31 name: "Base: set up users and base package repositories on all hosts"
32 remote_user: ubuntu
33 become: true
34 roles:
35 - base-repos
diff --git a/playbooks/update-system-config.yaml b/playbooks/update-system-config.yaml
index 0a14833..6f1f333 100644
--- a/playbooks/update-system-config.yaml
+++ b/playbooks/update-system-config.yaml
@@ -18,3 +18,11 @@
18 command: ansible-galaxy install --roles-path /etc/ansible/roles --force -r roles.yaml 18 command: ansible-galaxy install --roles-path /etc/ansible/roles --force -r roles.yaml
19 args: 19 args:
20 chdir: /opt/system-config 20 chdir: /opt/system-config
21
22 - name: Make sure k8s-on-openstack repo is up to date
23 git:
24 repo: https://github.com/infraly/k8s-on-openstack
25 dest: /opt/k8s-on-openstack
26 # HEAD as of 2019-02-08
27 version: e27a313b1583c377e08385014b9a880da765924b
28 force: yes
diff --git a/run_all.sh b/run_all.sh
index 57e37f8..c8ecb9e 100755
--- a/run_all.sh
+++ b/run_all.sh
@@ -77,15 +77,20 @@ start_timer
77timeout -k 2m 120m ansible-playbook ${ANSIBLE_PLAYBOOKS}/bridge.yaml 77timeout -k 2m 120m ansible-playbook ${ANSIBLE_PLAYBOOKS}/bridge.yaml
78send_timer bridge 78send_timer bridge
79 79
80# Run the base playbook everywhere 80# Run k8s-on-openstack
81start_timer 81start_timer
82timeout -k 2m 120m ansible-playbook -f 50 ${ANSIBLE_PLAYBOOKS}/base.yaml 82timeout -k 2m 120m ${SYSTEM_CONFIG}/run_k8s_ansible.sh
83send_timer k8s
84
85# Run the k8s nodes bootstrap playbook
86start_timer
87timeout -k 2m 120m ansible-playbook -f 50 ${ANSIBLE_PLAYBOOKS}/bootstrap-k8s-nodes.yaml
83send_timer base 88send_timer base
84 89
85# Run k8s-on-openstack 90# Run the base playbook everywhere
86start_timer 91start_timer
87timeout -k 2m 120m ansible-playbook -f 50 ${ANSIBLE_PLAYBOOKS}/run-k8s-on-openstack.yaml 92timeout -k 2m 120m ansible-playbook -f 50 ${ANSIBLE_PLAYBOOKS}/base.yaml
88send_timer k8s 93send_timer base
89 94
90# These playbooks run on the gitea k8s cluster 95# These playbooks run on the gitea k8s cluster
91start_timer 96start_timer
diff --git a/run_k8s_ansible.sh b/run_k8s_ansible.sh
index 0b8a994..db639eb 100755
--- a/run_k8s_ansible.sh
+++ b/run_k8s_ansible.sh
@@ -39,5 +39,4 @@ export NODE_EXTRA_VOLUME_SIZE="80"
39export USE_OCTAVIA="True" 39export USE_OCTAVIA="True"
40export BLOCK_STORAGE_VERSION='v3' 40export BLOCK_STORAGE_VERSION='v3'
41 41
42cd /opt/k8s-on-openstack 42ansible-playbook -v /opt/k8s-on-openstack/site.yaml
43ansible-playbook -v site.yaml