Digital Ocean - Kubernetes Cluster
Tags: k8s, digitalocean, practise
Published: 2023-02-28 14:26:45

**Step by step approach to create kubernetes clusters in Digital Ocean **

**Step 1** : Using Digital Ocean Cloud
Use the Referral code to register in Digital Ocean - **https://m.do.co/c/d71c3ad04039** and you will get 200 dollar credits for creating clusters and practice, this credits are valid for 2 months and it will be sufficient to learn kubernetes with practice. 

If you have credits you can use the choice of your cloud provider.

**Step 2** :  Login to Digital Ocean and Go to projects in the left top corner and then click on New Project

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fdootjzpww7orgq1qsi4.png)

- Enter the mandatory fields and then click on create project

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/f1rryc213j1y7x7dnnhd.png)

**Step 3** : Creating Cluster

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x2hw90qsilvf5otto3kh.png)

**Step 3.1** :  

- Choose the Region - Selected London for demo

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/svi687pxcmsmnq4m6xcf.png)

**Step 3.2** : Left the default values for VPC and version

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mus83qn0ap4bvhg6792s.png)

**Step 3.3** : Select the scaling type as Fixed Size

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9hhh2ocpkuf7ioqkcv52.png)

**Step 3.4** :  Enter new node details

- Node pool name : srini-node-1-k8s
- Node plan : $12/month
- Machine Type :Basic nodes (its cheaper one, select other based on your needs)
- Nodes : 1 ( By default it comes with 3 , change to 1 for practice, if you want can have more nodes)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hzizmwrbi3eium1ct6gd.png)
**Step 3.5**: Finalize and create the cluster

- Name of the cluster
- Project
- Tags

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zk4fs9hofq8lui8is7ix.png)

It will take couple of minutes to create cluster 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ud01tib8cu5d2ijeairv.png)

**Step 4** :  Configuration of Kubernetes cluster in Windows System

**Step 4.1** : Download config file 


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5n9udcs02b9oax6wdmg5.png)

**Step 4.2** : Copy the config file in the same folder where kubectl.exe exists

- kubectl --kubeconfig "srini-k8s-kubeconfig.yaml" get nodes
- srini-k8s-kubeconfig.yaml -> Is the config file name downloaded from digital ocean cluster
- Every time we need to mention the config file to get nodes
- To avoid this ,we need to copy the config file under the .kube folder and more details mentioned in step 4.3
 

**Step 4.3**: Go to C:\Users\ Select the user based on your login

Check if any folder with .kube folder exists , if not create one

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3lmul4e4orjx89jgt0zg.png)


**Step 4.4** : Copy the config file downloaded to the folder .kube

**Step 4.5**:** Change the file name to **config** and remove the yaml extension type and finally it should be file type.


**step 4.6:** With out mentioning config file and will get the list of nodes using the below command.

kubectl get nodes

**Wrapup** 
Step by step approach of creation of kubernetes cluster using Digital Ocean and please let me know the comments for this article.

LinkedIn : https://www.linkedin.com/in/srinivasuluparanduru/