@@ -153,11 +153,21 @@ OCI_COMPARTMENT_ID_IMAGE="<CHANGE_ME:ocid1.compartment.oc1.UUID>"
153
153
EOF
154
154
source ~ /.oci/env
155
155
156
- cat << EOF > ./vars-oci-ha.yaml
156
+ cat << EOF > ~/.openshift/env
157
+ export OCP_CUSTOM_RELEASE="docker.io/mtulio/ocp-release:latest"
158
+
159
+ OCP_RELEASE_413="quay.io/openshift-release-dev/ocp-release:4.13.0-ec.4-x86_64"
160
+ EOF
161
+ source ~ /.openshift/env
162
+
163
+ CLUSTER_NAME=oci-cr3cmo
164
+ cat << EOF > ./vars-oci-ha_${CLUSTER_NAME} .yaml
157
165
provider: oci
158
- cluster_name: oci
166
+ cluster_name: ${CLUSTER_NAME}
159
167
config_cluster_region: us-sanjose-1
160
168
169
+ #TODO: create compartment validations
170
+ #TODO: allow create compartment from a parent
161
171
oci_compartment_id: ${OCI_COMPARTMENT_ID}
162
172
oci_compartment_id_dns: ${OCI_COMPARTMENT_ID_DNS}
163
173
oci_compartment_id_image: ${OCI_COMPARTMENT_ID_IMAGE}
@@ -169,10 +179,10 @@ config_base_domain: splat-oci.devcluster.openshift.com
169
179
config_ssh_key: "$( cat ~ /.ssh/id_rsa.pub) "
170
180
config_pull_secret_file: "${HOME} /.openshift/pull-secret-latest.json"
171
181
172
- config_cluster_version: 4.13.0-ec.3-x86_64
182
+ # config_cluster_version: 4.13.0-ec.3-x86_64
173
183
version: 4.13.0-ec.3
174
- # config_installer_environment:
175
- # OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE: "quay.io/openshift-release-dev/ocp-release:4.13.0-ec.4-x86_64 "
184
+ config_installer_environment:
185
+ OPENSHIFT_INSTALL_RELEASE_IMAGE_OVERRIDE: "${OCP_CUSTOM_RELEASE} "
176
186
177
187
controlplane_instance: VM.Standard3.Flex
178
188
controlplane_instance_spec:
@@ -204,7 +214,41 @@ os_mirror_to_oci:
204
214
image_type: QCOW2
205
215
#image_type: VMDK
206
216
217
+
218
+ ## Apply patches to installer manifests (WIP)
219
+
220
+ # TODO: we must keep the OCI CCM manifests patch more generic
221
+
222
+ config_patches:
223
+ - rm-capi-machines
224
+ #- platform-external-kubelet # PROBLEM hangin kubelete (network)
225
+ #- platform-external-kcmo
226
+ - deploy-oci-ccm
227
+ - yaml_patch # working for OCI, but need to know the path
228
+ #- line_regex_patch # ideal, but not working as expected
229
+
230
+ cfg_patch_yaml_patch_specs:
231
+ ## patch infra object to create External provider
232
+ - manifest: /manifests/cluster-infrastructure-02-config.yml
233
+ patch: '{"spec":{"platformSpec":{"type":"External","external":{"platformName":"oci"}}},"status":{"platform":"External","platformStatus":{"type":"External","external":{}}}}'
234
+
235
+ ## OCI : Change the namespace from downloaded assets
236
+ #- manifest: /manifests/oci-cloud-controller-manager-02.yaml
237
+ # patch: '{"metadata":{"namespace":"oci-cloud-controller-manager"}}'
238
+
239
+ cfg_patch_line_regex_patch_specs:
240
+ - manifest: /manifests/oci-cloud-controller-manager-01-rbac.yaml
241
+ #search_string: 'namespace: kube-system'
242
+ regexp: '^(.*)(namespace\\ : kube-system)$'
243
+ #line: 'namespace: oci-cloud-controller-manager'
244
+ line: '\\ 1namespace: oci-cloud-controller-manager'
245
+
246
+ - manifest: /manifests/oci-cloud-controller-manager-02.yaml
247
+ regexp: '^(.*)(namespace\\ : kube-system)$'
248
+ line: '\\ 1namespace: oci-cloud-controller-manager'
207
249
EOF
250
+
251
+
208
252
```
209
253
210
254
### Install the clients
@@ -295,6 +339,28 @@ ansible-playbook mtulio.okd_installer.create_node \
295
339
oc adm certificate approve $( oc get csr -o json | jq -r ' .items[] | select(.status.certificate == null).metadata.name' )
296
340
```
297
341
342
+ ### Create all
343
+
344
+ ``` bash
345
+ ansible-playbook mtulio.okd_installer.create_all \
346
+ -e certs_max_retries=20 \
347
+ -e cert_wait_interval_sec=60 \
348
+ -e @./vars-oci-ha.yaml
349
+ ```
350
+
351
+ > TO DO: measure total time
352
+
353
+ ## Review the cluster
354
+
355
+ ``` bash
356
+ export KUBECONFIG=${HOME} /.ansible/okd-installer/clusters/${cluster_name} /auth/kubeconfig
357
+
358
+ oc get nodes
359
+ oc get co
360
+ ```
361
+
362
+ ## OPCT setup
363
+
298
364
- Create the OPCT [ dedicated] node
299
365
300
366
> https://redhat-openshift-ecosystem.github.io/provider-certification-tool/user/#option-a-command-line
@@ -344,30 +410,14 @@ oc adm taint node opct-01.priv.ocp.oraclevcn.com node-role.kubernetes.io/tests="
344
410
~ /opct/bin/openshift-provider-cert-linux-amd64-v0.3.0 report * .tar.gz
345
411
```
346
412
413
+ ## Generate custom image
347
414
348
- ### Create all
349
-
350
- ``` bash
351
- ansible-playbook mtulio.okd_installer.create_all \
352
- -e @./vars-oci-ha.yaml \
353
- -e certs_max_retries=20 \
354
- -e cert_wait_interval_sec=60
355
415
```
356
416
357
- > TO DO: measure total time
358
-
359
- ## Review the cluster
360
-
361
- ``` bash
362
- export KUBECONFIG=${HOME} /.ansible/okd-installer/clusters/${cluster_name} /auth/kubeconfig
363
-
364
- oc get nodes
365
- oc get co
366
417
```
367
418
368
419
## Destroy
369
420
370
421
``` bash
371
- ansible-playbook mtulio.okd_installer.destroy_cluster \
372
- -e @./vars-oci-ha.yaml
422
+ ansible-playbook mtulio.okd_installer.destroy_cluster -e @./vars-oci-ha.yaml
373
423
```
0 commit comments