-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d590e01
commit 3f61baa
Showing
2 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
### Kubernetes Playground | ||
|
||
1. Initializes cluster master node: | ||
|
||
kubeadm init --apiserver-advertise-address $(hostname -i) --pod-network-cidr 10.5.0.0/16 | ||
|
||
2. Initialize cluster networking: | ||
|
||
kubectl apply -f https://raw.githubusercontent.com/cloudnativelabs/kube-router/master/daemonset/kubeadm-kuberouter.yaml | ||
|
||
3. Add another instance | ||
|
||
4. Create join token | ||
|
||
``` | ||
kubeadm token create --print-join-command | ||
``` | ||
|
||
5. Join the node to cluster(replace below with the output from step 4) | ||
|
||
> [!IMPORTANT] | ||
> Every worker node must have kubelet installed and running as a system service. Please install kubelet on the target node before executing the join command. | ||
``` | ||
sudo apt install kubeadm kubelet kubectl | ||
``` | ||
|
||
``` | ||
kubeadm join 192.168.0.8:6443 --token c2ioq4.hy4ysw7ipf8a9svf --discovery-token-ca-cert-hash sha256:d507dc03285b97e1442dff82c07c7c623b4ac3d73379ca0cd954128a67f58423 | ||
``` | ||
|
||
1. List nodes on master | ||
|
||
``` | ||
kubectl get nodes | ||
``` | ||
|
||
7. List pods on specific nodes | ||
|
||
``` | ||
kubectl get pods --field-selector spec.nodeName=node2 | ||
``` | ||
|
||
8. Deploy nginx app | ||
|
||
``` | ||
kubectl apply -f https://raw.githubusercontent.com/kubernetes/website/master/content/en/examples/application/nginx-app.yaml | ||
``` | ||
|
||
> [!NOTE] | ||
> List and verify the pods on both node1(master) and node2(worker) | ||
> Pods should be running on worker nodes only | ||
9. Get system level components | ||
|
||
``` | ||
kubectl get pods -n kube-system | ||
``` | ||
|
||
10. Get the system level components on a specific node | ||
|
||
``` | ||
kubectl get pods -n kube-system --field-selector spec.nodeName=node2 | ||
``` |