Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom bootstrap configuration Documentation #935

Merged
merged 6 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/src/_parts/bootstrap_config.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Configuration options for the network feature.
**Type:** `bool`<br>

Determines if the feature should be enabled.
If omitted defaults to `true`
If omitted defaults to `false`

### cluster-config.dns
**Type:** `object`<br>
Expand All @@ -22,7 +22,7 @@ Configuration options for the dns feature.
**Type:** `bool`<br>

Determines if the feature should be enabled.
If omitted defaults to `true`
If omitted defaults to `false`

### cluster-config.dns.cluster-domain
**Type:** `string`<br>
Expand Down Expand Up @@ -170,7 +170,7 @@ Configuration options for the gateway feature.
**Type:** `bool`<br>

Determines if the feature should be enabled.
If omitted defaults to `true`.
If omitted defaults to `false`.

### cluster-config.metrics-server
**Type:** `object`<br>
Expand Down
83 changes: 83 additions & 0 deletions docs/src/snap/howto/install/custom-bootstrap-config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Custom bootstrap configuration

When creating a {{ product }} cluster that differs from the default
configuration you can choose to use a custom bootstrap configuration.
The CLI's interactive mode or a custom bootstrap configuration file allow you
to modify the configuration of the first node of your cluster.
louiseschmidtgen marked this conversation as resolved.
Show resolved Hide resolved

## Configuration options

Please consult the [reference page] for all of the
available configuration options and their defaults.

``` {note}
Most of these configuration options are set during the initial bootstrapping
and cannot be modified afterward. Runtime changes may be unsupported and
could require deploying a new cluster. Refer to the reference page to
louiseschmidtgen marked this conversation as resolved.
Show resolved Hide resolved
determine if an option allows later modifications.
```

## Interactive mode

The interactive mode allows for the selection of the built-in features, the pod
CIDR and the Service CIDR.

To bootstrap interactively, run:

```
sudo k8s bootstrap --timeout 10m --interactive
```

Here is an example custom configuration:

```
Which features would you like to enable? (network, dns, gateway, ingress, local-storage, load-balancer) [network, dns, gateway, local-storage]: network,ingress,dns
Please set the Pod CIDR: [10.1.0.0/16]: 10.1.0.0/16,fd01::/108
Please set the Service CIDR: [10.152.183.0/24]: 10.152.183.0/24,fd98::/108
```

The expected output shows your node's ip that will differ from this example:

```
Bootstrapping the cluster. This may take a few seconds, please wait.
Bootstrapped a new Kubernetes cluster with node address "192.122.3.111:6400".
The node will be 'Ready' to host workloads after the CNI is deployed successfully.
```

## Bootstrap configuration file

If your deployment requires a more fine-tuned configuration, use the bootstrap
configuration file.

``` {note}
When using the custom configuration file on bootstrap, all features including
network, dns, gateway, ingress, load-balancer and local-storage are disabled
by default.
```

For this example, create a custom bootstrap configuration file that enables
the network feature:

```yaml
cat <<EOF > bootstrap.yaml
cluster-config:
network:
enabled: true
EOF
```

Then, apply the bootstrap configuration file:

```
sudo k8s bootstrap --file /path/to/bootstrap.yaml
```

To verify any changes to the built-in features run:

```
sudo k8s status
```

<!-- LINKS -->

[reference page]: /src/snap/reference/bootstrap-config-reference.md
1 change: 1 addition & 0 deletions docs/src/snap/howto/install/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ the current How-to guides below.
:titlesonly:

Install from a snap <snap.md>
custom-bootstrap-config
multipass
Install in LXD <lxd.md>
Install in air-gapped environments <offline.md>
Expand Down
Loading