Posts

Showing posts with the label K8s

Kubernetes Labels - Selectors, Annotations

Image
What this post covers? In this post we will explore all possible options that can be used for Kubernetes Labels and selectors. Adding labels Show labels  Replace labels Deleting labels   Adding Labels to Pods Adding labels while you creating bare pods imperatively using 'kubectl run' command, here I'm using three different images httpd, redis, rabbitmq.   kubectl run web --image=httpd:2.4.54-alpine \ --labels="env=prod,author=pavandeverakonda,component=customer,tier=frontend" kubectl run db --image=redis:alpine \ --labels="env=prod,author=pavandeverakonda,component=customer,tier=backend" kubectl run web2 --image=httpd:2.4.54-alpine \ --labels="env=dev,author=pavandeverakonda,component=customer,tier=frontend" kubectl run db2 --image=redis:alpine \ --labels="env=dev,author=pavandeverakonda,component=customer,tier=backend" kubectl run msg-pod --image=rabbitmq \ --labels="env=prod,author=ranjan,component=customer,tier=integra...

Kubernetes installation on CentOS7 Vagrant boxes Manually

Image
This page is updated in 2022 with new instructions which works for Rocky LInux as well! As we have seen and had a setup that Docker EE installation on CentOS7 . A year ago when I have worked on Kubernetes setup on the Ubuntu Linux that virtualization included all the steps involved in Docker installation to Kubernetes cluster configuration everything automated within Vagrantfile. Kubernetes Cluster on your Desktop or Laptop or Mac book In this post, I would like to share the manual steps that work to build a Kubernetes Cluster on CentOS7. We will be using the Docker EE installed nodes to install Kubernetes. So bringing up vagrant boxes the same thing that we had discussed earlier post proceed further. Step 1: Check the System requirements We have three nodes: master, node1, node2. On ALL Nodes: CPU Cores  2, RAM size- 2GB Minimum 4GB good Otherwise, Master node make it 3GB, Slave nodes with 1.5GB also a wise plan if you have limited resources. Prepar...

Kubernetes Services

Image
 Hello everyone !! In this post, we will discuss the Kubernetes Services, What, and How we can deploy the service on a Kubernetes cluster. What is Kubernetes Service? We have Kubernetes services for not to remember the pod IP address, it is more comfortable inter-connecting the pods using service names. Why we need Kubernetes Services? We will get to know once we deploy the following different kinds of Kubernetes services on your Kubernetes cluster. Types of Kubernetes Services NodePort ClusterIP Headless  Loadbalancer Kubernetes Service types NodePort The node port will be a port enabled on a Node per microservice application.  Let's have pod defination in myapp.yaml apiVersion: v1 kind: Pod metadata: name: myapp-pod labels: app: myapp spec: containers: - name: nginx-containers image: nginx Create the myapp pod using the above defination. Example nodeport.yaml file apiVersion: v1 kind: Service metadata: name: appservi...

Kubernetes cluster configuration in a Virtualbox with vagrant

Image
Thanks to Rajkumar who had developed the Vagrantfile and published in the github on Kubernetes cluster configuration in a Virtualbox with vagrant. For those who don't know about Vagrant it is a tool that will be used for virtualization into a different level and more powerful way of using your system resources to run multiple operating virtual boxes in your Laptop/Desktop systems. You just need to follow the simple steps which I had done in my experiment: Prerequisites for Kubernetes Cluster Creation Download latest Vagrant Download latest version of Oracle VirtualBox System resources requirements on VirtualBox 2 GB for each node 2 cores CPUs for each node Here I have don this expeiment on my Windows 7 laptop. You could do same on any Windows higher version as well. Total 3 VMs will be created under a group named as - "Kubernetes Cluster" as defined in Vagrantfile. Infrastructure as a Code: Vagrantfile  The Vagrantfile will be composed w...