Install KUBERNETES (EKS-D)
OS: UBUNTU
Install Kubectl
sudo snap install kubectl --classic
Install Amazon EKS Distro (EKS-D)
sudo snap install eks --classic --edge
eks (1.18/edge) v1.18.9 from Canonicalâś“ installed
Check the status
eks status --wait-ready
eks is running
high-availability: no
datastore master nodes: 127.0.0.1:19001
datastore standby nodes: none
Give execution permission to the current user
sudo usermod -a -G eks $USER
sudo chown -f -R $USER ~/.kube
Export the current EKS-D configuration information for use with Kubectl
mkdir -p $HOME/.kube
sudo eks config > .kube/config
Inspect the installation
eks inspect | grep running
Service snap.eks.daemon-cluster-agent is running
Service snap.eks.daemon-containerd is running
Service snap.eks.daemon-apiserver is running
Service snap.eks.daemon-apiserver-kicker is running
Service snap.eks.daemon-control-plane-kicker is running
Service snap.eks.daemon-proxy is running
Service snap.eks.daemon-kubelet is running
Service snap.eks.daemon-scheduler is running
Service snap.eks.daemon-controller-manager is running
Check the version of Containerd
eks ctr --version
ctr github.com/containerd/containerd v1.3.7
Server / Client version
eks ctr version
Client:
Version: v1.3.7
Revision: 8fba4e9a7d01810a393d5d25a3621dc101981175
Server:
Version: v1.3.7
Revision: 8fba4e9a7d01810a393d5d25a3621dc101981175
UUID: 339017b3-570e-43bd-a528-4a08123868ca
Access Kubernetes
EKS-D comes with its own version of Kubectl to access Kubernetes. Below we will cover 2 different forms of access to view the "nodes" and "services":
Conventional
eks kubectl get nodes
NAME STATUS ROLES AGE VERSION
myuser Ready <none> 33m v1.18.9-eks-1-18-1
eks kubectl get services
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.152.183.1 <none> 443/TCP 33m
Recommended
kubectl get nodes
NAME STATUS ROLES AGE VERSION
myuser Ready <none> 33m v1.18.9-eks-1-18-1
kubectl get services
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
kubernetes ClusterIP 10.152.183.1 <none> 443/TCP 33m
Note: As shown, the 2 forms have the same result, but from this point on we will only use the "Recommended" with Kubectl.
Deploy a test application
kubectl create deployment nginx --image=nginx
deployment.apps/nginx created
kubectl get pods
NAME READY STATUS RESTARTS AGE
nginx-f89759699-2w75l 1/1 Running 0 33s
Starting and stopping EKS-D
EKS-D will continue to run until you decide to stop it. You can stop and start with the commands below:
sudo eks stop
Stopped.
sudo eks start
Started.
Basic information of your Kubernetes cluster
Server/Client version
kubectl version --short=true
Client Version: v1.19.4
Server Version: v1.18.9-1+c787d4d0c397b8
Cluster information
kubectl cluster-info
Kubernetes master is running at https://192.168.254.100:16443
CoreDNS is running at https://192.168.254.100:16443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
Metrics-server is running at https://192.168.254.100:16443/api/v1/namespaces/kube-system/services/https:metrics-server:/proxy
Configuration information
kubectl config view
apiVersion: v1
clusters:
- cluster:
certificate-authority-data: DATA+OMITTED
server: https://192.168.254.100:16443
name: microk8s-cluster
contexts:
- context:
cluster: microk8s-cluster
user: admin
name: microk8s
current-context: microk8s
kind: Config
preferences: {}
users:
- name: admin
user:
token: REDACTED
Note: To view the access token, use the "--flatten=true" option.
View the nodes
kubectl get nodes -w
NAME STATUS ROLES AGE VERSION
myuser Ready <none> 33h v1.18.9-eks-1-18-1
Information about a particular node
kubectl describe node myuser
Top comments (0)