My Redhat internship : What I learnt and experienced during the initial phase

How to not feel overwhelmed on a Tech intern.

Ayushi Rastogi
5 min readMar 8, 2021

Hey everyone, I am Ayushi Rastogi, an intern in the Developer Engineering Team at RedHat.

This series of blogs is an attempt to give an insight into my six month internship. This intern is not a part of my curriculum. It’s just an attempt to understand the bigger picture, what does a piece of code go through, right from being in the Code editor to production.

So the first month was a part of the Bootcamp where we were given 101 sessions for some topics like Golang, React, Tekton, Kubernetes, Openshift, Gitops, Javascript, React, Logging, etc. For a better understanding of Golang, you can go through these questions and of course the Go Bible.

Two months ago, I was avoiding the situations where I would be directly exposed to working with the aforementioned technologies but I think I am now comfortable with these. Not only I have the basic understanding but I am happy I can think beyond these basic building blocks and look at the bigger picture as to how code goes into production. These articles are purely on the basis of my understanding and have no relation to my current organization whatsoever.

So, cut to the point where you have successfully written your application and you need to create a Deployment.

Some buzzwords which need an introduction before diving deep into Containers are:

  1. YAML file : The recursive acronym ‘YAML Ain’t a markup language’ helps us to create an object with required specifications. Thus it is used to define a current/existing state. A simple yaml file can be:
A yaml file showing employee information as key-value pairs

2. Dockerfile : It is a Yaml file which has very particular instructions over how to build an image. It specifies all the tasks that a container will be doing, once it is built. Also, it mentions the port expositions, file locations etc specific to the running container.

3. Image : Image is like a predefined static file which has a few executable lines of code. Different platforms like DockerHub can be found hosting raw images like Alpine-Go, ubuntu, nginx etc. These can be used as a base image and can be layered over/ customised.

4. Container : It is a running form of an image on a machine. Thus, an image can exist independently but a container cannot. A basic container running a Hello World Golang API can be found here.

Image illustrating how a Dockerfile eventually turns into a container

5. Docker/Podman — These are software platforms that help us run containers on our machine. External resources such as Docker registry also have inbuilt images to be used.

6. Pod : It is a collection of containers. In the context of Kubernetes, it is the smallest identifiable unit. Different containers within a pod can work simultaneously towards a single goal. For example, a single pod can host three containers, each handling database, backend, frontend single handedly. It is important to understand the lifecycle of a pod and infer the reason behind your pod’s current status in the cluster.

6. Replica sets : These are multiple copies of the same pod. In case of multiple containers, there is a good probability that some of them may fail (due to developer misconfiguration, over commitment of resources, lack of capacity management etc). To rectify this, we need a mechanism to ensure a specific number of copies of a pod running at all times.

If we look closely at how the problem of deprecating containers is solved through replicasets, we feel that specifying replica sets manually is not good because we don’t always know the no of replicasets required beforehand. So there arose a need to build a container orchestration tool which could think intelligently whenever anything went wrong with containers. Then came our Knight in the shining armour, Kubernetes.

The whole idea of Kubernetes is to maintain that balance between the current state and the desired state (handled by the Kubernetes controller, further mentioned in the Kube architecture). Also Kubernetes can perform resource application and traffic management.

It is very important that we understand what we want from our deployment because the majority of tech teams today use kubernetes just because it seems cool to use it.

Some basic kubernetes can be understood by having only one Node. For this, minikube is used. Just run minikube start on your machine and then you can practice out kubernetes by kubectl commands.

Let’s move towards towards the highway and talk about Openshift. It can be termed as an attractive, easy-to-use, smoother, more abstracted version of Kubernetes. The need of using Openshift over Kubernetes can be understood here. For using Openshift in Developer perspective, just download the crc file and run crc setup in the required path.

Image illustrating the need to use OpenShift

Noob notes:

  1. It is very important to check and monitor the indentation in a yaml file. Sometimes the file does not build even if a space before any colon is missed.
  2. Some predefined keywords like apiVersion, kind, metadata etc are to be defined according to the nature of the yaml file. Please understand their uses to ensure smooth customisation of yamls at your end. These fields need not to be memorised as IDEs like VSCode have extensions and autofill the requirements.
  3. Don’t forget to go through this kubectl cheatsheet. Link: https://kubernetes.io/docs/reference/kubectl/cheatsheet/
  4. To have an intensive practice of Kubernetes, you can practice these 150 questions. Link: https://github.com/ayushi-24git/Kubernatural. You are now one step closer to being a Kube Pro ;)
  5. On RHEL 8 OS, try sudo with your command if it doesnt work originally, but make sure you understand the reason behind the scenario.

6. For a smoother induction into the domain of Containers, I found these courses really helpful:

Red Hat OpenShift I: Containers & Kubernetes (DO180)

Red Hat OpenShift Development II: Containerizing Applications (DO288)

Some more useful links:

  1. https://www.youtube.com/watch?v=VnvRFRk_51k&list=PLy7NrYWoggjziYQIDorlXjTvvwweTYoNC
  2. https://www.youtube.com/watch?v=3c-iBn73dDE&list=PLy7NrYWoggjxtN4YbSMYFFdpaxb-fR4zC

References:

  1. https://docs.ansible.com/ansible/latest/reference_appendices/YAMLSyntax.html
  2. https://docs.docker.com/language/nodejs/run-containers/
  3. https://www.mirantis.com/blog/kubernetes-replication-controller-replica-set-and-deployments-understanding-replication-options/
  4. https://jfrog.com/knowledge-base/a-beginners-guide-to-understanding-and-building-docker-images/
  5. https://www.redhat.com/en
  6. https://chronicler.tech/red-hat-openshift-overview/
  7. https://8gwifi.org/docs/kube-pods.jsp

Please feel free to reach out in case of any queries. Happy learning!

--

--