Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dougsland/kind-tutorial
Kind Presentation
https://github.com/dougsland/kind-tutorial
Last synced: 10 days ago
JSON representation
Kind Presentation
- Host: GitHub
- URL: https://github.com/dougsland/kind-tutorial
- Owner: dougsland
- License: gpl-2.0
- Created: 2021-11-17T20:51:37.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-12-03T17:36:03.000Z (about 3 years ago)
- Last Synced: 2024-12-19T13:29:14.522Z (22 days ago)
- Size: 16.6 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
- [kind-tutorial](#kind-tutorial)
* [1. KinD Download](#1-kind-download)
* [2. KinD Initial Configuration](#2-kind-initial-configuration)
* [3. KinD Installation](#3-kind-installation)
* [4. Setting Container Network Interface](#4-setting-container-network-interface)
* [5. Rootless](#5-rootless)
+ [Podman](#podman)
+ [Docker](#docker)
* [5. Tools](#5-tools)
+ [5.1 kubectl](#51-kubectl)
+ [5.2 Krew](#52-krew)
+ [5.2 Creating your own plugin](#52-creating-your-own-plugin)
+ [5.3 k8s-local-dev](#53-k8s-local-dev)# kind-tutorial
Kind Presentation## 1. KinD Download
Linux:
```
$ curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.11.1/kind-linux-amd64
$ chmod +x ./kind
$ mv ./kind /some-dir-in-your-PATH/kind
```Windows:
```
$ choco install kind
```Mac:
```
$ brew install kind
```## 2. KinD Initial Configuration
Setting initial config via YAML
`$ cat kindConfig.yaml`
```
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: control-plane
- role: worker
- role: worker
- role: worker
```## 3. KinD Installation
```
$ kind create cluster --config kindConfig.yaml
Creating cluster "kind" ...
â Ensuring node image (kindest/node:v1.21.1) đŧ
â Preparing nodes đĻ
â Writing configuration đ
â Starting control-plane đšī¸
â Installing CNI đ
â Installing StorageClass đž
Set kubectl context to "kind-kind"
You can now use your cluster with:$ kubectl cluster-info --context kind-kind
Thanks for using kind! đ
```## 4. Setting Container Network Interface
First, disable the default CNI created by KinD
Deploy KinD
Setup your favourite CNI`$ cat kindConfig.yaml`
```
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: control-plane
- role: worker
- role: worker
networking:
disableDefaultCNI: true
```Adding Calico CNI
```
$ kubectl apply -f https://docs.projectcalico.org/v3.21/manifests/calico.yaml
```## 5. Rootless
### Podman
Requires:Podman v3.0 or later
Add the following into `/etc/default/grub` and update grub
```
GRUB_CMDLINE_LINUX="systemd.unified_cgroup_hierarchy="
````Updating grub
```
$ grub2-mkconfig -o "$(readlink -e /etc/grub2.conf)"
```Reboot the host
```
$ sudo reboot
```Set delegate.conf into `/etc/systemd/system/[email protected]/`
```
$ mkdir /etc/systemd/system/[email protected]/
$ vi delegate.conf
[Service]
Delegate=yes$ sudo systemctl daemon-reload
```Set `/etc/modules-load.d/iptables.conf`
```
$ mkdir -p /etc/systemd/system/[email protected]/
$ vi delegate.conf
ip6_tables
ip6table_nat
ip_tables
iptable_nat
```Running:
```
$ KIND_EXPERIMENTAL_PROVIDER=podman kind create cluster
using podman due to KIND_EXPERIMENTAL_PROVIDER
enabling experimental podman provider
Cgroup controller detection is not implemented for Podman. If you see cgroup-related errors, you might need to set systemd property "Delegate=yes", see https://kind.sigs.k8s.io/docs/user/rootless/
Creating cluster "kind" ...
â Ensuring node image (kindest/node:v1.21.1) đŧ
â Preparing nodes đĻ
â Writing configuration đ
â Starting control-plane đšī¸
â Installing CNI đ
â Installing StorageClass đž
Set kubectl context to "kind-kind"
You can now use your cluster with:kubectl cluster-info --context kind-kind
Thanks for using kind! đ
```TIP: Making an alias helps your life :)
```
$ alias kind="KIND_EXPERIMENTAL_PROVIDER=podman kind" >> ~/.bashrc
$ source ~/.bashrc
```### Docker
Requires: Docker: 20.10 or later, [for more info click here](https://kind.sigs.k8s.io/docs/user/rootless)## 5. Tools
### 5.1 kubectl
- Tools to manage the Kubernetes cluster
- Not installed by kindDownload and install:
```
$ curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
$ echo "$(