kubectl apply command is used to manage applications by creating and updating Kubernetes resources declared in configuration files. In addition to possibly to manage resources through individual files, there is a way to apply all the YAML files in a folder. In this short note i will show how to use the kubectl apply command […]
In this note i will show how to create a Deployment from the command line using the kubectl command. Below you will find the examples of how to deploy an Nginx Docker image on a Kubernetes cluster and how to update and scale it using the kubectl command only (without YAML configs). I will also […]
Minikube is a single-node Kubernetes cluster that can be installed on macOS, Linux and Windows. By default, it starts with 2 CPUs and 2GB of memory, that may not be enough for experiments with some heavy projects. This note describes 3 easy ways to start the Minikube with more memory and CPUs.
Application logs can be retrieved from a Pod in Kubernetes using kubectl command. In this note i will show how to get logs from a running Pod (including all replicas) and a previously crashed Pod. I will also show how to tail and follow logs from a Pod using kubectl command.
A Deployment in Kubernetes is the process of providing declarative updates to Pods. It allows to declare the desired state in the manifest (YAML) file, and the controller will change the current state to the declared state. Deployments can scale the number of replica Pods, enable rollout of updated code in a controlled manner, or […]
In Kubernetes, a Service is an abstraction which represents a logical set of Pods and a policy by which to access them. Although each Pod has a unique IP address, those IPs are not exposed outside the cluster without a Service. The point is that Pods in Kubernetes are “mortal” – every time a Pod […]
Kubernetes supports multiple virtual clusters backed by the same physical cluster. These virtual clusters in Kubernetes are called Namespaces. The Namespaces allow to partition physical resources into the logically named groups, allowing a Kubernetes cluster to share resources between multiple groups. In this note i will show how to get the current Namespace, list all […]
Minikube is a single-node Kubernetes cluster that can be installed on macOS, Linux and Windows. It lets you to try out Kubernetes locally on your personal computer or use it for daily development work. In this note i will show how to install Minikube & Kubectl on Ubuntu (with VirtualBox) and deploy a first “Hello […]
A kubectl exec command serves for executing commands in Docker containers running inside Kubernetes Pods. With this command it is also possible to get an interactive shell to a Docker container running inside a Pod. In this post i will show how to login to a Pod and execute an interactive shell session using the […]
A Context in Kubernetes is used to group access parameters under convenient names in a kubeconfig file. Each Context has three parameters: Cluster, Namespace and User. In this note i will show how to display and how to change Context in Kubernetes using the kubectl command.