The kubectl get all command is used to list down such Kubernetes resources as Pods, Services, StatefulSets, etc. But this command doesn’t really list all the resources in a Namespace. To really get all the Kubernetes resources in the Namespace we can use the combination of the kubectl api-resources and kubectl get commands. This short […]
An NFS (Network File System) is one of the most useful volume types in Kubernetes. To mount a directory shared from an NFS server to a container running in a Kubernetes Pod it is required to do the following: Add the NFS volume to the Pod. Set the NFS server and path to the share. […]
In programming, we use .env or separate config files to store settings, configurations or variables separately from the application code. This permits to run the application in different environments. A ConfigMap in a Kubernetes is used to achieve the same functionality – it allows to make applications portable by decoupling environment-specific configurations from the containers. […]
A Service Account in Kubernetes is a special type of non-human privileged account that provides an identity for processes that run in a Pod. When you create a Pod, if you do not specify a Service Account, it is automatically assigned the default Service Account in the same Namespace. This note shows how to list […]
When a Node in a Kubernetes cluster crashes or shuts down, it enters the ‘NotReady‘ state in which it can’t be used to run Pods and all stateful Pods running on it become unavailable. Common reasons of the ‘NotReady‘ error include a lack of resources on the Node, connectivity issue between the Node and the […]
When you deploy an application in a Kubernetes cluster, you usually set some labels on the Pods e.g. app=my-app. These labels can be used as a wildcard for selecting a group of Pods for deletion. This short note shows how to perform a wildcard deletion of Pods in Kubernetes.
Kubernetes events are automatically created when other resources have state changes, errors or other messages that should be broadcasted to the system. These events (logs) are very helpful for debugging issues in a Kubernetes cluster. In this note i will show how to get events from a specific Node in the Kubernetes cluster using the […]
A Pod is a group of one or more containers with shared storage, network and lifecycle and is the basic deployable unit in Kubernetes. Each Pod is scheduled on the same Node, and remains there until termination or deletion. In this note i will show how to get Pods running on a specific Node using […]
Out of the box, there is a Namespace called ‘default‘ in a Kubernetes cluster. By default, the kubectl command interacts with this ‘default‘ Namespace, but it can be changed to any other Namespace. In this note i will show how to set the default Namespace in Kubernetes.
Imagine the situation, when you are starting a Deployment of some application on a Kubernetes cluster by running, for example, the kubectl create deployment command. Then you execute the kubectl get pods command to list the Pods, but it returns “No resource found“, that means the Deployment hasn’t created any Pods. Below i will show […]