Browse Source

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
Monty Taylor 2 months ago
parent
commit
0c4a981f73

+ 11
- 0
playbooks/bootstrap-k8s-nodes.yaml View File

@@ -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

+ 0
- 35
playbooks/run-k8s-on-openstack.yaml View File

@@ -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

+ 8
- 0
playbooks/update-system-config.yaml View File

@@ -18,3 +18,11 @@
18 18
       command: ansible-galaxy install --roles-path /etc/ansible/roles --force -r roles.yaml
19 19
       args:
20 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

+ 10
- 5
run_all.sh View File

@@ -77,15 +77,20 @@ start_timer
77 77
 timeout -k 2m 120m ansible-playbook ${ANSIBLE_PLAYBOOKS}/bridge.yaml
78 78
 send_timer bridge
79 79
 
80
-# Run the base playbook everywhere
80
+# Run k8s-on-openstack
81 81
 start_timer
82
-timeout -k 2m 120m ansible-playbook -f 50 ${ANSIBLE_PLAYBOOKS}/base.yaml
82
+timeout -k 2m 120m ${SYSTEM_CONFIG}/run_k8s_ansible.sh
83
+send_timer k8s
84
+
85
+# Run the k8s nodes bootstrap playbook
86
+start_timer
87
+timeout -k 2m 120m ansible-playbook -f 50 ${ANSIBLE_PLAYBOOKS}/bootstrap-k8s-nodes.yaml
83 88
 send_timer base
84 89
 
85
-# Run k8s-on-openstack
90
+# Run the base playbook everywhere
86 91
 start_timer
87
-timeout -k 2m 120m ansible-playbook -f 50 ${ANSIBLE_PLAYBOOKS}/run-k8s-on-openstack.yaml
88
-send_timer k8s
92
+timeout -k 2m 120m ansible-playbook -f 50 ${ANSIBLE_PLAYBOOKS}/base.yaml
93
+send_timer base
89 94
 
90 95
 # These playbooks run on the gitea k8s cluster
91 96
 start_timer

+ 1
- 2
run_k8s_ansible.sh View File

@@ -39,5 +39,4 @@ export NODE_EXTRA_VOLUME_SIZE="80"
39 39
 export USE_OCTAVIA="True"
40 40
 export BLOCK_STORAGE_VERSION='v3'
41 41
 
42
-cd /opt/k8s-on-openstack
43
-ansible-playbook -v site.yaml
42
+ansible-playbook -v /opt/k8s-on-openstack/site.yaml

Loading…
Cancel
Save