Once the Kubernetes cluster is created, what next?

How to deploy applications on the cluster and test that?
Make sure minikube is installed on system
minikube version
Start the minikube
ensure
hyperkitis installedminikube start --memory=4098 --driver=hyperkit
To communicate with Kubernetes cluster(Minikube) - we would need
kubectl- check if kubectl is installed
kubectl version
- check if kubectl is installed
Once the minikube is started, know the information about the cluster
kubectl cluster-infokubectl config view
In the cluster, we will have one or many nodes, to know about that.
kubectl get nodesGet the STATUS of node as
ReadyorNotReady
What is inside the nodes - Deployment & pods, Check that
kubectl get deploymentkubectl get podsIf it says nothing found on DEFAULT namespace, that means we need to create them
Get the resource on other namespaces
kubectl get deployment --all-namespaceskubectl get pods -A===kubectl get pods --all-namespacesThis would provide some system resource deployments on different namespaces
To communicate with the nodes or pods, we would need to have
servicesCheck the services
kubectl get services0rkubectl get svc- Note: There may be one default
kubernetesservice
- Note: There may be one default
Now, write the Kubernetes manifest files
There are two ways we can create the deployment
Automatically using
kubectl createcommanduse
kubectl createcommand to create that automaticallyI suggest to create that using
createcommand first to get some confidence of application deployment.Once get practice, we can write that manually
kubectl create deployment express-deployment --image=daspratha/express:v1
OR
Manually - create a file Deployment.yaml & write all the configurations manually - We will check that on next article
Service
To expose the pods to node network. [we cant test load balancer using minikube on local system, for that we have to use cloud server]
Create the service using
kubectl exposecommandKnow the deployment name -
kubectl get deploymentexpose the deployment with
nodePorttypekubectl expose deployment express-deployment --type=NodePort --port=3000check the service -
kubectl get svcNote : We dont need the source code & Dockerfile on the folder from where we are running all the
kubectlcommands.Once the service is deployed, check its URL to access the pod
Know the service name -
kubectl get svcminikube service express-deployment --url#http://192.168.64.2:31683
Now, go to browser and you will see the application from this URL http://192.168.64.2:31683
Once the deployment & service are created, to delete them
Deployment -
kubectl delete deployment express-deploymentService -
kubectl delete services express-deployment
If these articles are giving any value, please give a shoutout.



