Skip to content

Commit 8b46108

Browse files
alefestagitbook-bot
authored andcommitted
GitBook: [master] 2 pages modified
1 parent bc1ed15 commit 8b46108

File tree

2 files changed

+122
-0
lines changed

2 files changed

+122
-0
lines changed

SUMMARY.md

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* [What we are trying to solve \(a.k.a Our Goals\)](what-we-are-trying-to-solve-a.k.a-our-goals.md)
55
* [Quick Start](quick-start.md)
66
* [Command Reference](command-reference.md)
7+
* [Config File Reference](config-file-reference.md)
78
* [Remove k3ai \(Work In Progress\)](remove-k3ai.md)
89
* [Contributing](contributing.md)
910

config-file-reference.md

+121
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
# Config File Reference
2+
3+
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.
4+
5+
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.
6+
7+
A single config file may host multiple configurations, hence is capable to deploy multiple clusters at the same time.
8+
9+
## Generic Section
10+
11+
```yaml
12+
kind: cluster
13+
targetCustomizations:
14+
```
15+
16+
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.
17+
18+
## Common Sections
19+
20+
```yaml
21+
kind: cluster
22+
targetCustomizations:
23+
- name: localK3s #name of the cluster instance not the name of the cluster
24+
enabled: false
25+
type: k3s
26+
...
27+
clusterName: demo-wsl-k3s
28+
clusterDeployment: local
29+
30+
spec:
31+
wsl: "https://github.com/rancher/k3s/releases/download/v1.19.4%2Bk3s1/k3s"
32+
mac:
33+
linux: "https://get.k3s.io | K3S_KUBECONFIG_MODE=644 sh -s -"
34+
windows:
35+
plugins:
36+
- repo:
37+
name:
38+
- repo:
39+
name:
40+
```
41+
42+
* **name**: is the instance name as an internal reference for K3ai. Is not currently used so it act as a placeholder right now
43+
* **enabled**: if set to true the section will be used and the cluster will be deployed
44+
* **type**: represent the cluster to be installed: k3s,k3d,k0s,kinD
45+
* **clusterName**: this is the name of the cluster \(if applicable\), it's useful to deploy multiple clusters of the same type
46+
* **clusterDeployment**: local or cloud. For the cloud specs see below.
47+
* **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.
48+
* **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.
49+
50+
### Rancher K3s Config Specifics
51+
52+
```yaml
53+
...
54+
type: k3s
55+
#default location of config file or your existing config file to copy
56+
config: "/etc/rancher/k3s/k3s.yaml"
57+
...
58+
clusterStart: "sudo bash -ic 'k3s server --write-kubeconfig-mode 644 > /dev/null 2>&1 &'"
59+
60+
```
61+
62+
### Rancher K3d Config Specifics
63+
64+
```yaml
65+
type: k3d
66+
...
67+
clusterStart: "k3d cluster create"
68+
spec:
69+
wsl: "https://kind.sigs.k8s.io/dl/v0.9.0/kind-linux-amd64"
70+
mac: "https://kind.sigs.k8s.io/dl/v0.9.0/kind-darwin-amd64"
71+
linux: "https://kind.sigs.k8s.io/dl/v0.9.0/kind-linux-amd64"
72+
windows: "https://github.com/rancher/k3d/releases/download/v3.4.0-test.0/k3d-windows-amd64.exe"
73+
```
74+
75+
### Mirantis K0s Config Specifics
76+
77+
```yaml
78+
type: k0s
79+
#default location of config file or your existing config file to copy
80+
config: "${HOME}/.k3ai/kubeconfig"
81+
...
82+
clusterStart: "k0s default-config | tee ${HOME}/.k3ai/k0s.yaml &&
83+
sudo bash -ic 'k0s server -c ${HOME}/.k3ai/k0s.yaml --enable-worker > /dev/null 2>&1 &' &&
84+
sudo cat /var/lib/k0s/pki/admin.conf > $HOME/.k3ai/k0s-config"
85+
spec:
86+
```
87+
88+
Do not copy the above, has been truncated to make it more readable.
89+
90+
### KinD Config Specifics
91+
92+
```yaml
93+
type: kind
94+
config:
95+
...
96+
clusterStart: "kind create cluster"
97+
spec:
98+
wsl: "https://kind.sigs.k8s.io/dl/v0.9.0/kind-linux-amd64"
99+
mac: "https://kind.sigs.k8s.io/dl/v0.9.0/kind-darwin-amd64"
100+
linux: "https://kind.sigs.k8s.io/dl/v0.9.0/kind-linux-amd64"
101+
windows: "https://kind.sigs.k8s.io/dl/v0.9.0/kind-windows-amd64"
102+
```
103+
104+
### Remote Clusters Specifics
105+
106+
```yaml
107+
enabled: false
108+
clusterDeployment: cloud
109+
clusterStart:
110+
spec:
111+
wsl:
112+
mac:
113+
linux:
114+
windows:
115+
cloudType: civo
116+
cloudNodes: 1
117+
cloudSecretPath: $HOME/.k3ai/secret.txt
118+
```
119+
120+
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.
121+

0 commit comments

Comments
 (0)