Setup Hasura /Local Development

Hasura Installation
  
Here are the steps to setup Hasua Local development on Ubuntu 16.04 on 64-bit machine

Step I - Installation of virtualbox
Use link https://www.virtualbox.org/wiki/Downloads to download virtualbox-5.1_5.1.22-115126~Ubuntu~yakkety_amd64.deb 
Double click the downloaded .deb file for installer to start.

Step 2 - Installation of hasuractl

$curl -Lo hasuractl https://storage.googleapis.com/hasuractl/v0.1.1/linux-amd64/hasuractl && chmod +x hasuractl && sudo mv hasuractl /usr/local/bin/

Step 3- Installation of latest kubectl (>= 1.6.0)
Refer web site https://kubernetes.io/docs/tasks/tools/install-kubectl/ for installation and set-up of kubeclt
Following steps are followed to install kubectl..

$curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
$chmod +x ./kubectl
$sudo mv ./kubectl /usr/local/bin/kubectl
$kubectl cluster-info
Error: The connection to the server <server-name:port> was refused - did you specify the right host or port?

The above error was resolved by following Step 4.

Step 4- Configuration of Kubeclt

Refer site https://kubernetes.io/docs/getting-started-guides/minikube/ for running Kubernetes Locally via Minikube
(Minikube- Minikube is a tool that makes it easy to run Kubernetes locally. Minikube runs a single-node Kubernetes cluster inside a VM on your laptop for users looking to try out Kubernetes or develop with it day-to-day.)
Installed minicube v0.19.1 using command 

$curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.19.1/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/



$ minikube stop
Stopping local Kubernetes cluster...
Machine stopped.

If i fire command $kubectl cluster-info i got following error message
Unable to connect to the server: dial tcp 192.168.99.100:8443: getsockopt: no route to host

The issue was due to minikube was not running.In last step I have stopped minikube.
The issue was resolved by starting minikube
$minikube start
$kubectl cluster-info
Kubernetes master is running at https://192.168.99.100:8443

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.

Step 5- Enabling shell auto-completion

$source <(kubectl completion bash)
$echo "source <(kubectl completion bash)" >> ~/.bashrc

Starting Hasura

1.Create an account on beta.hasura.io if you do not have one.

2.Run $hasuractl login



3.Run $hasura local start command


Checking status Kubernetes cluster


Stopping Hasura

Cleaning Hasura


This is how Hasura local development has been setup on local machine..


What is Virtualbox?

VirtualBox is a free, open source, cross-platform application for creating, managing and running virtual machines (VMs) – computers whose hardware components are emulated by the host computer, the computer that runs the program.

Virtualization reduces the number of physical servers, reducing the energy required to power and cool them. Save time. ... It's also much faster to deploy a virtual machine than it is to deploy a new physical server. Reduce desktop management headaches


Purpose of Virtual box


1) Hardware Consolidation- Instead of running many physical server with few load and wastage of electricity, we can use one physical server which runs many application, thus saving cost and electricity.
2)Easier backup and disaster recovery
3) Improve availability and business continuity
4) Increase efficiency for development and test environment

For our application virtualbox is used for running single node kubernetes cluster in VM

Comments

Popular posts from this blog

Three Screen App Idea

Week 8 - Final App

Setup dev environment