-
Notifications
You must be signed in to change notification settings - Fork 3.5k
KIND Cluster installation md file #37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
503b9c3
71e90cf
94b8d01
db3687d
3f12e9d
53382b5
1eacb9b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,179 @@ | ||||||||||||||
|
|
||||||||||||||
| # **Installing KIND Cluster on Ubuntu Using Release Binaries** | ||||||||||||||
|
|
||||||||||||||
| This guide provides step-by-step instructions for installing **KIND (Kubernetes IN Docker)** on an Ubuntu machine using release binaries. KIND allows you to run a single-node or multi-node Kubernetes cluster locally for development and testing. | ||||||||||||||
|
|
||||||||||||||
| --- | ||||||||||||||
|
|
||||||||||||||
| ## Prerequisites | ||||||||||||||
| Before installing KIND Cluster, ensure you have the following: | ||||||||||||||
|
|
||||||||||||||
| * Ubuntu OS | ||||||||||||||
| * sudo privileges | ||||||||||||||
| * Internet access | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| --- | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| ## Step 1: Update System Packages | ||||||||||||||
|
|
||||||||||||||
| Update your package lists to make sure you are getting the latest version and dependencies | ||||||||||||||
|
|
||||||||||||||
| ```bash | ||||||||||||||
| sudo apt update | ||||||||||||||
| ``` | ||||||||||||||
|  | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| ### Step 2: Install Required Packages | ||||||||||||||
|
|
||||||||||||||
| Install some basic required packages | ||||||||||||||
|
|
||||||||||||||
| ```bash | ||||||||||||||
| sudo apt install -y curl wget apt-transport-https | ||||||||||||||
| ``` | ||||||||||||||
|  | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| --- | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| ### Step 3: Install Docker | ||||||||||||||
|
|
||||||||||||||
| KIND requires Docker to create and manage the Kubernetes clusters. | ||||||||||||||
|
|
||||||||||||||
| ```bash | ||||||||||||||
| sudo apt install -y docker.io | ||||||||||||||
| ``` | ||||||||||||||
|  | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| Start and enable Docker | ||||||||||||||
|
|
||||||||||||||
| ```bash | ||||||||||||||
| sudo systemctl enable --now docker | ||||||||||||||
| sudo systemctl status docker | ||||||||||||||
| ``` | ||||||||||||||
|  | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| Add current user (i.e UBUNTU) to docker group (To use docker without root) | ||||||||||||||
|
|
||||||||||||||
| ```bash | ||||||||||||||
| sudo usermod -aG docker $USER && newgrp docker | ||||||||||||||
| ``` | ||||||||||||||
|
Comment on lines
+62
to
+66
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add security warning for Docker group modification. Adding users to the Docker group effectively grants root privileges. This should be clearly documented with security implications. -Add current user (i.e UBUNTU) to docker group (To use docker without root)
+# Security Note: Adding a user to the Docker group grants privileges equivalent to root access.
+# Only add trusted users to the Docker group in development environments.
+# For production environments, consider using rootless Docker or alternative security measures.
```bash
sudo usermod -aG docker $USER && newgrp docker🧰 Tools🪛 LanguageTool[uncategorized] ~62-~62: The abbreviation “i.e.” (= that is) requires two periods. (I_E) [uncategorized] ~62-~62: You might be missing the article “the” here. (AI_EN_LECTOR_MISSING_DETERMINER_THE) |
||||||||||||||
|  | ||||||||||||||
|
|
||||||||||||||
| Now, logout (use exit command) and connect again. | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| --- | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| ### Step 4: Install and Create a **KIND** Cluster | ||||||||||||||
|
|
||||||||||||||
| 1. Download the Latest KIND Binary: | ||||||||||||||
|
|
||||||||||||||
| ```bash | ||||||||||||||
| [ $(uname -m) = x86_64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.25.0/kind-linux-amd64 | ||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| 2. Make the Binary Executable: | ||||||||||||||
|
|
||||||||||||||
| Change the downloaded binary's permissions to make it executable: | ||||||||||||||
|
|
||||||||||||||
| ```bash | ||||||||||||||
| chmod +x ./kind | ||||||||||||||
| ``` | ||||||||||||||
|
|
||||||||||||||
| 3. Move the Binary to a Directory in Your PATH: | ||||||||||||||
|
|
||||||||||||||
| Move the Kind binary to `/usr/local/bin` to make it globally accessible. | ||||||||||||||
|
|
||||||||||||||
| ```bash | ||||||||||||||
| sudo mv ./kind /usr/local/bin/kind | ||||||||||||||
| ``` | ||||||||||||||
|  | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| 4. Verify Installation: | ||||||||||||||
|
|
||||||||||||||
| Check that the installation was successful by verifying the `KIND` version: | ||||||||||||||
|
|
||||||||||||||
| ```bash | ||||||||||||||
| kind --version | ||||||||||||||
| ``` | ||||||||||||||
|  | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| 5. Create a KIND Cluster and verify status | ||||||||||||||
|
|
||||||||||||||
| ```bash | ||||||||||||||
| kind create cluster --name my-cluster | ||||||||||||||
| kubectl cluster-info --context kind-mycluster | ||||||||||||||
| kind get clusters | ||||||||||||||
|
Comment on lines
+115
to
+117
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix inconsistent cluster name in commands. The cluster name is inconsistent between creation and verification commands:
kind create cluster --name my-cluster
-kubectl cluster-info --context kind-mycluster
+kubectl cluster-info --context kind-my-cluster
kind get clusters📝 Committable suggestion
Suggested change
|
||||||||||||||
| ``` | ||||||||||||||
|  | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| --- | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| ## Step 5: Download and Install Kubectl | ||||||||||||||
|
|
||||||||||||||
| Once the cluster is created, you can interact with it using `kubectl`. | ||||||||||||||
|
|
||||||||||||||
| 1. Download the Kubectl binary and verify the downloaded binary is correct | ||||||||||||||
|
|
||||||||||||||
| ```bash | ||||||||||||||
| curl -LO https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl | ||||||||||||||
| curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl.sha256" | ||||||||||||||
| echo "$(cat kubectl.sha256) kubectl" | sha256sum –check | ||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fix SHA256 checksum verification command. The command uses an incorrect dash character which will cause the verification to fail. -echo "$(cat kubectl.sha256) kubectl" | sha256sum –check
+echo "$(cat kubectl.sha256) kubectl" | sha256sum --check📝 Committable suggestion
Suggested change
|
||||||||||||||
| ``` | ||||||||||||||
|  | ||||||||||||||
|
|
||||||||||||||
| 2. Install the Kubelet | ||||||||||||||
|
|
||||||||||||||
| ```bash | ||||||||||||||
| sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl | ||||||||||||||
| kubectl version --client | ||||||||||||||
| kubectl version --client --output=yaml | ||||||||||||||
| ``` | ||||||||||||||
|  | ||||||||||||||
|
|
||||||||||||||
| 3. Verify the Install | ||||||||||||||
|
|
||||||||||||||
| ```bash | ||||||||||||||
| kubectl version | ||||||||||||||
| ``` | ||||||||||||||
|  | ||||||||||||||
|
|
||||||||||||||
| 4. Check Nodes status in KIND Cluster which is created (Here we have created only 1 node cluster) | ||||||||||||||
|
|
||||||||||||||
| ```bash | ||||||||||||||
| kubectl get nodes | ||||||||||||||
| ``` | ||||||||||||||
|  | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| --- | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| ## Step 6: Optional: Delete KIND Cluster | ||||||||||||||
|
|
||||||||||||||
| If you wish to delete the cluster after you're done: | ||||||||||||||
|
|
||||||||||||||
| ```bash | ||||||||||||||
| kind delete cluster --name my-cluster | ||||||||||||||
| ``` | ||||||||||||||
|  | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| --- | ||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
|
|
||||||||||||||
| You have successfully installed Kind and created a Kubernetes cluster using the release binaries. You can now use Kind to test and develop Kubernetes workloads in an isolated environment on your local machine. | ||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add Docker version verification step.
After Docker installation, it's important to verify the installed version.
sudo apt install -y docker.io +docker --version📝 Committable suggestion