Helm vs Operator

When it comes to running complex application workloads on Kubernetes two technologies standout — Helm and Kubernetes Operators. In this post we compare them and discuss how they actually complement each other towards solving problems of day-1 and day-2 operations when it comes to running complex application workloads on Kubernetes. We also present guidelines for creating Helm charts for Operators. What is Helm? The basic idea of Helm is to enable reusability of Kubernetes YAML artifacts through templatization. Helm allows defining Kubernetes YAMLs with marked up properties. The actual values for these properties are defined in a separate file. Helm takes the templatized YAMLs and the values file and merges them before deploying the merged YAMLs into a cluster. The package consisting of templatized Kubernetes YAMLs and the values file is called a ‘Helm chart’. Helm project has gained considerable popularity as it… Leggi tuttoHelm vs Operator

Best 11 Kubernetes tool for 2021

Introduction In this article I will try to summarize my favorite tools for Kubernetes with special emphasis on the newest and lesser known tools which I think will become very popular. This is just my personal list based on my experience but, in order to avoid biases, I will try to also mention alternatives to each tool so you can compare and decide based on your needs. I will keep this article as short as I can and I will try to provide links so you can explore more on your own. My goal is to answer the question: “How can I do X in Kubernetes?” by describing tools for different software development tasks. K3D K3D is my favorite way to run Kubernetes(K8s) clusters on my laptop. It is extremely lightweight and very fast. It is a wrapper around K3S using Docker. So, you only need Docker to run it and it has… Leggi tuttoBest 11 Kubernetes tool for 2021

How does ‘kubectl exec’ work?

Last Friday, one of my colleagues approached me and asked a question about how to exec a command in a pod with client-go. I didn’t know the answer and I noticed that I had never thought about the mechanism in “kubectl exec”. I had some ideas about how it should be, but I wasn’t 100% sure. I noted the topic to check again and I have learnt a lot after reading some blogs, docs and source codes. In this blog post, I am going to share my understanding and findings. Setup I cloned https://github.com/ecomm-integration-ballerina/kubernetes-cluster in order to create a k8s cluster in my MacBook. I fixed IP addresses of the nodes in kubelet configurations since the default configuration didn’t let me run kubectl exec. You can find the root cause here. Any machine = my MacBook IP of master node = 192.168.205.10 IP of… Leggi tuttoHow does ‘kubectl exec’ work?

NGINX/PHP-FPM graceful shutdown and 502 errors

We have a PHP application running with Kubernetes in pods with two dedicated containers — NGINX и PHP-FPM. The problem is that during downscaling clients get 502 errors. E.g. when a pod is stopping, its containers can not correctly close existing connections. So, in this post, we will take a closer look at the pods’ termination process in general, and NGINX and PHP-FPM containers in particular. Testing will be performed on the AWS Elastic Kubernetes Service by the Yandex.Tank utility. Ingress resource will create an AWS Application Load Balancer with the AWS ALB Ingress Controller. Для управления контейнерами на Kubernetes WorkerNodes испольузется Docker. Pod Lifecycle — Termination of Pods So, let’s take an overview of the pods’ stopping and termination process. Basically, a pod is a set of processes running on a Kubernetes WorkerNode, which are stopped by standard IPC (Inter-Process Communication) signals. To… Leggi tuttoNGINX/PHP-FPM graceful shutdown and 502 errors

Deploying Kubernetes on bare metal with Rancher 2.0

Contents Install Rancher server Create a Kubernetes cluster Add Kubernetes nodes Install StorageOS as the Kubernetes storage class Understand Nginx Ingress in Rancher Install Rancher Create a VM with Docker and Docker Compose installed and install Rancher 2.0 with docker compose: Rancher docker-compose file: docker-compose.yaml Run these commands to install Rancher with docker compose: git clone https://github.com/polinchw/rancher-docker-compose cd rancher-docker-compose docker-compose up -d Create your Kubernetes cluster with Rancher Install a custom Kubernetes cluster with Rancher. Use the ‘Custom’ cluster. Add Kubernetes nodes and join the Kubernetes cluster Run the following commands on all the VMs that your Kubernetes cluster will run on. The final docker command will have the VM join the new Kubernetes cluster. Replace the –server and –token with your Rancher server and cluster token. Download the kub config file for the cluster After you download the kub config file you can use… Leggi tuttoDeploying Kubernetes on bare metal with Rancher 2.0

Linux Name spaces

Namespaces in Linux are heavily used by many applications, e.g. LXC, Docker and Openstack.Question: How to find all existing namespaces in a Linux system? The answer is quite difficult, because it’s easy to hide a namespace or more exactly make it difficult to find them. Exploring the system In the basic/default setup Ubuntu 12.04 and higher provide namespaces for ipc for IPC objects and POSIX message queues mnt for filesystem mountpoints net for network abstraction (VRF) pid to provide a separated, isolated process ID number space uts to isolate two system identifiers — nodename and domainname – to be used by uname These namespaces are shown for every process in the system. if you execute as rootls -lai /proc/1/nsShell you get the list of attached namespaces of the init process using PID=1. Even this process has attached namespaces. These are the default namespaces… Leggi tuttoLinux Name spaces

Tutorial: creazione di un cluster con un’attività Fargate utilizzando la CLI di Amazon ECS

Questo tutorial mostra come configurare un cluster e distribuire un servizio con attività che utilizzano il tipo di lancio Fargate. Prerequisiti Verifica i seguenti requisiti preliminari: Configura un account AWS. Installa la CLI di Amazon ECS. Per ulteriori informazioni, consulta Installazione dell’interfaccia a riga di comando Amazon ECS. Istalla e configura la AWS CLI. Per ulteriori informazioni, consulta la sezione relativa all’interfaccia a riga di comando di AWS. Fase 1: Crea il ruolo IAM per l’esecuzione dell’attività L’agente del container Amazon ECS effettua chiamate all’API di AWS per tuo conto, pertanto richiede una policy e un ruolo IAM che consentano al servizio di stabilire che l’agente appartiene a te. Questo ruolo IAM viene definito un ruolo IAM di esecuzione delle attività. Se disponi già di un ruolo per l’esecuzione delle attività pronto per essere utilizzato, puoi ignorare questa fase. Per ulteriori… Leggi tuttoTutorial: creazione di un cluster con un’attività Fargate utilizzando la CLI di Amazon ECS

Ready-to-use commands and tips for kubectl

Kubectl is the most important Kubernetes command-line tool that allows you to run commands against clusters. We at Flant internally share our knowledge of using it via formal wiki-like instructions as well as Slack messages (we also have a handy and smart search engine in place — but that’s a whole different story…). Over the years, we have accumulated a large number of various kubectl tips and tricks. Now, we’ve decided to share some of our cheat sheets with a wider community. I am sure our readers might be familiar with many of them. But still, I hope you will learn something new and, thereby, improve your productivity. NB: While some of the commands & techniques listed below were compiled by our engineers, others were found on the Web. In the latter case, we checked them thoroughly and found them useful. Well, let’s get… Leggi tuttoReady-to-use commands and tips for kubectl

Deploying WordPress and MySQL with Persistent Volumes in Kubernetes

This tutorial shows you how to deploy a WordPress site and a MySQL database using Minikube. Both applications use PersistentVolumes and PersistentVolumeClaims to store data. A PersistentVolume (PV) is a piece of storage in the cluster that has been manually provisioned by an administrator, or dynamically provisioned by Kubernetes using a StorageClass. A PersistentVolumeClaim (PVC) is a request for storage by a user that can be fulfilled by a PV. PersistentVolumes and PersistentVolumeClaims are independent from Pod lifecycles and preserve data through restarting, rescheduling, and even deleting Pods.Warning: This deployment is not suitable for production use cases, as it uses single instance WordPress and MySQL Pods. Consider using WordPress Helm Chart to deploy WordPress in production.Note: The files provided in this tutorial are using GA Deployment APIs and are specific to kubernetes version 1.9 and later. If you wish to use this tutorial with an earlier version of Kubernetes,… Leggi tuttoDeploying WordPress and MySQL with Persistent Volumes in Kubernetes