Command Reference
This the list of all command available within k3ai
To get the list simply type k3ai -h
1
k3ai is a lightweight infrastructure-in-a-box solution specifically built to
2
install and configure AI tools and platforms in production environments on Edge
3
and IoT devices as easily as local test environments.
4
5
Usage:
6
k3ai [command]
7
8
Available Commands:
9
apply Apply a plugin or a plugin group
10
delete Delete a plugin or a plugin group
11
help Help about any command
12
init Initialize K3ai Client
13
list List all plugins or plugin groups
14
version Print CLI version
15
16
Flags:
17
-h, --help help for k3ai-cli
18
--repo string URI for the plugins repository.
19
20
Use "k3ai-cli [command] --help" for more information about a command.
Copied!

Apply

with apply you deploy the various plugins or group-plugins.
1
Apply a plugin or a plugin group
2
3
Usage:
4
k3ai apply <plugin_name> [flags]
5
6
Flags:
7
-g, --group Apply a plugin group
8
-h, --help help for apply
9
10
Global Flags:
11
--repo string URI for the plugins repository.
12
(default "https://api.github.com/repos/kf5i/k3ai-plugins/contents/core/")
Copied!

Init

With init you may deploy a cluster either local or remote
1
Initialize K3ai Client, allowing user to deploy a new K8's cluster,
2
list plugins and groups
3
4
Usage:
5
k3ai init [flags]
6
7
Examples:
8
k3ai init #Will use config from $HOME/.k3ai/config.yaml and use interactive menus
9
k3ai init --config /myfolder/myconfig.yaml #Use a custom config.yaml in another location(local or remote)
10
k3ai init --local k3s #Use config target marked local and of type k3s
11
k3ai init --cloud civo #Use config target marked as cloud and of type civo
12
13
Flags:
14
--cloud string Options availabe for cloud providers
15
--config string Custom config file [default is $HOME/.k3ai/config.yaml] (default "/.k3ai/config.yaml")
16
-h, --help help for init
17
--local string Options availabe k3s,k0s,kind
18
19
Global Flags:
20
--repo string URI for the plugins repository.
21
(default "https://api.github.com/repos/kf5i/k3ai-plugins/contents/core/")
Copied!

List

List is used to retrieve the available plugins or group-plugins
1
List all plugins or plugin groups
2
3
Usage:
4
k3ai list [flags]
5
6
Flags:
7
-g, --group List the plugin groups
8
-h, --help help for list
9
10
Global Flags:
11
--repo string URI for the plugins repository.
12
(default "https://api.github.com/repos/kf5i/k3ai-plugins/contents/core/")
Copied!

Delete

Delete is used to remove a deployed plugin
1
Delete a plugin or a plugin group
2
3
Usage:
4
k3ai delete <plugin_name> [flags]
5
6
Flags:
7
-g, --group Delete a plugin group
8
-h, --help help for delete
9
10
Global Flags:
11
--repo string URI for the plugins repository.
12
(default "https://api.github.com/repos/kf5i/k3ai-plugins/contents/core/")
Copied!
k3ai use a config file to support auomated deployment of cluster through the init command.
The sample template install by defauly KinD
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
config: "/etc/rancher/k3s/k3s.yaml" #default location of config file or your existing config file to copy
7
clusterName: demo-wsl-k3s #name of the cluster (this need to be the same as in a config file)
8
clusterDeployment: local
9
clusterStart: "sudo bash -ic 'k3s server --write-kubeconfig-mode 644 > /dev/null 2>&1 &'"
10
spec:
11
# If the OS is not needed may be removed so the three below are mutually exclusive, if not needed set them to null or remove it
12
wsl: "https://github.com/rancher/k3s/releases/download/v1.19.4%2Bk3s1/k3s"
13
mac:
14
linux: "https://get.k3s.io | K3S_KUBECONFIG_MODE=644 sh -s -"
15
windows:
16
# Everything from this repo will be ran in this cluster. You trust me right?
17
plugins:
18
- repo:
19
name:
20
- repo:
21
name:
22
23
- name: localK0s #name of the cluster instance not the name of the cluster
24
enabled: false
25
type: k0s
26
config: "${HOME}/.k3ai/kubeconfig" #default location of config file or your existing config file to copy
27
clusterName: demo-wsl-k0s #name of the cluster (this need to be the same as in a config file)
28
clusterDeployment: local
29
clusterStart: "k0s default-config | tee ${HOME}/.k3ai/k0s.yaml && sudo bash -ic 'k0s server -c ${HOME}/.k3ai/k0s.yaml --enable-worker > /dev/null 2>&1 &' && sudo cat /var/lib/k0s/pki/admin.conf > $HOME/.k3ai/k0s-config"
30
spec:
31
# If the OS is not needed may be removed so the three below are mutually exclusive, if not needed set them to null or remove it
32
wsl: "https://github.com/k0sproject/k0s/releases/download/v0.8.1/k0s-v0.8.1-amd64"
33
mac:
34
linux: "https://github.com/k0sproject/k0s/releases/download/v0.8.1/k0s-v0.8.1-amd64"
35
windows:
36
# Everything from this repo will be ran in this cluster. You trust me right?
37
plugins:
38
- repo:
39
name:
40
- repo:
41
name:
42
43
- name: localKind #name of the cluster instance not the name of the cluster
44
enabled: true
45
type: kind
46
config: #default location of config file or your existing config file to copy
47
clusterName: demo-win-kind #name of the cluster (this need to be the same as in a config file)
48
clusterDeployment: local
49
clusterStart: "kind create cluster"
50
spec:
51
# If the OS is not needed may be removed so the three below are mutually exclusive, if not needed set them to null or remove it
52
wsl: "https://kind.sigs.k8s.io/dl/v0.9.0/kind-linux-amd64"
53
mac: "https://kind.sigs.k8s.io/dl/v0.9.0/kind-darwin-amd64"
54
linux: "https://kind.sigs.k8s.io/dl/v0.9.0/kind-linux-amd64"
55
windows: "https://kind.sigs.k8s.io/dl/v0.9.0/kind-windows-amd64"
56
# Everything from this repo will be ran in this cluster. You trust me right?
57
plugins:
58
- repo:
59
name: jupyter-minimal
60
- repo:
61
name:
62
63
- name: localK3d #name of the cluster instance not the name of the cluster
64
enabled: false
65
type: k3d
66
config: #default location of config file or your existing config file to copy
67
clusterName: demo-win-k3d #name of the cluster (this need to be the same as in a config file)
68
clusterDeployment: local
69
clusterStart: "k3d cluster create"
70
spec:
71
# If the OS is not needed may be removed so the three below are mutually exclusive, if not needed set them to null or remove it
72
wsl: "https://kind.sigs.k8s.io/dl/v0.9.0/kind-linux-amd64"
73
mac: "https://kind.sigs.k8s.io/dl/v0.9.0/kind-darwin-amd64"
74
linux: "https://kind.sigs.k8s.io/dl/v0.9.0/kind-linux-amd64"
75
windows: "https://github.com/rancher/k3d/releases/download/v3.4.0-test.0/k3d-windows-amd64.exe"
76
# Everything from this repo will be ran in this cluster. You trust me right?
77
plugins:
78
- repo:
79
name: jupyter-minimal
80
- repo:
81
name:
82
83
- name: remoteK3s #name of the cluster instance not the name of the cluster
84
enabled: false
85
type: k3s
86
config: remote #default location of config file or your existing config file to copy if Remote will be copy from remote location
87
clusterName: demo-cluster-remote #name of the cluster (this need to be the same as in a config file)
88
clusterDeployment: cloud
89
clusterStart:
90
spec:
91
# If the OS is not needed may be removed so the three below are mutually exclusive, if not needed set them to null or remove it
92
wsl:
93
mac:
94
linux:
95
windows:
96
cloudType: civo
97
cloudNodes: 1
98
cloudSecretPath: $HOME/.k3ai/secret.txt
99
# Everything from this repo will be ran in this cluster. You trust me right?
100
plugins:
101
- repo: "https://github.com/alfsuse/demo-plugins"
102
name: "demo"
103
- repo: "https://github.com/alfsuse/demo-plugins-2"
104
name: "demo2"
Copied!
Last modified 10mo ago
Export as PDF
Copy link