Kubectl: Get Deployments – Kubernetes

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 rollback to an earlier Deployment version if necessary.

This note shows how to get the list of Deployments in Kubernetes, how to Describe deployments and how to get the Deployment details in YAML format using the kubectl command. (more…)

Kubectl: Get Services – Kubernetes

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 dies for some reason, a new Pod is created in its place with a different IP address, so IP addresses of Pods cannot be called persistent and stable.

The idea of a Service is to group a set of Pod endpoints (back-end) into a single resource (front-end) with a persistent IP addresses that can be exposed in different ways depending on a ServiceType.

In this note i will show how to list Services in Kubernetes using the kubectl command and how to get detailed information about each Service in different formats. (more…)

Sublime Text: Git Integration

Out of the box, Sublime Text has a quite limited integration with Git.

You can work with Git repositories in Sublime Text but for advanced features you should install additional software.

Complete integration of Sublime Text with Git can be achieved by installing Sublime Merge – a full-featured Git client built upon the technologies from Sublime Text.

In this note i will show how to integrate Sublime Text with Git. (more…)

Kubectl: List & Change Namespaces – Kubernetes

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 Namespaces and switch between Namespaces in Kubernetes cluster using the kubectl and kubens commands. (more…)

Create Swap File – Ubuntu Linux

Swap in Linux is a space on a disk drive (HDD or SSD) that is used when the amount of physical memory (RAM) tends to get full.

Swap space is usually created as a dedicated swap partition during the system’s installation but it also can take the form of a swap file.

As usually there is no swap partitions on Linux VMs, the only way to create or extend a swap space there is by creating a swap file.

In this note i will show how to create a swap file on Ubuntu, though these commands should work for the other Linux systems as well. (more…)

Swappiness in Linux (Ubuntu) – How To Change

If you execute the free -m command you may notice that the operating system can use some swap even if there is still RAM free.

This behaviour is controlled by the Linux kernel parameter vm.swappiness and can be changed by setting its value from 0 to 100.

The swappiness in Linux is a rate in which the operating system tends to write data out of the RAM onto the disk drive (HDD or SSD).

In this note i’ll show how to check and how to change the swappiness in Linux. (more…)

Disable Swap Permanently – Ubuntu Linux

Swap in Linux is a space on a disk drive (HDD or SSD) that is used when the amount of physical memory (RAM) tends to get full.

Although it protects Linux system from getting out of memory, in certain cases it is recommended to disable swap.

For example swap should be disabled on Kubernetes nodes, on database servers where I/O performance is critical and on SSD drives to increase their lifespan.

In this note i will show how to disable swap permanently on Ubuntu, though these commands should work for the other Linux systems as well. (more…)