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’s not present, it’s 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

Play with OpenShift Internal Docker Registry and imagestreams

Configure your shell to use docker daemon of Minishift eval $(minishift docker-env) export user token registry URL export TOKEN=$(oc whoami -t) export REGISTRY_URL=$(minishift openshift registry) Logging in to Registry docker login -u developer -p $TOKEN $REGISTRY_URL OR we can use directly as, docker login -u developer -p $(oc whoam -t) $(minishift openshift registry) Now you can tag images, push it to respective project to create imagestream docker tag mynodejs $(minishift openshift registry)/myproject/nodejs Push the docker image to registry so that it will create imagestream automatically, docker push $(minishift openshift registry)/myproject/nodejs Now you can create application using the new imagestream, oc new-app --image-stream=nodejs --name app

August 13, 2018 · 1 min · Suraj Narwade

FOSSASIA Summit 2018-Event Report

Day1 I reached venue (LifeLong Learning Institute, Singapore) at around 10.30 am and volunteers were all set to welcome us with smile and welcome kit :) Venue was awesome with multiple conf rooms and good facilities. Harish Pillay(Red Hat) & Damini Satya (SalesForce) Kicked off the event with Awesome Keynote with introducing FOSSASIA, stats about FOSSASIA and schedule as well. Followed by Keynote, Teo Ser Luck (Member of Parliament, Singapore) expressed his thoughts about OpenSource and how it is helping Singapore Governance and Economy. Now it was time for Diamler (Mercedes Benz) folks which was one the sponsors to Conference as well. They explained about how OpenSource is helping Mercedes to become Super Smart Car using technologies like containers, Kubernetes, OpenShift and BlockChain. Next Sponsor Keynote was by Google’s Kazunori Sato. it was about How Google Cloud is solving real life problems using AI/ML, it was quite interesting. There was Awesome Exhibition Area where all Sponsors had a booths and school students were demonstrating their exciting projects. I have written detail description of Exhibition Area at the end of this Blog. I met lots of people there including folks from platform.sh which provides PaaS platform, gstar.ai which is interesting startup which combines power of NLP (Natural Language Processing) and BlockChain. Day2 I attended talk by Jan Peuker (Google) which was about system as choreographed behaviour with Kubernetes, whereas he explained about Kubernetes works and he also talked about it’s relavance with Borg. At the end of the day, Sudhir Varma (Red Hat) about his work which is making easy Desktop Application easy with tools like DevSuite. During day 2, I met Chris from CNCF. I demoed Kedge, Kompsoe & Kubely to him. He was pretty impressed with projects. Also, I met a web developer. His perception was like, I am web developer, why should I care about containers. Then, I headed for the HonestBees Office (45 mins away from Conference venue) for Local Singapore Kubernetes Meetup. After having snacks, we started with meetup. MEETUP Seth Vargo (Google), started the first session of meetup with his talk, “Secret Management in Kubernetes using Vault” where he discussed about how we can effectively use vault for secrets in Kubernetes with cool demo. Me talked about Kedge, Kompose & My Personal project Kubely. People loved those project, there were some question as well about how we are reducing number of lines in Kedge without compromising on it’s Power. But what I understood, People are happy with Helm. Last session was by Michel Bright (Containous) about Traefik Proxy in Kubernetes. At the end, we took awesome group photo of all meetup attendees. Day3 At 12 pm, all conference attendees gathered at ground floor for group photo. Here’s one of the group photo: ...

March 31, 2018 · 4 min · Suraj Narwade

Mounting host folders in minishift

Make sure sshd service is running on your host. $ sudo systemctl status sshd ● sshd.service - OpenSSH server daemon Loaded: loaded (/usr/lib/systemd/system/sshd.service; disabled; vendor preset: disabled) Active: active (running) since Wed 2017-12-13 18:23:09 IST; 4min 14s ago Docs: man:sshd(8) man:sshd_config(5) Main PID: 11319 (sshd) Tasks: 1 (limit: 4915) Memory: 4.9M CPU: 333ms CGroup: /system.slice/sshd.service └─11319 /usr/sbin/sshd -D Dec 13 18:23:09 localhost.localdomain systemd[1]: Starting OpenSSH server daemon... Dec 13 18:23:09 localhost.localdomain sshd[11319]: Server listening on 0.0.0.0 port 22. Dec 13 18:23:09 localhost.localdomain sshd[11319]: Server listening on :: port 22. Dec 13 18:23:09 localhost.localdomain systemd[1]: Started OpenSSH server daemon. Create

December 13, 2017 · 1 min · Suraj Narwade

Mounting host folders in minikube

supports PV of type hostpath. minikube is configured to persist files stored under following directories. /data /var/lib/localkube /var/lib/docker /tmp/hostpath_pv /tmp/hostpath-provisioner any other directory will not persist the data after reboot. To mount host directory inside minikube, $ minikube mount /host-mount-path:/vm-mount-path for example, $ minikube mount ~/mount-dir:/mountexample Mounting /home/user/mount-dir/ into /mountexample on the minikubeVM This daemon process needs to stay alive for the mount to still be accessible... ufs starting This process has to stay open, so open another terminal (if you want more than one mountpath, open one more terminal follow the above procedure) ...

December 9, 2017 · 1 min · Suraj Narwade

How to split commits in git

I am very bad at git and I always forget the steps. It’s always better to write it somewhere. Then why not a blog ? To split your last or recent commit, simply do, $ git reset HEAD~ But I wanted to break 3rd commit and split it into two commits, then I did as following way, $ git rebase -i HEAD~3 if you dont know the number you can also mention SHA1 of that commit as well, ...

November 27, 2017 · 1 min · Suraj Narwade

Easter eggs in kubectl

I was watching video about kubectl by janakiram and surprising I found there is also world of commands rather than create, delete, get. kubectl has lots of interesting easter eggs. Some of the cool things I found as below, List pod along with node name on which they are running kubectl get pods -o wide If you want yaml or json configurations of your application(maybe pod,deployment or service,etc) kubectl get pod web -o=yaml/json CLI hacks to retrieve minimal information (In this case, pod name and node name) kubectl get pod -o wide | awk {'print $1" " $7'} | column -t you can directly edit configurations kubectl edit pod/web You can mention editor of your choice using KUBE_EDITOR variable, KUBE_EDITOR="sublime" kubectl edit pod/web If we want to get any specific thing from configurations kubectl get pods web -o jsonpath={.spec.containers[*].name} cordon will mark node as unschedulable kubectl cordon <ip-of-node> uncordon will mark node as schedulable again kubectl uncordon <ip-of-node> The given node will be marked unschedulable to prevent new pods from arriving. ‘drain’ evicts the pods . Otherwise, The ‘drain’ evicts or deletes all pods except replicationcontrollers pods, etc kubectl drain <node> Drain node “foo”, even if there are pods not managed by a ReplicationController, ReplicaSet, Job, DaemonSet or StatefulSet on it kubectl drain <node> --force Create proxy server between localhost and kubernetes API server kubectl proxy you can mention port of your choice as well, kubectl proxy --port=8000 We can forward local ports to pod (useful for debugging frontend application) kubectl port-forward <pod_name> <host_port>:<container_port> Copy files to and from container to our machine kubectl cp <file> <podname>:<path> Sometime you need shortcuts to increase your speed, productivity something like po for pods, deploy for deployments, you can find all shortcuts here, kubectl explain Thanks janakiram for awesome tutorial. ...

September 26, 2017 · 2 min · Suraj Narwade

Running static pod using standalone kubelet on fedora

Static Pods are managed by kubelet on specific minion. As they are not associated with any controller, APIServer has no control over it. One of the use case for static pod might be for storage like gluster on each minion or maybe for os level debugging on OS like atomic host. For testing it, I referred kelseyhightower’s standalone kubelet guide. To install kubelet, we can either download kubelet binary and set it up manually or we can get it from kubernetes-node package, ...

September 23, 2017 · 2 min · Suraj Narwade

Multistage build in Docker

Example Use Cases When might you want to use a multi-stage build? It allows you to do an entire pipeline within a single build, rather than having to script the pipeline externally. Here’s a few examples… Java apps using WAR files First stage uses a container with Maven to compile, test, and build the war file Second stage copies the built war file into an image with the app server (Wildfly, Tomcat, Jetty, etc.) Golang apps with standalone binaries ...

September 13, 2017 · 3 min · Suraj Narwade

Remove white noise from Videos

May times, We have to create demos for projects for which we use various desktop screen recorders along with normal earphones with mic for audio. But, It causes a lot of white/background noise in the video results into degraded video quality. Another case, where we record demos, talks from meetups. In this cases, we are not equipped with smart gadgets but only normal mic or mobile phone due to which lots of white noise occurs in a video. ...

July 23, 2017 · 2 min · Suraj Narwade