Skip to content

Commit

Permalink
User Data Netplan (#1705)
Browse files Browse the repository at this point in the history
* docs: initial draft

* docs: updated cloud-init.md with Netplan network configuration section

* docs: fixed link on cloud-init.md file

* Apply suggestions from code review

Co-authored-by: Karl Cardenas <karl@spectrocloud.com>

* docs: added tip section PE-2882

* chore: updated Vale vocabs

---------

Co-authored-by: Carolina Delwing Rosa <carolina.delwing@spectrocloud.com>
Co-authored-by: Karl Cardenas <karl@spectrocloud.com>
  • Loading branch information
3 people authored Oct 25, 2023
1 parent 183e64a commit 05f011b
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
52 changes: 52 additions & 0 deletions docs/docs-content/clusters/edge/edge-configuration/cloud-init.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,57 @@ stages:
insecure_skip_verify: true
```


#### Configure Network With Netplan

You can use the `initramfs` stage and [Netplan](https://netplan.io) to configure network settings before the network initialization. Netplan is a tool that enables you to specify network configurations on Linux systems. Note that this approach is available for Linux systems with Netplan installed. Refer to the [Netplan Documentation](https://netplan.readthedocs.io/en/stable/) for installation guidance and the [Netplan How-to Guides](https://netplan.readthedocs.io/en/stable/examples/) for more information.


```yaml
stages:
initramfs:
- users:
kairos:
groups:
- sudo
passwd: kairos
- commands:
- netplan apply
files:
- content: |
network:
version: 2
renderer: networkd
ethernets:
ens160:
dhcp4: false
addresses:
- 10.10.190.11/18
gateway4: 10.10.128.1
nameservers:
addresses:
- 8.8.8.8
- 1.1.1.1
encoding: ""
group: 0
owner: 0
ownerstring: ""
path: /etc/netplan/99_config.yaml
permissions: 420
name: Config network with Netplan
```

:::tip

When using the EdgeForge workflow with CanvOS, ensure you add Netplan to the Dockerfile. In the example below, Netplan is installed in an Ubuntu image.

```shell
apt-get update && apt-get install netplan.io -y
```

:::


#### Erase Partitions

You can use the `before-install` stage to remove partitions if needed.
Expand Down Expand Up @@ -167,6 +218,7 @@ stages:
- snap install amazon-ssm-agent --classic
```


#### Pass a Sensitive Information

If you need to transmit sensitive information, such as credentials, during the site installation phase, you can make the Edge installer skip copying specific stages to the edge hosts. The Edge installer will skip copying the stages that follow the `skip-copy-[string]` naming convention. Refer to the [Sensitive Information in the User Data Stages](skip-copying-stages.md) guide to learn more.
Expand Down
3 changes: 2 additions & 1 deletion vale/styles/Vocab/Internal/accept.txt
Original file line number Diff line number Diff line change
Expand Up @@ -153,4 +153,5 @@ jq
Caddy
jumpbox
Oras
oras
oras
Netplan

0 comments on commit 05f011b

Please sign in to comment.