Skip to main content

Posts

Setup Private Registry for K8s Cluster using Trow Script

Pre-requisites: K8S cluster setup and running. If you have not done this before, first check my post for setting the K8s cluster https://jinojoseph.blogspot.com/2019/10/installing-k8s-as-cluster-using-kubeadm.html Once you have done that what if you need to build and run your own image? You're going to need to push your image to a registry that is accessible to Kubernetes. The obvious option is to use the Docker Hub, but what if you want to keep your image private? The answer: run a registry inside the Kubernetes cluster itself. This way there's no need to worry about hidden costs or pushing to external resources. You can use the default Docker registry for this purpose, but to do this securely requires setting up TLS certificates and manual twiddling. A simpler option is to install the Trow registry via its install script, which will also take care of configuring TLS correctly. # git clone https://github.com/ContainerSolutions/trow.git # cd trow # ./insta...

Controllers in K8s

CONTROLLERS Controllers are the brain behind the k8s. They are the processes that monitor the k8s objects and respond accordingly. Replication Controller: The replication controller helps us to run multiple instances of a single pod in a k8s cluster, thus providing High Availability. They can also replace a Single failed pod, thus provide HA even without multiple instance of PODs. It also helps in Load Balancing and Scaling. Another reason we need replicaiton controller is to create mulltiple pods and to share the load between them. At first it will increase the number of pods in the same node when demand increases, say when the user is increasing. After the node has reached its bottleneck , we will create additional pods in another new nodes. Thus the replication controller spans across multiple nodes in the cluster. Replication Controller Vs Replica Set: They both have the same purpose, but they are not the same. Replic...

Mysql Master Master Replication & LoadBalancing using HaProxy

Requirements ############## Two server running Ubuntu 16.04. Static IP address 10.0.1.12 (dn1) configured on first master server. Static IP address 10.0.1.14 (dn2) configured on second master server. A non-root user with sudo privileges configure on both server. First, you will need to install mysql server and client on dn1 server. You can install it with the following command: # sudo apt-get install mysql-server mysql-client Next, you will need to make some changes in my.cnf file of First server as below: ---------------------------------------------------------------------------------- vi /etc/mysql/mysql.conf.d/mysqld.cnf server-id = 1 log_bin = /var/log/mysql/mysql-bin.log expire_logs_days = 10 max_binlog_size   = 100M # service mysql restart Next, you will need to make some changes in my.cnf file of dn2 server as below: ---------------------------------------------------------------------------------- vi /etc/mysql/mysql.conf.d/mysqld.cnf...

INSTALLING K8S AS A CLUSTER USING KUBEADM

############################################################################# Step1: We need multiple systems or VM s created for configuring multinode cluster. Step2: Install container runtime engine (docker) on all the master and worker nodes. Step3: Install kubeadm ( Pronounced as kubeadmin) on all the master and worker nodes. Step4: Initialize the master server in the Master node. Step5: Make sure a POD Network connection is configured between master and worker nodes. Step6: Join the worker node to the master node. ############################################################################# UBUNTU ######### Docker Installation Commands: https://docs.docker.com/install/linux/docker-ce/ubuntu/ Execute the below commands in all the nodes: # apt-get update # sudo apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common # curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - # su...