Skip to main content

Posts

Helm issues

Helm install pod in pending state: When you execute kubectl get events you will see the following error: no persistent volumes available for this claim and no storage class is set or PersistentVolumeClaim is not bound This error usually comes in kubernetes set with kubeadm. You will need to create persistentvolume with the following yaml file: [code] kind: PersistentVolume apiVersion: v1 metadata: name: redis-data labels: type: local spec: storageClassName: generic capacity: storage: 8Gi accessModes: - ReadWriteOnce hostPath: path: "/bitnami/redis" [/code] create pv with kubectl create -f pv-create.yml Then you will need to create pvc with following yaml [code] kind: PersistentVolumeClaim apiVersion: v1 metadata: name: redis-data spec: storageClassName: generic accessModes: - ReadWriteOnce resources: requests: storage: 8Gi [/code] You will need to create pvc with kubectl create -f pv-claim.yml Check the pvc status with kube

Installing Kubernetes 1.8.1 on centos 7 with flannel

Prerequisites :- You should have at least two VMs (1 master and 1 slave) with you before creating cluster in order to test full functionality of k8s. 1] Master :- Minimum of 1 Gb RAM, 1 CPU core and 50 Gb HDD     ( suggested ) 2] Slave :- Minimum of 1 Gb RAM, 1 CPU core and 50 Gb HDD     ( suggested ) 3] Also, make sure of following things. Network interconnectivity between VMs. hostnames Prefer to give Static IP. DNS entries Disable SELinux $ vi /etc/selinux/config Disable and stop firewall. ( If you are not familiar with firewall ) $ systemctl stop firewalld $ systemctl disable firewalld Following steps creates k8s cluster on the above VMs using kubeadm on centos 7. Step 1] Installing kubelet and kubeadm on all your hosts $ ARCH=x86_64 $ cat <<EOF > /etc/yum.repos.d/kubernetes.repo [kubernetes] name=Kubernetes baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-${ARCH} enabled=1 gpgcheck=1 repo_gpgcheck=1 gpgkey=https://packages.cloud.google.com/yu

Helm: Installation and Configuration

PREREQUISITES You must have Kubernetes installed. We recommend version 1.4.1 or later. You should also have a local configured copy of  kubectl . Helm will figure out where to install Tiller by reading your Kubernetes configuration file (usually  $HOME/.kube/config ). This is the same file that  kubectl  uses. To find out which cluster Tiller would install to, you can run  kubectl config current-context or  kubectl cluster-info . $ kubectl config current-context my-cluster INSTALL HELM Download a binary release of the Helm client. You can use tools like  homebrew , or look at  the official releases page . For more details, or for other options, see  the installation guide . INITIALIZE HELM AND INSTALL TILLER Once you have Helm ready, you can initialize the local CLI and also install Tiller into your Kubernetes cluster in one step: $ helm init This will install Tiller into the Kubernetes cluster you saw with  kubectl config current-context . TIP:  Want to install into a different cl

Serverless Architectures: Monoliths, Nanoservices, Microservices & Hybrids

The Monolith Whenever I hear “monolith”, I think of a massive LAMP project with a single, burning hot MySQL database. (not always the case). The monolith architecture looks something like this in Serverless: I.e. all requests to go to a single Lambda function, app.js. Users and games have nothing to do with one another but the application logic for users and games are in the same Lambda function. Pros We found that the greatest advantage that the monolith had over nanoservices and microservices was speed of deployment. With nanoservices and microservices, you have to deploy multiple copies of dependant node_modules (with Node.js) and any library code that your functions share which can be slow. With the monolith, it’s a single function deployment to all API endpoints so deployment is faster. On the other hand, how common is it to want to deploy all endpoints… Cons This architecture in Serverless, has similar drawbacks to the monolithic architecture in general: Tighter coupling.  In t

Docker - Ubuntu - bash: ping: command not found

Docker images are pretty minimal, But you can install  ping  in your official ubuntu docker image via: apt-get update apt-get install iputils-ping Chances are you dont need  ping  your image, and just want to use it for testing purposes. Above example will help you out. But if you need ping to exist on your image, you can create a  Dockerfile  or  commit  the container you ran the above commands in to a new image. Commit: docker commit -m "Installed iputils-ping" --author "Your Name <name@domain.com>" ContainerNameOrId yourrepository/imagename:tag Dockerfile: FROM ubuntu RUN apt-get update && apt-get install -y iputils-ping CMD bash

Kubernetes Issues

The pods in kubernetes are in pending state when we execute kubectl get pods Execute the following command to see the root cause: kubectl get events You will see output as follows: LAST SEEN FIRST SEEN COUNT NAME KIND SUBOBJECT TYPE REASON SOURCE MESSAG E 1m 14h 3060 hello-nginx-5d47cdc4b7-8btwf.14ecd67c4676131c Pod Warning FailedScheduling default-scheduler No nod es are available that match all of the predicates: PodToleratesNodeTaints (1).This error usually comes when we try to create pod on the master node: Execute the following command: kubectl taint nodes <nodeName> node-role.kubernetes.io/master:NoSchedule- helm install stable/mysql: Error: no available release name found Execute the helm ls command to get the root cause: The error I received is Error: configmaps is forbidden: User "system:serviceaccount:kube-system:default" cannot list configmaps in the namespace "kube-system" The default serviceaccount does not have API permissions. Helm likely ne

Install kubernetes on Centos/RHEL 7

Kubernetes is a  cluster  and  orchestration  engine for docker containers. In other words Kubernetes is  an open source software or tool which is used to orchestrate and manage docker containers in cluster environment. Kubernetes is also known as k8s and it was developed by Google and donated to “Cloud Native Computing foundation” In Kubernetes setup we have one master node and multiple nodes. Cluster nodes is known as worker node or Minion. From the master node we manage the cluster and its nodes using ‘ kubeadm ‘ and ‘ kubectl ‘  command. Kubernetes can be installed and deployed using following methods: Minikube ( It is a single node kubernetes cluster) Kops ( Multi node kubernetes setup into AWS ) Kubeadm ( Multi Node Cluster in our own premises) In this article we will install latest version of Kubernetes 1.7 on CentOS 7 / RHEL 7 with kubeadm utility. In my setup I am taking three CentOS 7 servers with minimal installation. One server will acts master node and rest two serve

Installing Kubernetes on your Windows with Minikube

Personally I think if you are looking for a container management solution in today’s world, you have to invest your time in  Kubernetes  (k8s). There is no doubt about that because of multiple factors. To the best of my undestanding, these points include: Kubernetes is  Open Source Great momentum in terms of activities & contribution at its  Open Source Project Decades of experience running its  predecessor  at Google Support of multiple OS and infrastructure software vendors Rate at which features are being released Production readiness (Damn it,  Pokemon Go  met its scale due to Kubernetes) Number of features available. Check out the list of features at the  home page . The general perception about a management solution like Kubernetes is that it would require quite a bit of setup for you to try it out locally. What this means is that it would take some time to set it up but more than setting it up, you might probably get access to it only during staging phase or so