Local Development of golang app with minikube & ko

While exploring, I came across ko tool by google & found interesting since it buids and deploy golang applications to kubernetes easily. This post is for minikube only since I am focussing on local development. Pre-Flight Checks Installing ko go get github.com/google/go-containerregistry/cmd/ko That鈥檚 it :) Verify your installation by which ko We can mention any docker registry (local or remote) using KO_DOCKER_REPO env variable, but as we are focussing on local development, we will publish images to minikube鈥檚 docker daemon...

December 5, 2018 路 2 min 路 Suraj Narwade

Exploring Kubernetes: Client-Go - part-1

What鈥檚 client-go ? Where鈥檚 client-go ? you can find it in kubernetes/kubernetes/staging directory and published by bot to k8s.io/client-go, kubernetes also uses client-go. it鈥檚 interesting if you see client-go from kubernetes vendor, it has symlinks to kubernetes/kubernetes/staging In this Adventure, very first step is to see how to connect to API Server :) Connecting to API Server There are two ways to talk to cluster using any go program: outside cluster: if your program is standalone and if you have either kubeconfig file or master URL....

November 30, 2018 路 2 min 路 Suraj Narwade

Exploring Kubernetes: Client-Go - part-2

If you have kubeconfig file already in place, kubeconfig := clientcmd.NewNonInteractiveDeferredLoadingClientConfig(clientcmd.NewDefaultClientConfigLoadingRules(), &clientcmd.ConfigOverrides{}) There is one more function clientcmd.NewInteractiveDeferredLoadingClientConfig but as per code, we can use it only when password is allowed Namespace given by current context, namespace, _, err := kubeconfig.Namespace() REST config needed to operations restconfig, err := kubeconfig.ClientConfig() if you want kubeconfig as a struct clientcmdapi.Config, err := kubeconfig.RawConfig() Here, kubeconfig is interface of following type: // ClientConfig is used to make it easy to get an api server client type ClientConfig interface { // RawConfig returns the merged result of all overrides RawConfig() (clientcmdapi....

November 30, 2018 路 1 min 路 Suraj Narwade

Exploring Kubernetes: Client-Go - part-3

we got restConfig and namespace, connection is set up Yay From this restconfig, Now we need to create respective clients for further operations we will need following package: import k8s.io/client-go/kubernetes create basic kubernetes client: kubeClient, err := kubernetes.NewForConfig(restConfig) it returns clients for APIgroups like: Apps CoreV1 Batch StorageV1 If you have some custom controller, generated code will have NewForConfig function which you have call separately, For example, In case of service catalog,...

November 30, 2018 路 1 min 路 Suraj Narwade

nmcli 101

To check devices: nmcli device status Overall status of NetworkManager: nmcli general status Display connections: nmcli connection show display only active connections: nmcli connection show --active WI-FI Check wifi status nmcli radio wifi Turn on the wifi nmcli radio wifi on Turn off the wifi nmcli radio wifi off List available wifi access points nmcli device wifi list Refresh the access point list nmcli device wifi rescan Connect to wifi nmcli device wifi connect <SSID> Connect to password protected access point nmcli device wifi connect <SSID> password <password>

November 15, 2018 路 1 min 路 Suraj Narwade

Journey to the CKA

Hello Folks, I appeared for the exam on 19th October 2018 and yesterday(20th Oct 2018), I got the result & I scored 92%, Yay :) I got so many request about How to prepare for the exam, Here鈥檚 my experience with preparation for the exam. A bit about Exam: Duration: 3 hours (which is fair time if you do lot of practice, I completed in 2 hours 15 mins) Questions: 24 Clusters: 6 After clearing 9 certs to become RHCA (Red Hat Certified Architect), exam environment was kind of familiar to me....

October 21, 2018 路 4 min 路 Suraj Narwade

Installing Minishift on Fedora

Check for latest release on github: Check here: https://github.com/minishift/minishift/releases Download latest binary wget https://github.com/minishift/minishift/releases/download/v1.24.0/minishift-1.24.0-linux-amd64.tgz tar -xvf minishift-1.24.0-linux-amd64.tgz cp minishift ~/.local/bin/minishift NOTE: Create ~/.local/bin if it鈥檚 not present, it鈥檚 already set in PATH variable. Setting up Virtualization environment sudo dnf install libvirt qemu-kvm -y sudo usermod -a -G libvirt $USER newgrp libvirt Setting the KVM driver sudo curl -L https://github.com/dhiltgen/docker-machine-kvm/releases/download/v0.7.0/docker-machine-driver-kvm -o /usr/local/bin/docker-machine-driver-kvm sudo chmod +x /usr/local/bin/docker-machine-driver-kvm Reference: https://docs.okd.io/latest/minishift/getting-started/installing.html https://docs.okd.io/latest/minishift/getting-started/setting-up-virtualization-environment.html

September 13, 2018 路 1 min 路 Suraj Narwade