In Kubernetes Pod YAML files, the "command" field tells the container what to do when the pod starts, and the "args" field gives it any parameter or augments needed. This sample java project, takes 2 number as an argument and shows the output. In case of a docker image, the way to pass command and … Continue reading How do you pass arguments to a POD in Kubernetes ?
Category: Docker
How do you list all the PODs and containers in your Kubernetes cluster
To list all pods and containers use the below command kubectl get pods -o=custom-columns=POD:.metadata.name,CONTAINERS:.spec.containers[*].name To list all pods and containers in a given namespace use the below command kubectl get pods -o=custom-columns=POD:.metadata.name,CONTAINERS:.spec.containers[*].name -n <<namespace>> Output of the above command will show PODs and the containers against it in a tabular format. Details on what are … Continue reading How do you list all the PODs and containers in your Kubernetes cluster
How do i check logs of a docker container ?
To demonstrate this, i have a sample spring boot application which prints log every 1000 milliseconds (1 second) @RestController public class RandomLoggerResource { private static final Logger logger = LoggerFactory.getLogger(RandomLoggerResource.class); private Random random = new Random(); @Scheduled(fixedRate = 1000) public void logRandomMessage() { int randomInt = random.nextInt(); String randomMessage = "Generating a Random integer every … Continue reading How do i check logs of a docker container ?
What is HELM, why do you need it & what problem does it solve for Kubernetes?
Helm is a tool which helps to manage Kubernetes applications. Deploying applications to Kubernetes is not a simple task and some of the concepts and techniques for deploying and managing applications and services has a steep learning curve. To deploy a simple spring boot application with PostgreSQL backend, explained in blog we had to write … Continue reading What is HELM, why do you need it & what problem does it solve for Kubernetes?
Can i copy files from host to container and from container to host ? If so, how can i do it ?
Yes, you can copy files from host to container and from container to host. The docker cp utility copies the contents of source to the destination. You can copy from the container’s file system to the local machine or the reverse, from the local filesystem to the container. Localhost --> Container docker cp <path of … Continue reading Can i copy files from host to container and from container to host ? If so, how can i do it ?
Setup of spring boot application & initialization of PostgreSQL database on Kubernetes – PART 2
In the PART 1 of this blog series, we deployed a PostgreSQL database on minikube. In this part, we will deploy spring boot application . I have mentioned in PART 1 , how to dockerize and upload the order service to docker registry. The application.properties of the service , will get the details of database … Continue reading Setup of spring boot application & initialization of PostgreSQL database on Kubernetes – PART 2
Setup of spring boot application & initialization of PostgreSQL database on Kubernetes – PART 1
How to deploy a containerized spring boot application , with PostgreSQL as database on minikube. This post will also share details on how to initialize the database with tables and data during the initialization process. Will use a spring boot application order service with a REST endpoint to fetch customer details GET /customers It uses … Continue reading Setup of spring boot application & initialization of PostgreSQL database on Kubernetes – PART 1
How do you give arguments to a docker container? What is CMD & ENTRYPOINT in a docker file ?
If you want to build a docker container which takes argument or needs an argument at the startup , how do you do that ? Example: We have a java program , which adds two number and we want users to pass arguments when they do docker run.. so how do we accomplish that when … Continue reading How do you give arguments to a docker container? What is CMD & ENTRYPOINT in a docker file ?
Why is POD the smallest deployable unit in Kubernetes and not containers??
Kubernetes does not work directly with containers, it uses POD as the smallest deployable unit.A container contains all our application code and its dependencies packaged as a single unit, but in order for Kubernetes to run and manage these containers, it needs additional features, for example restart policy which defines what to do with a … Continue reading Why is POD the smallest deployable unit in Kubernetes and not containers??
Kubernetes Namespaces & Kubens
As you start deploying Pods, Deployments, Services etc. on the kubernetes cluster, these objects will grow exponentially and maintaining them becomes a challenge.For example, different teams cannot create services or deployments with the same name or listing of all the pods will take time as the number of pods grow.Namespace is a kubernetes object that … Continue reading Kubernetes Namespaces & Kubens