Config File Reference
Starting from K3ai 0.2.0 we introduced a configuration file to allow a user to deploy various flavors of Kubernetes both locally and remotely.
The config file is typically saved in <yourhomedir>/.k3ai but could be moved around and/or hosted on other locations. We currently do not support remote config files.
A single config file may host multiple configurations, hence is capable to deploy multiple clusters at the same time.

Generic Section

1
kind: cluster
2
targetCustomizations:
Copied!
The kind definition at the beginning of the config file indicates that all the pieces of information below are relative to the infrastructure deployment. We did this with the intention later to have the capability to split the config behavior and possibly call other config files.

Common Sections

1
kind: cluster
2
targetCustomizations:
3
- name: localK3s #name of the cluster instance not the name of the cluster
4
enabled: false
5
type: k3s
6
...
7
clusterName: demo-wsl-k3s
8
clusterDeployment: local
9
10
spec:
11
wsl: "https://github.com/rancher/k3s/releases/download/v1.19.4%2Bk3s1/k3s"
12
mac:
13
linux: "https://get.k3s.io | K3S_KUBECONFIG_MODE=644 sh -s -"
14
windows:
15
plugins:
16
- repo:
17
name:
18
- repo:
19
name:
Copied!
    name: is the instance name as an internal reference for K3ai. Is not currently used so it act as a placeholder right now
    enabled: if set to true the section will be used and the cluster will be deployed
    type: represent the cluster to be installed: k3s,k3d,k0s,kinD
    clusterName: this is the name of the cluster (if applicable), it's useful to deploy multiple clusters of the same type
    clusterDeployment: local or cloud. For the cloud specs see below.
    spec: For each deployment, there are various options and binaries so dependening of where you're going to install we will take care of the right version+location. This is also useful if you want to test on a specific version.
    plugins: repo is the URL where the plugin are hosted. If you are using the public ones you may leave it empty, name is the name of the plugin as it appears from k3ai-cli list currently we do not support groups yet in the config file.

Rancher K3s Config Specifics

1
...
2
type: k3s
3
#default location of config file or your existing config file to copy
4
config: "/etc/rancher/k3s/k3s.yaml"
5
...
6
clusterStart: "sudo bash -ic 'k3s server --write-kubeconfig-mode 644 > /dev/null 2>&1 &'"
7
Copied!

Rancher K3d Config Specifics

1
type: k3d
2
...
3
clusterStart: "k3d cluster create"
4
spec:
5
wsl: "https://kind.sigs.k8s.io/dl/v0.9.0/kind-linux-amd64"
6
mac: "https://kind.sigs.k8s.io/dl/v0.9.0/kind-darwin-amd64"
7
linux: "https://kind.sigs.k8s.io/dl/v0.9.0/kind-linux-amd64"
8
windows: "https://github.com/rancher/k3d/releases/download/v3.4.0-test.0/k3d-windows-amd64.exe"
Copied!

Mirantis K0s Config Specifics

1
type: k0s
2
#default location of config file or your existing config file to copy
3
config: "${HOME}/.k3ai/kubeconfig"
4
...
5
clusterStart: "k0s default-config | tee ${HOME}/.k3ai/k0s.yaml &&
6
sudo bash -ic 'k0s server -c ${HOME}/.k3ai/k0s.yaml --enable-worker > /dev/null 2>&1 &' &&
7
sudo cat /var/lib/k0s/pki/admin.conf > $HOME/.k3ai/k0s-config"
8
spec:
Copied!
Do not copy the above, has been truncated to make it more readable.

KinD Config Specifics

1
type: kind
2
config:
3
...
4
clusterStart: "kind create cluster"
5
spec:
6
wsl: "https://kind.sigs.k8s.io/dl/v0.9.0/kind-linux-amd64"
7
mac: "https://kind.sigs.k8s.io/dl/v0.9.0/kind-darwin-amd64"
8
linux: "https://kind.sigs.k8s.io/dl/v0.9.0/kind-linux-amd64"
9
windows: "https://kind.sigs.k8s.io/dl/v0.9.0/kind-windows-amd64"
Copied!

Remote Clusters Specifics

1
enabled: false
2
clusterDeployment: cloud
3
clusterStart:
4
spec:
5
wsl:
6
mac:
7
linux:
8
windows:
9
cloudType: civo
10
cloudNodes: 1
11
cloudSecretPath: $HOME/.k3ai/secret.txt
Copied!
We currently support only Civo Cloud. Notice that the cloudSecretPath is a placeholder we are going to add this feature but for the time being, you'll need to pass the key through the terminal directly.
Last modified 10mo ago