Hacker Rank 30 Days Challenge in Golang

Day 0: Hello, World. Task To complete this challenge, you must save a line of input from stdin to a variable, print Hello, World. on a single line, and finally print the value of your variable on a second line. package main import ( "fmt" "bufio" "os" ) func main() { reader := bufio.NewReader(os.Stdin) inputString, _ := reader.ReadString('\n') fmt.Println("Hello, World.") fmt.Println(inputString) } Day 1: Data Type Task Declare 3 variables: one of type int, one of type double, and one of type String. [Read More]

Sorting Structs in Golang

We can not directly use the sorting library Sort for sorting structs in Golang. In order to sort a struct the underlying struct should implement a special interface called sort.Interface This interface requires three methods Len, Swap and Less Let’s try to understand this using an example. Define a struct type EnvVar struct { Name string value string } Here we have a struct struct named EnvVar with two fields Name and value [Read More]

Setting up Multinode OpenShift Cluster

OpenShift is Red Hat’s PaaS (Platform-as-a-Service) that allow developers to quickly develop, host, and scale applications in cloud. Based on top of Docker containers and the Kubernetes container cluster manager, OpenShift adds developer and operational centric tools to enable rapid application development, easy deployment and scaling, and long-term lifecycle maintenance for small and large teams and applications. In this blog, we will be setting up a Multinode OpenShift Cluster (Single Master with two nodes) and will deploy a sample application on it. [Read More]

Installing Minikube

Kubernetes is a container orchestration tool developed by Google, written completely in Golang. It provides a platform for deployment, scaling and automating your application in a containerized environment. Kubernetes helps you scale up your application with ease and make deployment quick. Containerize an application by creating Docker config files and build processes to produce all the necessary Docker images Configure and launch an auto-scaling, self-healing Kubernetes cluster. It is sometimes very difficult to set up a Kubernetes cluster bit thanks to minikube we can set it it up within few commands so that you can run a single node Kunbernetes cluster locally. [Read More]

Getting started with OpenShift

OpenShift is Red Hat’s PaaS (Platform-as-a-Service) that allow developers to quickly develop, host, and scale applications in cloud. Based on top of Docker containers and the Kubernetes container cluster manager, OpenShift adds developer and operational centric tools to enable rapid application development, easy deployment and scaling, and long-term lifecycle maintenance for small and large teams and applications. There are a couple of ways by which you can setup your OpenShift cluster like minishift , oc cluster up. [Read More]

Getting started with Kompose

kompose is a tool to help users, familiar with docker-compose, move to Kubernetes. It takes a Docker Compose file and translates it into Kubernetes resources. kompose is a convenience tool to go from local Docker development to managing your application with Kubernetes. We don’t assume that the transformation from docker compose format to Kubernetes API objects will be perfect, but it helps tremendously to start Kubernetizing your application. In this example we will create OpenShift artifacts for guestbook app from the docker-compose file using kompose. [Read More]

Getting started with Ansible Containers

Ansible Container is the ultimate workflow for container development, testing, and deployment. Ansible Container enables you to build Docker images and orchestrate containers using only Ansible playbooks. Describe your application in a Docker Compose-like format and, rather than using a Dockerfile, provide a playbook with tasks for building images. Ansible Container will take it from there. With Ansible Container, you are no longer limited by Dockerfile. You can now apply the power of Ansible to the image build process. [Read More]