diff --git a/docs/content/getting-started.md b/docs/content/getting-started/getting-started.md similarity index 100% rename from docs/content/getting-started.md rename to docs/content/getting-started/getting-started.md diff --git a/docs/content/getting-started/kind.md b/docs/content/getting-started/kind.md new file mode 100644 index 00000000..ad4ca9ec --- /dev/null +++ b/docs/content/getting-started/kind.md @@ -0,0 +1,143 @@ +# Kamaji: Getting started on Kind +This guide will lead you through the process of creating a setup of a working Kamaji setup using Kind clusters. + +The guide requires the following installed: + +- Docker +- Kind +- Helm + +## Summary + + * [Creating Kind Cluster](#creating-kind-cluster) + * [Installing Dependencies: Cert-Manager](#installing-dependencies-cert-manager) + * [Installing MetalLb](#installing-metallb) + * [Creating IP Address Pool](#creating-ip-address-pool) + * [Installing Kamaji](#installing-kamaji) + + +## Creating Kind Cluster + +Create a kind cluster. +``` +kind create cluster --name kamaji +``` + +This will take a short while for the kind cluster to created. + +## Installing Dependencies: Cert-Manager + +Kamaji has a dependency on Cert Manager, as it uses dynamic admission control, validating and mutating webhook configurations which are secured by a TLS communication, these certificates are managed by `cert-manager`. Hence, it needs to be added. + +Add the Bitnami Repo to the Helm Manager. +``` +helm repo add bitnami https://charts.bitnami.com/bitnami +``` + +Install Cert Manager to the cluster using the bitnami charts using Helm -- +``` +helm upgrade --install cert-manager bitnami/cert-manager --namespace certmanager-system --create-namespace --set "installCRDs=true" +``` + +This will install cert-manager to the cluster. You can watch the progress of the installation on the cluster using the command - +``` +kubectl get pods -Aw +``` + +!!! Info "" + Another pre-requisite is to have a __storage provider__. + + Kind by default provides `local-path-provisioner`, but one can have any other CSI Drivers. Since there are ETCD and Control-Planes running, having persistent volumes is essential for the cluster. + +## Installing MetalLb + +MetalLB is used in order to dynamically assign IP addresses to the components, and also define custom IP Address Pools. + +Install MetalLb using the `kubectl` manifest apply command -- +``` +kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.13.7/config/manifests/metallb-native.yaml +``` + +This will install MetalLb onto the cluster with all the necessary resources. + +## Creating IP Address Pool + +Extract the Gateway IP of the network Kind is running on. +``` +GW_IP=$(docker network inspect -f '{{range .IPAM.Config}}{{.Gateway}}{{end}}' kind) +``` + +Modify the IP Address, and create the resource to be added to the cluster to create the IP Address Pool. +``` +NET_IP=$(echo ${GW_IP} | sed -E 's|^([0-9]+\.[0-9]+)\..*$|\1|g') +cat << EOF | sed -E "s|172.19|${NET_IP}|g" | kubectl apply -f - +apiVersion: metallb.io/v1beta1 +kind: IPAddressPool +metadata: + name: kind-ip-pool + namespace: metallb-system +spec: + addresses: + - 172.19.255.200-172.19.255.250 +--- +apiVersion: metallb.io/v1beta1 +kind: L2Advertisement +metadata: + name: emtpy + namespace: metallb-system +EOF +``` + +## Installing Kamaji + +- Add the Clastix Repo in the Helm Repo lists. +``` +helm repo add clastix https://clastix.github.io/charts +helm repo update +``` + +- Install Kamaji +``` +helm upgrade --install kamaji clastix/kamaji --namespace kamaji-system --create-namespace --set 'resources=null' +``` + +- Watch the progress of the deployments -- +``` +kubectl get pods -Aw +``` + +- Verify by first checking Kamaji CRDs. +``` +kubectl get crds | grep -i kamaji +``` + +- Install a Tenant Control Plane using the command -- + +``` +kubectl apply -f https://raw.githubusercontent.com/clastix/kamaji/master/config/samples/kamaji_v1alpha1_tenantcontrolplane.yaml +``` + +- Watch the progress of the Tenant Control Plane by --- +``` +kubectl get tcp -w +``` + +- You can attempt to get the details of the control plane by downloading the kubeconfig file --- +``` +# Set the SECRET as KUBECONFIG column listed in the tcp output. +SECRET="" +kubectl get secret $SECRET -o jsonpath='{.data.admin\.conf}'|base64 -d > /tmp/kamaji.conf +``` + +- Export the KUBECONFIG +``` +export KUBECONFIG=/tmp/kamaji.conf +``` + +- Notice that the `kubectl` version changes, and there is no nodes now. +``` +kubectl version +kubectl get nodes +``` + +A Video Tutorial of the [demonstration](https://www.youtube.com/watch?v=hDTvnOyUmo4&t=577s) can also be viewed. \ No newline at end of file diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index 30d20220..17d712b3 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -55,7 +55,9 @@ markdown_extensions: # Generate navigation bar nav: - 'Kamaji': index.md -- 'Getting started': getting-started.md +- 'Getting started': + - getting-started/getting-started.md + - getting-started/kind.md - 'Concepts': concepts.md - 'Guides': - guides/index.md