awscli is a Python command line tool that allows us to manage various AWS services, first we need to install awscli, to do this run

$ sudo pip3 install awscli

Now we need to create an access key for our AWS user, to do this open the web interface to AWS console and do the following for the user you want to create an access key, note that the accesses of the key are limited from the accesses that the user have.

Now we need to configure the awscli to use this key, open shell and enter

$ aws configure


Tkinter is the Python standard library for GUI applications, Tk is a very good choice to create GUI apps for Python because:

  • Tkinter created apps will run on every major Python implementation for Windows, MacOS and Linux
  • There is no need to install external packages, is included with the Python standard library
  • Its allready widely used, so you can find many examples of real life applications using Tk

Lets create the simplest Tk application we can

  • Line 1: imports the tkinter library
  • Line 3: Creates the main window tk object
  • Line 7: Listens for events on the main window

Running…


What are containers?

As part of Docker documentation “a container is a standard unit of software that packages up code and all its depedencies so the application runs quickly and reliably from one computing environment to another”.

The advantages of containers

  • Portability: Containers let you run software easily in a variety of environments.
  • Consistency: Containers help software run in the same way no matter which environment you running in.
  • Low overhead: Containers use fewer resources than some other technologies, such as virtual machines.

Container Runtimes

A container runtime is the software used to run containers on the machine

What does…


golang

Those are my personal notes on my journey to learn go and is not a full tutorial, i assume that you have already installed go on your system.

The simplest valid go program

The simplest go program valid for compilation is this, save it as main.go

package mainfunc main() {
}

go give us two options, one is to compile the program into an executable and the second one is to run it without compilation (to be honest i believe that still compilation occurs somehow in the background)

How to compile a program

In the following example we can see that compiling main.go …


what is a namespace

Namespaces are virtual clusters backed by the same physical cluster. Kubernetes objects like pods and containers live in namespaces, essentially a namespaces is a way to organize objects in your kubernetes cluster

Namespaces is a very useful tool if you have many different type of applications running or if you have multiple teams that share the cluster.

working with namespaces

$ kubectl get namespaces
NAME STATUS AGE
default Active 21h
kube-node-lease Active 21h
kube-public Active 21h
kube-system Active 21h

All Kubernetes clusters have a default namespace. This is used when no other namespace is defined.

kubeadm also creates the kube-system…


Photo by Lance Anderson on Unsplash

stdin,stdout and stderr

When bash starts creates three file descriptors, these file descriptors point not to a file but in a terminal device usually in the format of /dev/tty[n]

stdin: file descriptor 0, stdin stands for standard input and means incoming to the terminal data, the standard device to enter data to the terminal is the keyboard.

stdout: file descriptor 1, stdout stands for standard output and means printing to the terminal normal messages, or text.

stderr: file descriptor 2, stderr stands for standard error and means printing error messages to the terminal.

redirecting output

The stdout and stderr can redirected to a file if…


This tutorial has been tested with an ubuntu 18.04 distribution and its purpose is to create a controller host and any number of worker hosts.

The bellow steps must executed to all hosts of the cluster

Containerd

We will use containerd as CRI runtime, this means that we need to enable and load some kernel modules and do some network configuration changes as well.

Execute the following as root or with sudo

cat <<EOF | sudo tee /etc/modules-load.d/containerd.conf
overlay
br_netfilter
EOF

sudo modprobe overlay
sudo modprobe br_netfilter

# Setup required sysctl params, these persist across reboots.
cat <<EOF | sudo tee /etc/sysctl.d/99-kubernetes-cri.conf
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward…


What are and/or/no-care chains?

and/or/no-care chains are bash syntactic sugar that allows users to execute a chain of commands and decide which command to be executed on this chain based on the exit code of the previous command.

Examples:

Linux has a command named true its usage is very simple to understand, it exists with exit code 0 and this can be verified with the $? variable which holds the exit code of the last executed command.

kpatronas@narcissus:~$ true
kpatronas@narcissus:~$ echo $?
0

As you can guess there is also the false command that exits always with exit code 1

kpatronas@narcissus:~$ false
kpatronas@narcissus:~$ echo $?
1…


Kubernetes is composed by a set of processes running on machines of a network that can communicate each other, those processes can divided into two categories, the control plane processes and ne node processes

Kubernetes Control Plane

The control plane is a collection of software components that manage the cluster, these components can run to any machine of the cluster but usually are run on dedicated controller machines.

Control Plane Architecture
  • kube-api-server this process exposes the Kubernetes API, which is the interface to the control plane and the cluster.
  • Etcd is a key/value database which Kubernetes API uses to keep the configuration and…


grep is the standard unix tool to filter text files and will remain the standard tool because of its speed and many examples available online, but grep its not well suited to parse JSON because it doesnt do any filtering between key and values of JSON. But there is a nice solution to parse and filter JSON, its called jq.

Example: How to read JSON input

jq can be used to read JSON output from another process like curl or provide a file name to parse

Example: reading input from another process and from a file

Example: print the full JSON pretty printed.

The “.” expression means print all key-values…

Konstantinos Patronas

DevOps engineer, loves Linux, Python, cats and Amiga computers

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store