Hello-Home

Hello

Let's check if we got everything ready:
    A laptop/device/server with a minimum of 4 GB of RAM (if you got 8 is perfect)
    Passion for AI in general
    30 mins of your time for each section
    Did you already got k3ai-cli installed? If not go to the QuickStart section
    kubectl (don't ask yet just download it from here)
    k9s (you'll thank us later... download it from here)
Okay if we got everything let's start. We will use k3ai-cli to do everything so you don't really have to learn how to do things over than learn k3ai. The diagram below shows you how the various k3ai-cli command will drive you through the Hello* guides
k3ai-cli various command and their use

First Step

The first step is to learn how to install the cluster (unless you don't have one already). K3ai support various configurations:
    Local deployments
    Cloud deployments
We make use of a configuration file to drive the various installation steps so, while the main goal of K3ai is not to deploy Kubernetes clusters we aim to make the life of our users as simple as possible.
Note: are you an expert in automation and cluster deployment (K8s)? Help us and add some nice tooling to K3ai.
K3ai currently support the following local clusters:
On the cloud side we do offer support for:
This guide will use the local installation.

Home

Open a terminal window and simply type the following:
1
k3ai init
Copied!
What will happen is the following:
    1.
    If it does not exist a folder named .k3ai will be created under your home directory (i.e.: in Linux under /home/yourusername/) inside this directory we will download a sample config.yaml file.
    2.
    The config.yaml has a default installation cluster: KinD that requires docker to be installed.
      1.
      If you don't have docker installed at this point you have to follow this guide here
      2.
      If you don't want to use Kind just go to step 3
    3.
    If you got docker installed we will deploy Kind automatically and you're ready to move to Hello-Earth. If you don't want kind and/or don't want to install docker keep reading.

Home Rebuild

An alternative way to install a cluster and be able to choose the favorite flavor is to use a slightly different command
1
k3ai init --local <YourClusterFlavor>
Copied!
Let's go into more details here's the full list of options:
    k3ai init --local k3s
    k3ai init --local k0s
    k3ai init --local kind
    k3ai init --local k3d
In case of Cloud:
    k3ai init --cloud civo
Now to sum it up here's a video that shows how it works.
Home Rebuild - Foundation
As we mentioned at the beginning of this guide k3ai support a config file as well. The config file looks like the one below and is located at <home user folder>/.k3ai/config.yaml but k3ai support also a custom location through k3ai init --config <yourpath to config file>
1
# The first two (2) lines are used to indicate what the section does.
2
# We use them to group stuff, if you need multi-cluster just copy,paste and
3
# rewrite everything after the first 2 lines
4
5
kind: cluster
6
targetCustomizations:
7
# This is what you change typically: name is k3ai internal instance name,
8
# enabled is to tell k3ai if you want to install it or not
9
# type means what need to be installed
10
# config if the cluster flavor has it's own config file (kubeconfig)
11
- name: localK3s
12
enabled: false # Set it to True to enable the section
13
type: k3s
14
config: "/etc/rancher/k3s/k3s.yaml"
15
clusterName: demo-wsl-k3s # This is the name of your cluster
16
clusterDeployment: local
17
# clusterStart is helpful when you install on things like WSL that do not have
18
# services etc..
19
clusterStart: "sudo bash -ic 'k3s server --write-kubeconfig-mode 644 ...'"
20
spec:
21
# If the OS is not needed may be removed so the three below
22
# are mutually exclusive, if not needed set them to null or remove it
23
wsl: "https://github.com/rancher/k3s/releases/download/v1.19.4%2Bk3s1/k3s"
24
mac:
25
linux: "https://get.k3s.io | K3S_KUBECONFIG_MODE=644 sh -s -"
26
windows:
27
# If you want to add automatically some plugins you may use the group below
28
plugins:
29
- repo: #where is your plugin located?
30
name: #how it is called?
31
- repo:
32
name:
Copied!
For cloud there a couple of extra configs like the one below
1
- name: remoteK3s
2
enabled: false
3
type: k3s
4
config: remote #currently we do not copy and merge the kubeconfig
5
clusterName: demo-cluster-remote
6
clusterDeployment: cloud #change from local to cloud
7
clusterStart:
8
spec:
9
wsl:
10
mac:
11
linux:
12
windows:
13
# Cloud section
14
cloudType: civo
15
cloudNodes: 1
16
cloudSecretPath: $HOME/.k3ai/secret.txt
17
# ---end----
18
plugins:
19
- repo:
20
name:
21
- repo:
22
name:
Copied!
Done your Hello Home is ready! You may proceed to the Hello-Earth section
Last modified 10mo ago
Export as PDF
Copy link