KubeSail: Get your free Kubernetes Cluster
If you’re looking for free Kubernetes Cluster to play around then KubeSail is right choice,its hosted Kubernetes provider and offers free managed namespace.With KubeSail you can deploy and host applications easily. In this post,we take look at how to deploy applications on to KubeSail cluster.
Once you have created your account on KubeSail,follow the below steps to deploy your applications.
Step #1 : Get Kubectl configuration
From the account setup tab,get the
kubectl configuration.To recap on what is
kubectl,this is command line interface through which we can interact with Kubernetes API.
Copy the contents of kubectl configuration and paste to your
~/.kube/config so that we can use
kubectl to access our cluster.
Step #2 : Create deployment
Before creating deployment run
kubectl get deployment to check if there are any deployments.
Now that we have cluster ready,we can use
kubectl create command to create new deployment. I already have
deployment.yaml ready with the simple web app – nginx as container image.
apiVersion: extensions/v1beta1 kind: Deployment metadata: name: webapp1 spec: replicas: 1 template: metadata: labels: app: webapp1 spec: containers: - name: webapp1 image: nginxinc/nginx-unprivileged ports: - containerPort: 8080
kubectl get deployment to check if deployment has succeeded.
Congrats! We have just deployed first application on KubeSail by creating a deployment. Following is what the command has done for us:
- Searched for a suitable node where an instance of the application could be run (we have only 1 available node)
- Scheduled the webapp1(ngnix) application to run on that Node
- Configured the cluster to reschedule the instance on a new Node when needed
You can also run
kubectl describe deployment to get more details of the deployment.
Once the application instances are created, a Kubernetes Deployment Controller continuously monitors those instances. If the Node hosting an instance goes down or deleted, the Deployment controller replaces it.
Some of the useful
kubectl commands are below.
- kubectl get– list resources
- kubectl describe– show detailed information about a resource
- kubectl logs– print the logs from a container in a pod
- kubectl exec– execute a command on a container in a pod
From the KubeSail console too, you can view the deployments and its status.
Step #3 : Expose ngnix app outside of the cluster
To expose the app on to the outside world, either we can create new service or from KubeSail Deployment page.For now,we are going to expose it from KubeSail Deployment page,click on ‘Ports’ to proceed.
Choose one of the option to get app exposed.
Congrats! We have just exposed our nginx application to outer world.
You can upgrade or downgrade your KubeSail cluster any time from your dashboard.Please check out Pricing page for more details.
Like this post? Don’t forget to share it!