Tuesday, December 24, 2019

Book Review: The Silent Patient by Alex Michaelides


The Silent PatientThe Silent Patient by Alex Michaelides
My rating: 5 of 5 stars

A debut book by the author and a masterpiece of a work. Theo Faber is a psychotherapist and is trying to treat his patient Alicia Berenson who has gone silent after murdering her husband Gabriel. The story moves very slowly but the end is very nicely done. Highly recommended.

View all my reviews

Thursday, December 19, 2019

Shortcuts for kubectl for bashrc

alias k=kubectl
alias kp='kubectl get pods'
alias ks='kubectl get services'
alias kn='kubectl get ns'

function kexec() {
        kubectl exec $1 -it -- /bin/sh
}


function kdelete() {
        kubectl delete pod $1 --grace-period=0 --force
}
function krun() {
        kubectl run $1 --image=$2 --restart=Never --dry-run -o yaml
}
function kapply() {
        kubectl apply -f $1
}

Wednesday, December 11, 2019

Installing minikube on Ubuntu

Following are the steps for setting up minikube on Ubuntu 19.10:
1. Install KVM
https://help.ubuntu.com/community/KVM/Installation
sudo apt-get install qemu-kvm libvirt-daemon-system libvirt-clients bridge-utils

2. Install minikube
https://kubernetes.io/docs/tasks/tools/install-minikube/
https://github.com/kubernetes/minikube/issues/2412

Set default VM driver as KVM.
minikube config set vm-driver kvm2
minikube delete
minikube start

$ minikube status
host: Running
kubelet: Running
apiserver: Running
kubeconfig: Configured

3.  Install kubectl
https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-on-linux

$ kubectl get nodes
NAME       STATUS   ROLES    AGE   VERSION
minikube   Ready    master   59m   v1.17.0

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0", GitCommit:"70132b0f130acc0bed193d9ba59dd186f0e634cf", GitTreeState:"clean", BuildDate:"2019-12-07T21:20:10Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0", GitCommit:"70132b0f130acc0bed193d9ba59dd186f0e634cf", GitTreeState:"clean", BuildDate:"2019-12-07T21:12:17Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}


4.  Install docker
sudo apt install docker
sudo apt install docker-compose

sudo groupadd docker
sudo usermod -aG docker $USER
docker run hello-world

Popular micro services patterns

Here are some popular Microservice design patterns that a programmer should know: Service Registry  pattern provides a  central location  fo...