Posts

Showing posts from 2020

Persistent Volume Example in Kubernetes - Stateful Application

Image
Welcome back on Kubernetes tutorial series. In today's tutorial , we will talk about using persistent volumes in kubernetes and a quick demo of setting up persistent volume on your local machine. Persistent volumes are useful for stateful application development where you always keep record of last information processed or maintain database transactional status.  We all know by default if your Pod re-starts then you loose current status of your application which may not be applicable in every scenario. In this example, we will provision PersistentVolume(PV) and PersistentVolumeClaim using default Storage class provisioned by hostPath. There are multiple types of Storage classes supported by Kubernetes. Complete list can be found by below link. https://kubernetes.io/docs/concepts/storage/storage-classes/ Github Location :  https://github.com/shashivish/kubernetes-example/tree/master/pvc-example Pre-requisite : Minikube Cluster On a high level , we will be following below task in th

Resource Request/Limit in Kubernetes

Image
 Hello There , Welcome back again on new post on Kubernetes tutorial. In todays article, we will focus on configuring resource requests and resource limits.   Each Pod requires certain amount of memory and cpu to function but some unusual circumstances Pod can behave weirdly and may consume entire cluster resource causing application and node failures. This behaviour can be controlled by below two configuration in Pod. Requests : It is minimum amount of resource require for Pod to function. Kubernetes will look for available nodes to schedule pod based on requested resource. Limits : It is maximum amount of resource required by Pod can consume. In this article , we will accomplish following points. Create a Pod without Resource Configuration Perform CPU Stress on Container  Observe Resource Utilisation of Pod and Nodes. Enable Resource Configuration in Pod Observe Resource Utilisation of Pod and Nodes again. Pre-requisite : Minikube Cluster  Do cker Image :  progrium/stress  Let

Access Kubernetes ConfigMap in Spring Boot Application

Image
 Hello There, Welcome back to our new post on Kubernetes tutorials. In this example we will see how can we configure and access ConfigMap in Spring boot application. ConfigMaps are helpful where you have multiple environment (Dev,Test Prod etc) and you want to promote your container with different environment configuration. There are three ways Pods can access ConfigMap in containers. For todays Demo , we will use Environment Variable approach. Pre-requisite : MiniKube Cluster   For Demo Purpose I have created Spring Boot application which will expose below end point.  curl localhost:8080/configMap Docker Image : shashivish123/springboot  Below is how Controller class looks like and value is being autowired from application.properties. Remember CONFIG_KEY value will be coming from Kubernetes ConfigMap Environment Configuration. Now Let's Begin , We will start by Creating firs ConfigMap in Kubernetes. Step 1: Create a namespace where we will deploy container and

Kubernetes Hello World Example with Spring Boot Application

Image
Hey There , Today we will learn , how can we deploy our first spring boot demo application via Kubernetes. As a pre-requisite , I have already created a spring boot application and uploaded on public docker hub. Docker Image Name : shashivish123/exploration Pre-requisite : MiniKube Cluster  Step 1: Start Your Kubernetes cluster if not running . In below example ,we will be using Minikube cluster for development purpose. If you do not know , how to install minikube cluster , please follow official kubernetes documentation. Step 2: Now since our cluster is running fine , we will start by create a namespace where we will deploy our Kubernetes Pods and Services.   #Create Namespace kubectl create namespace casdemo Step 3: Next step is to create manifest file which will be used for creating pods and services. #Create Manifest Files kubectl create deployment casdemo --image=shashivish123/casexploration : latest --dry-run -o=yaml > deployment.yaml kubectl create s

Passed AWS Solution Architect - Associate Exam

It has been while I wrote any post but recently I cleared my first Cloud Certification(Yipeee) from Amazon , so thought of sharing my experience with larger community. If you have heard about Cloud technology , You might be aware about Amazon , Google , Microsoft etc. These are all biggest vendors of Cloud Technology. Many people might wonder What is Cloud Technology ? Is it something storing in Cloud ? Well In simple words , You Store or Run your application in infrastructure which you really don't manage it.  Earlier If I want to setup an IT company , I would be most worried about my Hardware cost , its place where my most of my money will go in and seriously friends it really needs big investment when you begin. But now-a-days Cloud Technologies has really helped small scale industries to begin and scale your infrastructure as you grow. This is excellent. Now I don't have to worry about my hardware cost , I can start something really small and scale out my infrast