Posts

Kubernetes Pod Priority and Preemption

Image
Pod priority indicates the importance of a pod relative to other pods and queues the pods based on that priority. Pod preemption allows the cluster to evict, or preempt, lower-priority pods so that higher-priority pods can be scheduled if there is no available space on a suitable node Pod priority also affects the scheduling order of pods and out-of-resource eviction ordering on the node. Priority classes can help you control the Kubernetes scheduler decisions to favor higher priority pods over lower priority pods. The Kubernetes scheduler can even preempt (remove) lower priority pods that are running so that pending higher priority pods can be scheduled. By setting pod priority, you can help prevent lower priority workloads from impacting critical workloads in your cluster, especially in cases where the cluster starts to reach its resource capacity. root@masterk8s:~# kubectl describe pod kube-scheduler-masterk8s -n kube-system | grep -i priority Priority:        ...

Kubernetes Metric Server

Image
Metrics Server collects resource metrics from Kubelets and exposes them in Kubernetes apiserver through Metrics API for use by Horizontal Pod Autoscaler and Vertical Pod Autoscaler.  Metrics API can also be accessed by kubectl top, making it easier to debug autoscaling pipelines. Metrics Server is not meant for non-autoscaling purposes. For example, don’t use it to forward metrics to monitoring solutions, or as a source of monitoring solution metrics. In such cases please collect metrics from Kubelet /metrics/resource endpoint directly. Metrics Server offers: A single deployment that works on most clusters. Fast autoscaling, collecting metrics every 15 seconds. Resource efficiency, using 1 mili core of CPU and 2 MB of memory for each node in a cluster. Scalable support up to 5,000 node clusters. Requirements: Metrics Server must be reachable from kube-apiserver by container IP address (or node IP if hostNetwork is enabled). The kube-apiserver must enable an aggregation layer. Nodes...

Maven Build Example

Image
  What is maven ? Maven's primary goal is to allow a developer to comprehend the complete state of a development effort in the shortest period of time. In order to attain this goal, Maven deals with several areas of concern: Making the build process easy Providing a uniform build system Providing quality project information Encouraging better development practices Demo on how to convert your Java code to JAR file.

Enable SSL for Jenkins

Image
It is very important to secure Jenkins by enabling SSL which runs in a production environment.  This post walks you through the step-by-step guide for configuring SSL on a Jenkins server. Following are the steps involved in configuring SSL on the Jenkins server. 1) Obtain SSL certificates. 2) Convert SSL keys to PKCS12 format. 3) Convert PKCS12 to JKS format - JKS[Java Key Store] Since Jenkins is a Java based application. 4) Add JKS to Jenkins path. 5) Configure Jenkins startup to use the JKS file. 6) Validate Jenkins SSL. To run Jenkins with HTTPS, you need to configure SSL in Jenkins: Generate CSR certificate: root@devops:/openssl_cert# openssl req -new > jenkins.ssl.csr Generating a RSA private key .....................................................................................................................................................+++++ ......................+++++ writing new private key to 'privkey.pem' Enter PEM pass phrase: Verifying - Enter PEM pass phra...

Jenkins Installation - Ubuntu

Image
Jenkins is a continuous integration tool that allows continuous development, test and deployment of newly created codes.  Primary requirement for Jenkins is Java. Lets install Java. root@jenkins:~# apt install openjdk-8-jdk Rebooting the server after java installation. root@jenkins:~# java -showversion openjdk version "1.8.0_282" OpenJDK Runtime Environment (build 1.8.0_282-8u282-b08-0ubuntu1~18.04-b08) OpenJDK 64-Bit Server VM (build 25.282-b08, mixed mode) root@jenkins:~# Add the repository key to the system for Jenkins installation. root@jenkins:~# wget -q -O - http://pkg.jenkins-ci.org/debian/jenkins-ci.org.key | sudo apt-key add - OK root@jenkins:~# root@jenkins:~# sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list' root@jenkins:~# apt-get update Hit:1 http://us.archive.ubuntu.com/ubuntu bionic InRelease Hit:2 http://security.ubuntu.com/ubuntu bionic-security InRelease Hit:4 http://us.archive.ubuntu.com/ubuntu bi...

Kubernetes Installation - Ubuntu 20.04.3 LTS

Image
Kubernetes is an open-source tool that is crucial in container orchestration. Kubernetes works by orchestrating and managing clusters at scale across various cloud environments or even on-premise servers. A cluster is a set of hosts meant for running containerized applications and services. A cluster needs a minimum of two nodes to work – one master node and a worker node. Keeping scalability in mind, you have the option to expand the cluster with as many worker nodes as required. A node in Kubernetes refers to a server. A master node is a server that manages the state of the cluster. Worker nodes are servers that run the workloads – these are typically containerized applications and services. 1) Disable swap memory on the master and worker nodes but commenting the swap configuration in /etc/fstab and reboot the servers. 2) Set static IP across the nodes. We will use netplan to setup static IP across the nodes. root@masterk8s:/# cat /etc/netplan/01-network-manager-all.yaml # Let Networ...