Skip to content

Commit 907af6c

Browse files
committed
feat/provider-oci: add full-stack creation
1 parent 837c59c commit 907af6c

File tree

10 files changed

+650
-163
lines changed

10 files changed

+650
-163
lines changed

docs/guides/installing-agnostic-oci.md

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ wget https://raw.githubusercontent.com/mtulio/ansible-collection-okd-installer/m
4141

4242
- Update with OCI requirements
4343

44-
```
44+
```bash
4545
cat <<EOF >> requirements.txt
4646
4747
# Oracle Cloud Infrastructure
@@ -59,19 +59,19 @@ EOF
5959

6060
- Install ansible and dependencies
6161

62-
```
62+
```bash
6363
pip install -r requirements.txt
6464
```
6565

6666
- Install the collections
6767

68-
```
68+
```bash
6969
ansible-galaxy collection install -r requirements.yml
7070
```
7171

7272
- Get the latest (under development) okd-installer for OCI
7373

74-
```
74+
```bash
7575
git clone -b feat-add-provider-oci --recursive \
7676
[email protected]:mtulio/ansible-collection-okd-installer.git \
7777
collections/ansible_collections/mtulio/okd_installer
@@ -80,7 +80,7 @@ git clone -b feat-add-provider-oci --recursive \
8080
- Check if the collection is present
8181

8282

83-
```
83+
```bash
8484
$ ansible-galaxy collection list |egrep "(okd_installer|^oracle)"
8585
mtulio.okd_installer 0.0.0-latest
8686
oracle.oci 4.11.0
@@ -118,11 +118,11 @@ You must be able to collect the user information.
118118
cat <<EOF > ~/.oci/env
119119
OCI_COMPARTMENT_ID="<CHANGE_ME:ocid1.compartment.oc1.UUID>"
120120
EOF
121-
122121
source ~/.oci/env
122+
123123
cat <<EOF > ./vars-oci-ha.yaml
124124
provider: oci
125-
cluster_name: ocp-oci
125+
cluster_name: mrb
126126
config_cluster_region: us-sanjose-1
127127
128128
oci_compartment_id: ${OCI_COMPARTMENT_ID}
@@ -194,11 +194,35 @@ ansible-playbook mtulio.okd_installer.stack_loadbalancer \
194194

195195
- Bootstrap
196196

197-
TODO
197+
```bash
198+
199+
os_mirror: yes
200+
os_mirror_src: stream
201+
os_mirror_stream:
202+
architecture: x86_64
203+
platform: openstack
204+
format: qcow2.gz
205+
206+
os_mirror_dest_provider: oci
207+
os_mirror_dest_oci:
208+
compartment_id:
209+
bucket:
210+
```
211+
212+
213+
```bash
214+
ansible-playbook mtulio.okd_installer.create_node \
215+
-e node_role=bootstrap \
216+
-e @./vars-oci-ha.yaml
217+
```
198218

199219
- Control Plane
200220

201-
TODO
221+
```bash
222+
ansible-playbook mtulio.okd_installer.create_node \
223+
-e node_role=controlplane \
224+
-e @./vars-oci-ha.yaml
225+
```
202226

203227
- Compute
204228

playbooks/vars/oci/profiles/ha/dns.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ cloud_dns_zones:
1414
# private
1515
- name: "{{ cluster_state.dns.cluster_domain }}"
1616
provider: oci
17-
view_name: "{{ cluster_state.infra_id }}-vpc"
17+
view_name: "{{ cluster_state.infra_id }}-vcn"
1818
spec:
1919
scope: PRIVATE
2020
zone_type: PRIMARY

playbooks/vars/oci/profiles/ha/loadbalancer.yaml

Lines changed: 38 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ cloud_load_balancer_provider: oci
2525

2626
# OCI NLB: https://docs.oracle.com/en-us/iaas/tools/oci-ansible-collection/4.12.0/collections/oracle/oci/oci_network_load_balancer_module.html#ansible-collections-oracle-oci-oci-network-load-balancer-module
2727
cloud_loadbalancers:
28-
- name: "{{ cluster_state.infra_id }}-ext"
28+
- name: "{{ cluster_state.infra_id }}-nlb"
2929
provider: oci
3030
type: network
3131

3232
# Is it supported multi-subnets?
33-
subnet_name: "{{ cluster_state.infra_id }}-net-public"
33+
subnet_name: "{{ cluster_state.infra_id }}-net-public-lb"
3434
spec:
3535
compartment_id: "{{ oci_compartment_id }}"
36-
display_name: "{{ cluster_state.infra_id }}-ext"
36+
display_name: "{{ cluster_state.infra_id }}-nlb"
3737
is_private: false
3838
is_preserve_source_destination: true
3939
nlb_ip_version: IPV4
@@ -44,10 +44,10 @@ cloud_loadbalancers:
4444
backend_set:
4545
- provider: oci
4646
spec:
47-
name: "{{ cluster_state.infra_id }}-aext"
47+
name: "{{ cluster_state.infra_id }}-api"
4848
is_preserve_source: no
4949
ip_version: IPV4
50-
#policy: TWO_TUPLE
50+
policy: FIVE_TUPLE
5151
#backends: []
5252
health_checker:
5353
port: 6443
@@ -59,10 +59,25 @@ cloud_loadbalancers:
5959

6060
- provider: oci
6161
spec:
62-
name: "{{ cluster_state.infra_id }}-ig-80"
62+
name: "{{ cluster_state.infra_id }}-mcs"
6363
is_preserve_source: no
6464
ip_version: IPV4
65-
#policy: TWO_TUPLE
65+
policy: FIVE_TUPLE
66+
#backends: []
67+
health_checker:
68+
port: 22623
69+
protocol: HTTPS
70+
return_code: 200
71+
url_path: /healthz
72+
interval_in_millis: 10000
73+
timeout_in_millis: 3000
74+
75+
- provider: oci
76+
spec:
77+
name: "{{ cluster_state.infra_id }}-ing-http"
78+
is_preserve_source: no
79+
ip_version: IPV4
80+
policy: FIVE_TUPLE
6681
#backends: [] # TCP/31794
6782
health_checker:
6883
port: 31261
@@ -74,7 +89,7 @@ cloud_loadbalancers:
7489

7590
- provider: oci
7691
spec:
77-
name: "{{ cluster_state.infra_id }}-ig-443"
92+
name: "{{ cluster_state.infra_id }}-ing-https"
7893
is_preserve_source: no
7994
ip_version: IPV4
8095
#policy: TWO_TUPLE
@@ -90,22 +105,29 @@ cloud_loadbalancers:
90105
# https://docs.oracle.com/en-us/iaas/tools/oci-ansible-collection/4.12.0/collections/oracle/oci/oci_network_load_balancer_listener_module.html#ansible-collections-oracle-oci-oci-network-load-balancer-listener-module
91106
listeners:
92107
- spec:
93-
name: "{{ cluster_state.infra_id }}-aext"
94-
default_backend_set_name: "{{ cluster_state.infra_id }}-aext"
108+
name: "{{ cluster_state.infra_id }}-api"
109+
default_backend_set_name: "{{ cluster_state.infra_id }}-api"
95110
ip_version: IPV4
96111
port: 6443
97112
protocol: TCP
98113

99114
- spec:
100-
name: "{{ cluster_state.infra_id }}-ig-80"
101-
default_backend_set_name: "{{ cluster_state.infra_id }}-ig-80"
115+
name: "{{ cluster_state.infra_id }}-mext"
116+
default_backend_set_name: "{{ cluster_state.infra_id }}-mcs"
117+
ip_version: IPV4
118+
port: 22623
119+
protocol: TCP
120+
121+
- spec:
122+
name: "{{ cluster_state.infra_id }}-ing-http"
123+
default_backend_set_name: "{{ cluster_state.infra_id }}-ing-http"
102124
ip_version: IPV4
103125
port: 80
104126
protocol: TCP
105127

106128
- spec:
107-
name: "{{ cluster_state.infra_id }}-ig-443"
108-
default_backend_set_name: "{{ cluster_state.infra_id }}-ig-443"
129+
name: "{{ cluster_state.infra_id }}-ing-https"
130+
default_backend_set_name: "{{ cluster_state.infra_id }}-ing-https"
109131
ip_version: IPV4
110132
port: 443
111133
protocol: TCP
@@ -138,7 +160,7 @@ cloud_loadbalancers:
138160
# private address
139161
- name: register_dns
140162
rr_ip: private
141-
view_name: "{{ cluster_state.infra_id }}-vpc"
163+
view_name: "{{ cluster_state.infra_id }}-vcn"
142164
spec:
143165
zone_name_or_id: "{{ cluster_state.dns.cluster_domain }}"
144166
compartment_id: "{{ oci_compartment_id }}"
@@ -150,7 +172,7 @@ cloud_loadbalancers:
150172

151173
- name: register_dns
152174
rr_ip: public
153-
view_name: "{{ cluster_state.infra_id }}-vpc"
175+
view_name: "{{ cluster_state.infra_id }}-vcn"
154176
spec:
155177
zone_name_or_id: "{{ cluster_state.dns.cluster_domain }}"
156178
compartment_id: "{{ oci_compartment_id }}"

0 commit comments

Comments
 (0)