-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_okd.yml
79 lines (73 loc) · 3.48 KB
/
install_okd.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
---
- name: This playbook deploy OKD 4 on a local server
hosts: localhost
vars:
installer_path: "/home/{{ ansible_user_id }}/.okd"
tasks:
- name: Add virbr1 vlan for sandbox okd cluster virtual machines
include: add_virbr1_vlan_network.yml
- name: Add virbr2 vlan for dns virtual machine
include: add_virbr2_vlan_network.yml
- name: Add fix bridge permissions for user
include: add_fix_bridge_permissions_for_user.yml
- name: Create dns virtual machine
include: create_dns_vm.yml
- name: Create container registry okd virtual machine
include: create_container_registry_vm.yml
- name: Create lb virtual machine
include: create_load_balancer_vm.yml
- name: Install prerequisite okd infrastructure
include: install_prerequisite_okd_infrastructure.yml
- name: Create bootstrap okd virtual machine
include: create_bootstrap_okd_vm.yml
- name: Create control planes virtual machines
include: create_control_plane_okd_vm.yml
with_items:
- {index: 0, ip: '10.0.5.59', mac: '52:54:00:00:05:59'}
- {index: 1, ip: '10.0.5.60', mac: '52:54:00:00:05:60'}
- {index: 2, ip: '10.0.5.61', mac: '52:54:00:00:05:61'}
- name: |
Wait until bootstrap has complete is work.
To know it ALL control planes MUST BE UP (to be able to request using oc) and we check the configmaps status for bootstrap
shell: /usr/bin/oc --kubeconfig={{ installer_path }}/auth/kubeconfig get -n kube-system configmaps bootstrap -o jsonpath='{.data.status}'
register: task_result
until: task_result.rc == 0 and task_result.stdout == 'complete'
retries: 120
delay: 60
- name: |
Delete bootstrap okd virtual machine as bootstrap has completed is work and is no more usefull.
I should remove entries in load balancer too but haproxy will consider the bootstrap server as down and do not forward trafic on it after three fails
include: delete_bootstrap_okd_vm.yml
# - name: |
# Wait for control planes to be ready to serve workers configuration
# All control planes must be working to make request works !
# Bootstrap can be removed at this stage
# shell: curl --silent --fail -k https://{{ item }}:22623/config/worker > /dev/null
# register: task_result
# until: task_result.rc == 0
# retries: 120
# delay: 60
# loop:
# - 'control-plane-0.sandbox.okd.local'
## - 'control-plane-1.sandbox.okd.local'
## - 'control-plane-2.sandbox.okd.local'
#
# - name: Approve current pending certs
# shell:
# cmd: oc get csr -ojson | jq -r '.items[] | select(.status == {} ) | .metadata.name' | xargs oc adm certificate approve
# args:
# executable: /bin/bash
- name: |
Start workers virtual machines
Three workers must be started to satisfy the selector in openshift-ingress pod/router-default-...
include: create_worker_okd_vm.yml
with_items:
- {index: 0, ip: '10.0.5.62', mac: '52:54:00:00:05:62'}
- {index: 1, ip: '10.0.5.63', mac: '52:54:00:00:05:63'}
- {index: 2, ip: '10.0.5.64', mac: '52:54:00:00:05:64'}
# TODO verifier qu'il n'y pas de certificats en attente...
# oc --kubeconfig=./auth/kubeconfig get csr
# TODO associer les workers une fois qu'ils sont up ...
# TODO verifier que ingress est ok
# TODO accéder à la console :)
# pour cela lancer le script openshift-install wait-for install-complete --log-level debug et comprendre comment il marche