Skip to content

Commit

Permalink
0.3.0 (#18)
Browse files Browse the repository at this point in the history
* docs: bump dependencies to latest version
* docs: remove stale sections
  • Loading branch information
raballew authored Nov 7, 2022
1 parent 8a376f7 commit 1dc4844
Show file tree
Hide file tree
Showing 33 changed files with 9,166 additions and 2,463 deletions.
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ several ways to contribute, and we appreciate all of them.
This repository contains the OKD The Hard Way labs documentation and resources.

If you are porting OKD The Hard Way to a different environment, that code should
go in a seperate repository. Of course, if your port requires in changes in this
go in a separate repository. Of course, if your port requires in changes in this
code base, we encourage you to contribute them here.

## Bug Reports
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
.vscode

**/pull-secret.txt
**/pull-secret-cluster.txt
**/pull-secret-cluster.txt
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MIT License
===========

Copyright (c) 2021 Paul Wallrabe
Copyright (c) 2022 Paul Wallrabe

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
Expand Down
44 changes: 23 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,21 +19,22 @@ real world scenarios.

### Nodes

| # | OS | RAM | CPU | Disk | Usage |
| - | ---------------- | ----- | ---- | --------------- | ------------- |
| 1 | Fedora | 8 GB | 2 | 256 GB | services |
| 1 | Fedora Core OS | 16 GB | 4 | 128 GB | bootstrap |
| 3 | Fedora Core OS | 16 GB | 4 | 128 GB | master |
| 3 | Fedora Core OS | 16 GB | 4 | 128 GB | compute |
| 3 | Fedora Core OS | 16 GB | 4 | 128 GB | infra |
| 3 | Fedora Core OS | 32 GB | 8 | 128 GB + 256 GB | storage |
| # | OS | RAM | CPU | Disk | Usage |
| - | -------------- | ----- | --- | --------------- | --------- |
| 1 | Fedora | 8 GB | 2 | 256 GB | services |
| 1 | Fedora Core OS | 16 GB | 4 | 128 GB | bootstrap |
| 3 | Fedora Core OS | 16 GB | 4 | 128 GB | master |
| 3 | Fedora Core OS | 16 GB | 4 | 128 GB | compute |
| 3 | Fedora Core OS | 16 GB | 4 | 128 GB | infra |
| 3 | Fedora Core OS | 32 GB | 8 | 128 GB + 256 GB | storage |

### Components

* [Fedora 34](https://getfedora.org/en/server/)
* [OKD 4.8.0-0.okd-2021-10-24-061736](https://github.com/openshift/okd/releases)
* [Rook Ceph 1.7.6](https://github.com/rook/rook)
* [MetalLB 0.10.3](https://github.com/metallb/metallb)
* [Fedora 36](https://getfedora.org/en/server/)
* [OKD
4.11.0-0.okd-2022-10-15-073651](https://github.com/openshift/okd/releases)
* [Rook Ceph 1.10.4](https://github.com/rook/rook)
* [MetalLB 0.13.7](https://github.com/metallb/metallb)

## Labs

Expand All @@ -45,7 +46,7 @@ all steps required to setup a new cluster.
* [Services](docs/02-services.md)
* [Installation](docs/03-installation.md)

Part two will then prepare the cluster for multitenant production workloads and
Part two will then prepare the cluster for multi-tenant production workloads and
operations.

* [Authentication](docs/10-authentication.md)
Expand All @@ -58,14 +59,15 @@ operations.

Everything mentioned in parts one and two is explained in detail but the
drawback is that all the steps need to be performed manually. In the event of a
disaster it will take quite some time to recover from the outage. Therefore the
third part leverages the previously gained knowledge to build a fully automated
process to spin up and maintain your cluster.

* [Deploy](docs/20-deploy.md)
* [Maintain](docs/21-maintain.md)
* [Usage](docs/22-usage.md)
* [Disaster Recovery](docs/23-disaster-recovery.md)
disaster it will take quite some time to recover from the outage. Therefore it
is recommended to build a fully automated process to spin up and maintain your
cluster, but as this lab is designed with a no-scripts mindset, that is
something you need to figure on your own. The following sections contains a
bunch of helpful comments on various topics such as cluster operations or useful
code snippets.

* [Maintain](docs/20-maintain.md)
* [Usage](docs/21-usage.md)

Whenever things break or an unexpected issue occurs, please refer to the
[troubleshooting](docs/99-troubleshooting.md) section. You can also create a new
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ We are extremely grateful for anyone that report vulnerabilities to the `OKD The
Hard Way` Open Source Community. All reports are thoroughly investigated by a
set of community volunteers.

To make a report, submit your vulnerability as a new issure or pull request.
To make a report, submit your vulnerability as a new issue or pull request.
Make sure to choose the `security` label for your issue or PR.

### When Should I Report a Vulnerability?
Expand Down
7 changes: 4 additions & 3 deletions docs/00-prerequisites.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ you plan to run some workload beyond the scope of this tutorial:
* 1 GBit/s network interface
* Internet access
* Virtualization capabilities
* Fedora 34 installed
* Fedora 36 installed
* x86_64 system architecture

If this setup does not fit into your budget or if you are not able to find a
Expand Down Expand Up @@ -51,14 +51,15 @@ starting, make yourself familiar with the following:
* Virtual machines

Whenever you think it is unclear why or how a step in the lab is performed,
[create a new issue](https://github.com/openshift/okd/issues/new/choose)
[create a new
issue](https://github.com/raballew/okd-the-hard-way/issues/new/choose)
explaining where you have trouble so that the content necessary to fill the gap
can be added.

## Time

The total time needed will vary but without any previous knowledge and if you
can resist to simply copy-paste the commands without thinking, you will probably
need a week or two to complete and understand the lab.
need a week to complete and understand the lab.

Next: [Hypervisor](01-hypervisor.md)
47 changes: 28 additions & 19 deletions docs/01-hypervisor.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,28 @@ In this section you will prepare the bare metal host in a way, that it will be
capable of running virtualized workload. This will include the initial setup of
storage and networking.

## Variables
## Environment Variables

For convinience and readability set the following variables. `FEDORA_VERSION`
For convenience and readability set the following variables. `FEDORA_VERSION`
defines the release of Fedora that should be used for installing the services
machine. The fully qualified domain name (FQDN) in the tree hierarchy of the
Domain Name System (DNS) should be equal to `$SUB_DOMAIN.$BASE_DOMAIN`:
Domain Name System (DNS) should be equal to `SUB_DOMAIN.BASE_DOMAIN`.

> Adjust `SUB_DOMAIN` and `BASE_DOMAIN` to your needs if required. Make sure to
> set this environment variables are set whenever you are working on the lab.
You can set the environment variables automatically by adding them to the
personal initialization file `~/.bash_profile` that configures the user
environment:

```bash
[root@okd ~]# export FEDORA_VERSION=34
[root@okd ~]# export SUB_DOMAIN=okd
[root@okd ~]# export BASE_DOMAIN=example.com
[root@okd ~]# export OKD_VERSION=4.8.0-0.okd-2021-10-24-061736
[root@okd ~]# echo "export SUB_DOMAIN=okd" >> ~/.bash_profile
[root@okd ~]# echo "export BASE_DOMAIN=example.com" >> ~/.bash_profile
[root@okd ~]# echo "export FEDORA_VERSION=36" >> ~/.bash_profile
[root@okd ~]# echo "export OKD_VERSION=4.11.0-0.okd-2022-10-28-153352" >> ~/.bash_profile
[root@okd ~]# source ~/.bash_profile
```

> Adjust `SUB_DOMAIN` and `BASE_DOMAIN` to your needs if required.
## Packages

Install the virtualization tools via the command line using the virtualization
Expand Down Expand Up @@ -80,7 +86,7 @@ Create the user `okd` and assign any password you like.
On Fedora, it is the wheel group the user has to be added to, as this group has
full administrative privileges. libvirt is needed to manage virtual machines and
networks. Those tasks usually requires more permissions. Add the `okd` user to
the group using the following command:
the groups using the following command:

```bash
[root@okd ~]# usermod -aG wheel okd
Expand All @@ -90,9 +96,12 @@ the group using the following command:
Then switch to the user `okd`.

```bash
[root@okd ~]# su -w FEDORA_VERSION -w BASE_DOMAIN -w SUB_DOMAIN - okd
[root@okd ~]# su - okd
```

Now run the commands to setup the [environment
variables](#environment-variables) again.

## Repository

Clone this repository to easily access resource definitions on the hypervisor:
Expand All @@ -101,7 +110,7 @@ Clone this repository to easily access resource definitions on the hypervisor:
[okd@okd ~]$ git clone https://github.com/raballew/okd-the-hard-way.git
```

Then replace all occurences of `BASE_DOMAIN` and `SUB_DOMAIN` in the sources
Then replace all occurrences of `BASE_DOMAIN` and `SUB_DOMAIN` in the sources
files, so that the configuration is tailored to your specific environment.

```bash
Expand All @@ -127,9 +136,9 @@ Then fix potential permission issues by running libvirt as `okd` user instead of
`qemu`.

```bash
[root@okd ~]# sed -i 's/#user = "root"/user = "okd"/g' /etc/libvirt/qemu.conf
[root@okd ~]# sed -i 's/#group = "root"/group = "okd"/g' /etc/libvirt/qemu.conf
[root@okd ~]# systemctl restart libvirtd
[okd@okd ~]$ sudo sed -i 's/#user = "root"/user = "okd"/g' /etc/libvirt/qemu.conf
[okd@okd ~]$ sudo sed -i 's/#group = "root"/group = "okd"/g' /etc/libvirt/qemu.conf
[okd@okd ~]$ sudo systemctl restart libvirtd
```

## Storage
Expand Down Expand Up @@ -158,7 +167,7 @@ Create the storage pool which will be used to serve the VM disk images:

Creating an empty disk image for each VM ensures that the content of each VM is
stored in a predefined location. This is not a mandatory step, but it helps to
simplyfy things later on and keep track of which storage is consumed by which
simplify things later on and keep track of which storage is consumed by which
VM.

Each node of the cluster will get a 128G large disk attached to it, with
Expand Down Expand Up @@ -196,14 +205,14 @@ system on the services VM.
Download the Fedora Server ISO file:

```bash
[okd@okd ~]$ curl -X GET "https://download.fedoraproject.org/pub/fedora/linux/releases/$FEDORA_VERSION/Server/x86_64/iso/Fedora-Server-dvd-x86_64-$FEDORA_VERSION-1.2.iso" -o ~/images/Fedora-Server-dvd-x86_64-$FEDORA_VERSION-1.2.iso -L
[okd@okd ~]$ curl -X GET "https://download.fedoraproject.org/pub/fedora/linux/releases/$FEDORA_VERSION/Server/x86_64/iso/Fedora-Server-dvd-x86_64-$FEDORA_VERSION-1.5.iso" -o ~/images/Fedora-Server-dvd-x86_64-$FEDORA_VERSION-1.5.iso -L
```

## Network

### Virtual Network

It is a good practice to move network traffic into a seperate virual network,
It is a good practice to move network traffic into a separate virtual network,
but even the default network created by libvirt could be used. The network
should have no Network Address Translation (NAT) enabled to setup an isolated
network and all desired Media Access Control (MAC) and Internet Protocol (IP)
Expand Down Expand Up @@ -242,7 +251,7 @@ default libvirt network. Start the installation of the services VM:
--controller scsi,model=virtio-scsi \
--network network=default \
--network network=okd \
--location ~/images/Fedora-Server-dvd-x86_64-$FEDORA_VERSION-1.2.iso \
--location ~/images/Fedora-Server-dvd-x86_64-$FEDORA_VERSION-1.5.iso \
--initrd-inject=/home/okd/okd-the-hard-way/src/01-hypervisor/services.ks \
--extra-args "console=ttyS0,115200 inst.ks=file:/services.ks" \
--ram 8192 \
Expand Down
Loading

0 comments on commit 1dc4844

Please sign in to comment.