Kubernetes and Terraform: Converting YAML to HCL for Better Automation

Kubernetes and Terraform are both powerful tools for managing cloud infrastructure, but they use different configuration languages. Kubernetes uses YAML, while Terraform uses HashiCorp Configuration Language (HCL). This can make it difficult to use the two tools together, as you may need to convert YAML files to HCL in order to use them with Terraform. Sometimes when you are spinning up managed Kubernetes such as GKE, EKS and AKS, you may need to deploy Kubernetes resources via terraform....

December 10, 2022 · 3 min · Suraj Narwade

Learning Kubernetes with Kubectl

When we work around Kubernetes, we often have to reference the documentation for a few things to save time from the journey from terminal to browser and back. Kubectl offers a great set of help in itself. Learning about the resources The command shows all fields from the pod resource along with its type and information about it. You can also look for a subfield. for example, $ kubectl explain pod $ kubectl explain pod....

April 23, 2021 · 2 min · Suraj Narwade

Chaining Kiam Certificates using Cert-manager

Source: https://unsplash.com/photos/pZld9PiPDno When associating IAM roles with pods instead of assigning a super role to worker nodes, Kiam is a fairly popular project in Community; kiam runs as an agent on each node in the Kubernetes cluster, allowing cluster users to associate IAM roles to Pods. To enhance security, Kiam uses certificates for servers & agents. To simplify the certificate management for Kiam, we will utilise cert-manager, cert-manager is a native Kubernetes certificate management controller that helps issue certificates from various sources or self-signed ones....

April 23, 2021 · 2 min · Suraj Narwade

Adding own service to Kubernetes Cluster Info

Last week, while going through some of the Kubernetes manifest files, I stumbled upon this label: kubernetes.io/cluster-service: “true” I searched about this in Documentation but could not find much information, so I thought of writing a small blog post about it. https://surajincloud.gumroad.com/l/own-kubectl-command When you add this label to any resource of type Kind: Service , it means it is part of cluster service, and the user needs to know when they are looking for cluster information....

March 26, 2021 · 2 min · Suraj Narwade

Creating a Cartesian Product in Terraform

For one of my terraform tasks, I needed all the possible combinations of elements from all given sets. For example, there are two sets. set1 = ["a","b","c"] set2 = [1,2] The expected result is, [["a",1], ["a",2],["b",1],["b",2],["c",1],["c",2]] After searching about this, I learned that such a concept is called the Cartesian Product. From the Wikipedia definition, the Cartesian product of two sets A and B, denoted A × B, is the set of all ordered pairs (a, b) where a is in A and b is in B....

March 16, 2021 · 2 min · Suraj Narwade

Creating users on OpenShift 4

It’s always bit of confusing about OpenShift 4 :D here’s how we can add user in OpenShift 4. Create htpasswd file as below and users and their passwords, $ htpasswd -cb users.htpasswd user1 user1pass $ htpasswd -b users.htpasswd user2 user2pass Through console, login with kube:admin user, navigate to Administration > Cluster Settings > Global Configuration Click on Edit YAML in front of Oauth Click on Overview, under Identity Providers section, Click on Add and select HTPasswd...

April 13, 2019 · 1 min · Suraj Narwade

Story of Noob Developer on OpenShift

A NodeJS developer named Warlock, recently joined his dream company as an Enterprise Developer. On day 1, his boss gave him a Code Repository & his OpenShift Platform Credentials to work his magic. Warlock got his code, git clone https://github.com/sclorg/nodejs-ex But was unclear about how to proceed as he had no idea about OpenShift. He then referred to the OpenShift docs but got confused and overwhelmed by all the new terminologies, DeploymentConfigs, Pods, Services, and Routes mentioned in it....

January 17, 2019 · 2 min · Suraj Narwade