Skip to content

Commit

Permalink
linter fix
Browse files Browse the repository at this point in the history
  • Loading branch information
christofluethi committed Aug 23, 2024
1 parent 5060a11 commit db28a54
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 27 deletions.
26 changes: 14 additions & 12 deletions content/en/docs/05/52_cloud-init.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ In this section we will use cloud-init to initialize a Fedora Cloud[^1] VM. Clou
startup scripts to VMs.

Cloud-init is widely adopted. Some of the known users of cloud-init are:
- Ubuntu
- Arch Linux
- CentOS
- Red Hat
- FreeBSD
- Fedora
- Gentoo Linux
- openSUSE
* Ubuntu
* Arch Linux
* CentOS
* Red Hat
* FreeBSD
* Fedora
* Gentoo Linux
* openSUSE


## Supported datasources
Expand Down Expand Up @@ -242,10 +242,10 @@ spec:
In the previous section we have created a VM using a cloud-init script. Enhance the startup script with the following functionality:
- Set the Timezone to `Europe/Zurich`
- Install nginx package
- Write a custom nginx.conf to `/etc/nginx/nginx.conf`
- Start the nginx service
* Set the Timezone to `Europe/Zurich`
* Install nginx package
* Write a custom nginx.conf to `/etc/nginx/nginx.conf`
* Start the nginx service

For the custom nginx configuration you can use the following content:
```text
Expand Down Expand Up @@ -383,6 +383,7 @@ virtctl console {{% param "labsubfolderprefix" %}}{{% param "labfoldernumber" %}
```
{{% /alert %}}


## {{% task %}} Testing your webserver on your Virtual Machine

We have spawn a Virtual Machine which uses cloud-init and installs a simple nginx webserver. Let us test the webserver:
Expand Down Expand Up @@ -415,6 +416,7 @@ GMT time: Thursday, 22-Aug-2024 14:13:17 GMT
Local time: Thursday, 22-Aug-2024 16:13:17 CEST
```
## Reference
You may find additional Information about cloud-init here:
Expand Down
38 changes: 23 additions & 15 deletions content/en/docs/05/53_ignition.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,18 @@ description: >
In the previous section we created a VM using a cloud-init configuration secret. This time we will do something similar but with Ignition and Linux Fedora CoreOS.

Known users of Ignition are:
- Fedora CoreOS
- Red Hat Enterprise Linux CoreOS
- Flatcar
- openSUSE MicroOS
- SUSE Linux Enterprise Micro
* Fedora CoreOS
* Red Hat Enterprise Linux CoreOS
* Flatcar
* openSUSE MicroOS
* SUSE Linux Enterprise Micro


## Supported datasources

To provide Ignition data we have to use the ConfigDrive datasource.


### ConfigDrive datasource

The relevant configuration of a ConfigDrive datasource in a VM looks like this:
Expand All @@ -45,6 +47,7 @@ Similar to cloud-init, this volume must be referenced after the vm disk in the `
```

Using the `cloudInitConfigDrive` attribute give us the following possibilities to provide our Ignition configuration:

* `userData`: inline Ignition configuration
* `userDataBase64`: Ignition configuration as base64 string.
* `secretRef`: reference to a k8s secret containing Ignition configuration.
Expand All @@ -56,7 +59,9 @@ JSON config if needed. As our config for the Lab is simple enough we directly wr
Make sure you use `secretRef` whenever you provide sensitive production information.
{{% /alert %}}


## {{% task %}} Creating an Ignition config secret

This time we are going to use a Fedora CoreOS VM and provide an Ignition configuration to initialize our vm.

First we define our configuration. Create a file `ignition-data.yaml` with the following content:
Expand Down Expand Up @@ -106,6 +111,7 @@ The output should be:
secret/{{% param "labsubfolderprefix" %}}{{% param "labfoldernumber" %}}-ignition created
```


## {{% task %}} Creating a VirtualMachine using Ignition

Create a file `vm_{{% param "labsubfolderprefix" %}}{{% param "labfoldernumber" %}}-ignition.yaml` and start with the
Expand Down Expand Up @@ -189,16 +195,17 @@ spec:
```
{{% /details %}}
## {{% task %}} Enhance your startup script
Enhance your Ignition configuration to include the following configurations:
- Create a group `ssh-users`
- Add user `core` to the group `docker` and `ssh-users`
- Add a `sshAuthorizedKeys` for the user `core`. See instructions below to generate your ssh key.
- Set the Hostname to `lab05-ignition-$USER` where `$USER` is your username
- Configure the SSH Daemon with:
- Disable root login
- Allow only group `ssh-users` to login through ssh.
* Create a group `ssh-users`
* Add user `core` to the group `docker` and `ssh-users`
* Add a `sshAuthorizedKeys` for the user `core`. See instructions below to generate your ssh key.
* Set the Hostname to `lab05-ignition-$USER` where `$USER` is your username
* Configure the SSH Daemon with:
* Disable root login
* Allow only group `ssh-users` to login through ssh.

Generate your ssh key with the following command:
```shell
Expand All @@ -215,7 +222,7 @@ Your output should be similar to:
ssh-rsa AAAAB3NzaC[...] theia@$USER-webshell-554b45d885-b79ks
```

Make sure the key starts with ssh-rsa and copy the key to the `sshAuthorizedKeys` attribute.
Make sure the key starts with ssh-rsa and copy the key to the `sshAuthorizedKeys` attribute.

{{% details title="Task Hint" %}}
Make sure you replace the `$USER` and the `passwordHash` and `sshAuthorizedKeys` hashes. Your Ignition configuration will look like this:
Expand Down Expand Up @@ -271,6 +278,7 @@ Make sure you replace the `$USER` and the `passwordHash` and `sshAuthorizedKeys`
```
{{% /details %}}


## {{% task %}} Testing your webserver on your Virtual Machine

You may now be able to login from your webshell to your VM:
Expand Down Expand Up @@ -307,6 +315,6 @@ hostname

You may find additional Information about Ignition here:

- [Ignition Examples](https://coreos.github.io/ignition/examples/)
- [Supported Platforms](https://coreos.github.io/ignition/supported-platforms/)
* [Ignition Examples](https://coreos.github.io/ignition/examples/)
* [Supported Platforms](https://coreos.github.io/ignition/supported-platforms/)

3 changes: 3 additions & 0 deletions content/en/docs/_index.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@

---


title: "Labs"
weight: 2
menu:
main:
weight: 2
---


## Lab Introduction

0 comments on commit db28a54

Please sign in to comment.