Skip to content

Commit 5de9d21

Browse files
author
AC
committed
rhosp
1 parent 291a276 commit 5de9d21

31 files changed

+209
-82
lines changed

kubernetes/storage/ceph/README.adoc

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,6 @@ helm repo add ceph-csi https://ceph.github.io/csi-charts
3131
helm repo update
3232
----
3333

34-
== Create Ceph Pool
35-
36-
Create Ceph pool, failesyste and subvolume for Kubernetes & client key
37-
38-
[sourec,bash]
39-
----
40-
ansible-playbook kubernetes/storage/ceph/ansible/60-proxmox-create-cephfs-pool.yaml \
41-
-e @kubernetes/storage/ceph/ansible/defaults/main.yaml \
42-
-e proxmox_host=${PROXMOX_HOST}
43-
----
44-
4534
== Ansible Inventory
4635

4736
.05-storage.yaml
@@ -82,7 +71,7 @@ kubernetes:
8271
k8s_role: control-plane
8372
hw:
8473
ram: 16384 # In MiB
85-
vcpu: 4
74+
vcpu: 4
8675
storage: 150 # In GiB
8776
vars:
8877
ceph_cluster: ceph_01
@@ -92,6 +81,26 @@ kubernetes:
9281
ceph_fs_subvolume: csi
9382
----
9483

84+
85+
== Ceph Rados Block Device (RBD)
86+
87+
References:
88+
89+
* https://docs.ceph.com/en/latest/rbd/rbd-kubernetes/
90+
91+
92+
== Ceph CephFS
93+
94+
95+
Create Ceph pool, failesystem and subvolume for Kubernetes & client key.
96+
97+
[sourec,bash]
98+
----
99+
ansible-playbook kubernetes/storage/ceph/ansible/60-proxmox-create-cephfs-pool.yaml \
100+
-e @kubernetes/storage/ceph/ansible/defaults/main.yaml \
101+
-e proxmox_host=${PROXMOX_HOST}
102+
----
103+
95104
== Collect information
96105

97106
Define environment variables.

ocp/4.15/README.adoc

Lines changed: 29 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
= OCP UPI Installation on Proxmox
1+
= OCP 4.15.x Installation
22
Antonio C. <sp38af (at) trikorasolutions (dot) com>
33
:revdate: {docdate}
44
:icons: font
@@ -7,51 +7,44 @@ Antonio C. <sp38af (at) trikorasolutions (dot) com>
77
:toc-title: Table of Contents
88
:description: OCP UPI Installation on Proxmox
99

10-
== Introduction
10+
== Acronyms
1111

12-
[.lead]
13-
This document describes the OCP installation process using UPI. It automates
14-
the instructions found at https://blog.rossbrigoli.com/2020/11/running-openshift-at-home-part-44.html.
12+
OCP::
13+
RedHat OpenShift Container Platform
1514

16-
References:
15+
RHOSP::
16+
RedHat Open Stack Platform
1717

18-
* https://docs.openshift.com/container-platform/4.15/installing/installing_bare_metal/installing-bare-metal.html#installing-bare-metal
18+
UPI::
19+
User-provisioned infrastructure
1920

20-
=== Services host
21+
== Introduction
2122

22-
[source,bash]
23-
----
24-
OCP_CLI_INSTALL_DIR=/tmp<1>
25-
RH_CLUSTER_PULL_SECRET=<2>
26-
SSH_PUB_KEY_FILE=<3>
27-
----
28-
<1>
29-
<2> Get a Red Hat pull secret by logging in to https://cloud.redhat.com.
30-
Navigate to _Cluster Manager > Create Cluster > Red Hat Openshift Container Platform > Run on Baremetal > User-Provisioned Infrastructure_
31-
and press _Copy pull secret_.
32-
<3>
23+
[.lead]
24+
The different sections linked by this document describe the installation
25+
process for OCP 4.15.x on different platforms.
3326

34-
[source,bash]
35-
----
36-
ansible-playbook ocp/4.15/upi/ansible/ocp-services-02-gen-playbook.yaml \
37-
-e @ocp/4.15/upi/ansible/defaults/main.yaml
38-
----
27+
[#collect-information]
28+
== Collect information
3929

40-
Use `openshift-install` to create the Kubernetes manifests and Ignition
41-
configuration files for the cluster.
30+
Collect all the information required for the deployment.
4231

4332
[source,bash]
4433
----
45-
ansible-playbook ocp/4.15/upi/ansible/ocp-services-03-oi-playbook.yaml \
46-
-e @ocp/4.15/upi/ansible/defaults/main.yaml \
47-
-e @_local_config/network.yaml \
48-
-e pull_secret=${RH_CLUSTER_PULL_SECRET} \
49-
-e ssh_pub_key_file=${SSH_PUB_KEY_FILE}
34+
RH_CLUSTER_PULL_SECRET='{"auths":{"cloud.openshift.com":...'<1>
35+
SSH_PUB_KEY_FILE=~/.ssh/id_rsa_somefile.pub<2>
5036
----
37+
<1> RedHat Openshift cloud pull secret.
38+
Get a Red Hat pull secret by going to https://cloud.redhat.com/.
39+
Select the _Access the Console_ link and login to the link:https://console.redhat.com/[Hybrid Cloud console].
40+
Open the _Services_ dropdown and navigate to _Platform > Red Hat OpenShift_.
41+
On the _OpenShift > Overview_ page navigate to _Cluster List_, using the left menu, and press _Create Cluster_.
42+
Under the cluster type tab select _Local_ and press the _Copy pull secret_.
43+
<2> SSH public key used to access the cluster hosts
5144

52-
[source,bash]
53-
----
54-
ansible-playbook ocp/4.15/upi/ansible/ocp-services-10-config-playbook.yaml -K \
55-
-e @ocp/4.15/upi/ansible/defaults/main.yaml
56-
----
45+
== Select platform
46+
47+
The following platforms are available:
5748

49+
* link:upi_proxmox//[OCP UPI Installation on Proxmox]
50+
* link:upi_rhosp/[OCP Installation on UPI RHOSP]

ocp/4.15/install_upi/ansible/02-ocp-services-oi-binaries.yaml renamed to ocp/4.15/ansible/02-ocp-services-oi-binaries.yaml

File renamed without changes.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
ocp_install_root_dir: "openshift"
2+
ocp_install_root_dir_under_user_home: true
3+
ocp_release_arch: amd64
4+
ocp_version: 4.15.46
5+
6+
ocp_cluster_name: ocp
7+
use_compute_nodes: false
Lines changed: 33 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,8 @@ Execute the playbook that creates the VMs.
215215

216216
[source,bash]
217217
----
218-
ansible-playbook ocp/4.15/install_upi/ansible/01-proxmox-vms.yaml \
219-
-e @ocp/4.15/install_upi/ansible/defaults/main.yaml \
218+
ansible-playbook ocp/4.15/upi_proxmox/ansible/01-proxmox-vms.yaml \
219+
-e @ocp/4.15/upi_proxmox/ansible/defaults/main.yaml \
220220
-e '{"selected_groups": ["ocp_control_plane","ocp_bootstrap"]}'
221221
----
222222

@@ -251,8 +251,9 @@ This will generate a directory with name defined on the `ocp_install_root_dir`
251251

252252
[source,bash]
253253
----
254-
ansible-playbook ocp/4.15/install_upi/ansible/02-ocp-services-oi-binaries.yaml \
255-
-e @ocp/4.15/install_upi/ansible/defaults/main.yaml
254+
ansible-playbook ocp/4.15/upi_proxmox/ansible/02-ocp-services-oi-binaries.yaml \
255+
-e bootstrap_host=ocp_services
256+
-e @ocp/4.15/upi_proxmox/ansible/defaults/main.yaml \
256257
----
257258

258259
[.lead]
@@ -278,8 +279,8 @@ Add `-K`, or `--ask-become-pass` if your host required password for sudo.
278279

279280
[source,bash]
280281
----
281-
ansible-playbook ocp/4.15/install_upi/ansible/10-ocp-services-config-host-playbook.yaml \
282-
-e @ocp/4.15/install_upi/ansible/defaults/main.yaml
282+
ansible-playbook ocp/4.15/upi_proxmox/ansible/10-ocp-services-config-host-playbook.yaml \
283+
-e @ocp/4.15/upi_proxmox/ansible/defaults/main.yaml
283284
----
284285

285286
Configure HA Proxy.
@@ -295,8 +296,8 @@ Add `-K`, or `--ask-become-pass` if your host required password for sudo.
295296

296297
[source,bash]
297298
----
298-
ansible-playbook ocp/4.15/install_upi/ansible/15-ocp-services-haproxy-playbook.yaml \
299-
-e @ocp/4.15/install_upi/ansible/defaults/main.yaml \
299+
ansible-playbook ocp/4.15/upi_proxmox/ansible/15-ocp-services-haproxy-playbook.yaml \
300+
-e @ocp/4.15/upi_proxmox/ansible/defaults/main.yaml \
300301
-e @_local_config/network.yaml
301302
----
302303

@@ -315,8 +316,8 @@ Add `-K`, or `--ask-become-pass` if your host required password for sudo.
315316

316317
[source,bash]
317318
----
318-
ansible-playbook ocp/4.15/install_upi/ansible/18-ocp-services-oi-playbook.yaml \
319-
-e @ocp/4.15/install_upi/ansible/defaults/main.yaml \
319+
ansible-playbook ocp/4.15/upi_proxmox/ansible/18-ocp-services-oi-playbook.yaml \
320+
-e @ocp/4.15/upi_proxmox/ansible/defaults/main.yaml \
320321
-e @_local_config/network.yaml \
321322
-e pull_secret=${RH_CLUSTER_PULL_SECRET} \
322323
-e ssh_pub_key_file=${SSH_PUB_KEY_FILE}
@@ -336,8 +337,8 @@ This playbook will perform the following tasks for each of the Proxmox hosts con
336337

337338
[source,bash]
338339
----
339-
ansible-playbook ocp/4.15/install_upi/ansible/20-proxmox-prepare-coreos-install.yaml \
340-
-e @ocp/4.15/install_upi/ansible/defaults/main.yaml \
340+
ansible-playbook ocp/4.15/upi_proxmox/ansible/20-proxmox-prepare-coreos-install.yaml \
341+
-e @ocp/4.15/upi_proxmox/ansible/defaults/main.yaml \
341342
-e skip_download=true <1>
342343
----
343344
<1> Optional variable to skip downloading the ISO if it is already downloaded.
@@ -347,8 +348,8 @@ Extract the installation sources and scripts from the `openshift-install`, as
347348

348349
[source,bash]
349350
----
350-
ansible-playbook ocp/4.15/install_upi/ansible/25-ocp-services-show-rhcos-info.yaml \
351-
-e @ocp/4.15/install_upi/ansible/defaults/main.yaml
351+
ansible-playbook ocp/4.15/upi_proxmox/ansible/25-ocp-services-show-rhcos-info.yaml \
352+
-e @ocp/4.15/upi_proxmox/ansible/defaults/main.yaml
352353
----
353354

354355
Execute the `coreos-installer` command obtained on the previous Ansible
@@ -359,8 +360,8 @@ The VMs are setup so it's time to start the OpenShift cluster deployment.
359360

360361
[source,bash]
361362
----
362-
ansible-playbook ocp/4.15/install_upi/ansible/28-proxmox-vm-start-deployment.yaml \
363-
-e @ocp/4.15/install_upi/ansible/defaults/main.yaml
363+
ansible-playbook ocp/4.15/upi_proxmox/ansible/28-proxmox-vm-start-deployment.yaml \
364+
-e @ocp/4.15/upi_proxmox/ansible/defaults/main.yaml
364365
----
365366

366367
=== Followup on the deployment
@@ -413,8 +414,8 @@ Get the authentication.
413414

414415
[source,bash]
415416
----
416-
ansible-playbook ocp/4.15/install_upi/ansible/50-ocp-services-get-ocp-auth-playbook.yaml \
417-
-e @ocp/4.15/install_upi/ansible/defaults/main.yaml
417+
ansible-playbook ocp/4.15/upi_proxmox/ansible/50-ocp-services-get-ocp-auth-playbook.yaml \
418+
-e @ocp/4.15/upi_proxmox/ansible/defaults/main.yaml
418419
----
419420

420421
=== Copy the kubernetes config file
@@ -450,8 +451,8 @@ Add `-K`, or `--ask-become-pass` if your host required password for sudo.
450451

451452
[source,bash]
452453
----
453-
ansible-playbook ocp/4.15/install_upi/ansible/35-ocp-services-remove-bootstrap-haproxy-playbook.yaml \
454-
-e @ocp/4.15/install_upi/ansible/defaults/main.yaml
454+
ansible-playbook ocp/4.15/upi_proxmox/ansible/35-ocp-services-remove-bootstrap-haproxy-playbook.yaml \
455+
-e @ocp/4.15/upi_proxmox/ansible/defaults/main.yaml
455456
----
456457

457458
== Add Compute Nodes
@@ -460,8 +461,8 @@ Generate compute node VMS.
460461

461462
[source,bash]
462463
----
463-
ansible-playbook ocp/4.15/install_upi/ansible/01-proxmox-vms.yaml \
464-
-e @ocp/4.15/install_upi/ansible/defaults/main.yaml \
464+
ansible-playbook ocp/4.15/upi_proxmox/ansible/01-proxmox-vms.yaml \
465+
-e @ocp/4.15/upi_proxmox/ansible/defaults/main.yaml \
465466
-e '{"selected_groups": ["ocp_compute_node"]}'<1>
466467
-e '{"vm_host_list": ["ocp4-co-3"]}'<2>
467468
----
@@ -474,8 +475,8 @@ Start the `compute-node` VMs to execute the ignition installation.
474475

475476
[source,bash]
476477
----
477-
ansible-playbook ocp/4.15/install_upi/ansible/20-proxmox-prepare-coreos-install.yaml \
478-
-e @ocp/4.15/install_upi/ansible/defaults/main.yaml \
478+
ansible-playbook ocp/4.15/upi_proxmox/ansible/20-proxmox-prepare-coreos-install.yaml \
479+
-e @ocp/4.15/upi_proxmox/ansible/defaults/main.yaml \
479480
-e '{"selected_groups": ["ocp_compute_node"]}'
480481
-e '{"vm_host_list": ["ocp4-co-3"]}'
481482
-e skip_download=true
@@ -486,8 +487,8 @@ Extract the installation sources and scripts from the `openshift-install`, as
486487

487488
[source,bash]
488489
----
489-
ansible-playbook ocp/4.15/install_upi/ansible/25-ocp-services-show-rhcos-info.yaml \
490-
-e @ocp/4.15/install_upi/ansible/defaults/main.yaml
490+
ansible-playbook ocp/4.15/upi_proxmox/ansible/25-ocp-services-show-rhcos-info.yaml \
491+
-e @ocp/4.15/upi_proxmox/ansible/defaults/main.yaml
491492
----
492493

493494
Once all the VMs show the `Install complete` message the VMs are setup. It's
@@ -496,8 +497,8 @@ Once all the VMs show the `Install complete` message the VMs are setup. It's
496497

497498
[source,bash]
498499
----
499-
ansible-playbook ocp/4.15/install_upi/ansible/28-proxmox-vm-start-deployment.yaml \
500-
-e @ocp/4.15/install_upi/ansible/defaults/main.yaml \
500+
ansible-playbook ocp/4.15/upi_proxmox/ansible/28-proxmox-vm-start-deployment.yaml \
501+
-e @ocp/4.15/upi_proxmox/ansible/defaults/main.yaml \
501502
-e '{"selected_groups": ["ocp_compute_node"]}'
502503
-e '{"vm_host_list": ["ocp4-co-3"]}'
503504
----
@@ -540,8 +541,8 @@ The Openshift installation folder is required to maintain the cluster.
540541

541542
[source,bash]
542543
----
543-
ansible-playbook ocp/4.15/install_upi/ansible/99-ocp-services-ocp-clean-playbook.yaml \
544-
-e @ocp/4.15/install_upi/ansible/defaults/main.yaml \
544+
ansible-playbook ocp/4.15/upi_proxmox/ansible/99-ocp-services-ocp-clean-playbook.yaml \
545+
-e @ocp/4.15/upi_proxmox/ansible/defaults/main.yaml \
545546
-e remove_binaries_dir=true <1>
546547
----
547548
<1> Also remove the folder containing the OpenShift binaries
@@ -556,8 +557,8 @@ Remove the taints on the nodes so the control-plane nodes can execute
556557

557558
[source,bash]
558559
----
559-
ansible-playbook ocp/4.15/install_upi/ansible/31-ocp-services-remove-cp-taints.yaml \
560-
-e @ocp/4.15/install_upi/ansible/defaults/main.yaml
560+
ansible-playbook ocp/4.15/upi_proxmox/ansible/31-ocp-services-remove-cp-taints.yaml \
561+
-e @ocp/4.15/upi_proxmox/ansible/defaults/main.yaml
561562
----
562563

563564
=== No CNI configuration file in /etc/kubernetes/cni/net.d/. Has your network provider started?
File renamed without changes.
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
- name: "Generate OCP Cluster installation (deprecated)"
3+
hosts: "ocp_services"
4+
gather_facts: true
5+
6+
pre_tasks:
7+
- name: "Validate required variables"
8+
ansible.builtin.assert:
9+
that:
10+
- "ocp_install_root_dir is defined and ocp_install_root_dir | length > 0"
11+
12+
- name: "Set variables"
13+
ansible.builtin.set_fact:
14+
openshift_client_root_url: "https://mirror.openshift.com/pub/openshift-v4/{{ ocp_release_arch }}/clients/ocp/{{ ocp_version }}"
15+
16+
- name: "Define variables"
17+
ansible.builtin.include_tasks:
18+
file: tasks/set_ocp_install_dir.yaml
19+
20+
tasks:
21+
- name: "Create openshift install root directory"
22+
ansible.builtin.file:
23+
path: "{{ openshift_install_dir }}"
24+
state: directory
25+
mode: '0755'
26+
27+
- name: "Get release information"
28+
ansible.builtin.get_url:
29+
url: "{{ openshift_client_root_url }}/release.txt"
30+
dest: "{{ openshift_install_dir }}/"
31+
# mode: '0440'
32+
33+
- name: "Get release image name"
34+
ansible.builtin.shell: |
35+
grep 'Pull From: quay.io' release.txt | awk -F ' ' '{print $3}'
36+
args:
37+
chdir: "{{ openshift_install_dir }}"
38+
register: image_name_res
39+
40+
- name: "Print image name"
41+
ansible.builtin.debug:
42+
msg:
43+
- "image_name_res: {{ image_name_res.stdout }}"
44+
45+
- name: "Download the ocp installer and client"
46+
ansible.builtin.get_url:
47+
url: "{{ openshift_client_root_url }}/{{ item }}"
48+
dest: "{{ openshift_install_dir }}/{{ item }}"
49+
loop:
50+
- openshift-install-linux.tar.gz
51+
- openshift-client-linux.tar.gz
52+
when: skip_download is undefined or not (skip_download | bool)
53+
54+
- name: "Extract the ocp installer and client"
55+
ansible.builtin.unarchive:
56+
src: "{{ openshift_install_dir }}/{{ item }}"
57+
dest: "{{ openshift_install_dir }}"
58+
remote_src: true
59+
loop:
60+
- openshift-install-linux.tar.gz
61+
- openshift-client-linux.tar.gz
62+
when: skip_download is undefined or not (skip_download | bool)
63+
64+
- name: "Print image name"
65+
ansible.builtin.debug:
66+
msg:
67+
- "Installation folder: {{ openshift_install_dir }}/"
68+
- "image_name_res: {{ image_name_res.stdout }}"
69+
70+
...

ocp/4.15/install_upi/ansible/10-ocp-services-config-host-playbook.yaml renamed to ocp/4.15/upi_proxmox/ansible/10-ocp-services-config-host-playbook.yaml

File renamed without changes.

ocp/4.15/install_upi/ansible/15-ocp-services-haproxy-playbook.yaml renamed to ocp/4.15/upi_proxmox/ansible/15-ocp-services-haproxy-playbook.yaml

File renamed without changes.

ocp/4.15/install_upi/ansible/18-ocp-services-oi-playbook.yaml renamed to ocp/4.15/upi_proxmox/ansible/18-ocp-services-oi-playbook.yaml

File renamed without changes.

0 commit comments

Comments
 (0)