Kubernetes Pune Meetup - July 2017

It was beautiful Saturday morning and we were at yet another chapter of kubernetes Pune meetup. Meetup had a good turnaround of about 30 people, even it was the weekend. Harshal Shah started the Session on “Lifecycle of a Pod”, where he explained in detail about various states of pods, liveness and readiness probes as well as restart policies. That was really helpful as we get to know what actually happens to pod while deploying and undeploying the application. ...

July 10, 2017 Â· 3 min Â· Suraj Narwade

tools to adopt best practices in golang

I went through internet yesterday regarding best practices with golang, I found go-tools written by Dominik Honnef which were pretty interesting and can be . I found some of them useful for me, so are they listed below. static check applies tons of static analysis checks. it needs go 1.6 or later, go get honnef.co/go/tools/cmd/staticcheck syntax is: $ statickcheck [pkg] or [directory] I tried it for kompose with some extra hacks: $ for pkg in $(go list -f '{{ join .Deps "\n"}}' . | grep 'kompose/[^vendor]'); do staticcheck "$pkg"; done cmd/completion.go:48:2: empty branch (SA9003) pkg/transformer/kubernetes/kubernetes_test.go:71:6: identical expressions on the left and right side of the '!=' operator (SA4000) gosimple it gives suggestions for simplifying your code. ...

July 6, 2017 Â· 2 min Â· Suraj Narwade

Golang workaround for cannot assign to struct field in map

Yesterday, I was working one of the Kompose issue, and I was working on map of string to struct, while iterating over a map I wanted to change elements of struct, so I tried similar to this, package main import "fmt" type Animal struct { count int } func main() { m := map[string]Animal{"cat": Animal{2}, "dog": Animal{3}, "mouse": Animal{5}} fmt.Println(m) m["dog"].count = 4 fmt.Println(m) } so I got this error, tmp/sandbox728133053/main.go:12: cannot assign to struct field m["dog"].count in map After googling for some time, I found this solution and I tried & it worked as below: ...

May 28, 2017 Â· 1 min Â· Suraj Narwade

The GO Workshop by Baiju

A golang hands-on workshop was organized under meetup group Practical Data Science on May 6th, 2017. It was run up event for Devconf India 2017. Around 60 people turned up. Baiju’s, who was workshop instructor, started with introduction of golang. He carried audience through the setup of golang SDK, basic golang semantics, datatypes, control structures, concurrency and other advanced constructs. Workshop course material can be found here. Me(SurajN), SurajD and Zeeshan volunteered for the event. We helped attendees for installing golang and also helped them while they were solving exercises given by Baiju. ...

May 7, 2017 Â· 1 min Â· Suraj Narwade

What's new in Docker ?

Recently, I installed latest docker on my machine. But I noticed lots of new features, commands and aliases to the existing commands and felt it was worth posting. Docker version that I installed is 17.03.0-ce, Click here to know how to install Docker As we can see in docker help, commands are grouped as management commands under names like container, network, image, etc as per their purpose. $ docker --help Usage: docker COMMAND A self-sufficient runtime for containers ... ... Management Commands: container Manage containers image Manage images network Manage networks node Manage Swarm nodes plugin Manage plugins secret Manage Docker secrets service Manage services stack Manage Docker stacks swarm Manage Swarm system Manage Docker volume Manage volumes Commands: ... ... Run 'docker COMMAND --help' for more information on a command. For example, Under docker container, all commands related to managing to containers are classified. $ docker container --help Usage: docker container COMMAND Manage containers Options: --help Print usage Commands: attach Attach to a running container commit Create a new image from a container's changes cp Copy files/folders between a container and the local filesystem create Create a new container ... ... wait Block until one or more containers stop, then print their exit codes Run 'docker container COMMAND --help' for more information on a command. There is new feature here, which makes plugin management in docker easier, now we can easily install or delete or get information about plugins. $ docker plugin --help Usage: docker plugin COMMAND Manage plugins Options: --help Print usage Commands: create Create a plugin from a rootfs and configuration. Plugin data directory must contain config.json and rootfs directory. disable Disable a plugin enable Enable a plugin inspect Display detailed information on one or more plugins install Install a plugin ls List plugins push Push a plugin to a registry rm Remove one or more plugins set Change settings for a plugin upgrade Upgrade an existing plugin New Aliases: docker container ls is same as docker ps $ docker container ls -a CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 66d17f3bc07e hello-world "/hello" About a minute ago Exited (0) About a minute ago ecstatic_lamarr docker image ls is same as docker images # docker image ls REPOSITORY TAG IMAGE ID CREATED SIZE fedora latest 0047cca29c6f 5 days ago 230 MB hello-world latest 48b5124b2768 2 months ago 1.84 kB New docker system command added: docker system df - Show docker disk Usage # docker system df TYPE TOTAL ACTIVE SIZE RECLAIMABLE Images 1 0 1.84 kB 1.84 kB (100%) Containers 0 0 0 B 0 B Local Volumes 0 0 0 B 0 B docker system events - Get real time events (like oc get events in openshift) ...

March 21, 2017 Â· 3 min Â· Suraj Narwade

Migration to Hugo

Hello guys, its been so long, I havn’t written any post. Recently, I have migrated my blog from Pelican(python based static site generator) to Hugo(GO based static site generator). Today, I will write about it. You can explore my blog at surajnarwade.github.io Installing Hugo . Install hugo $ go get -v github.com/spf13/hugo Check whether it is properly installed or not $ hugo help Using Hugo . We need to tell hugo to generate blog skeleton, type following command for that: $ hugo new site myblog myblog directory will be created, checkout into directory: $ cd myblog $ tree . ├── archetypes ├── config.toml ├── content ├── data ├── layouts ├── static └── themes Now its time to write to post. following command will create a post with predefined skeleton. you can create your own archtypes for this. Edit the post with markdown syntax. Click here for markdown cheatsheet. $ hugo new post/good-to-great.md Compile the blog using following command and our website will be generated under public/ directory. $ hugo Hugo comes with server while reloads your browser live as soon as there’s change in a file so, you will get a instant feedback. $ hugo server ... .... Watching for changes in /home/snarwade/myblog/{data,content,layouts,static,themes} Serving pages from memory Web Server is available at http://localhost:1313/ (bind address 127.0.0.1) Press Ctrl+C to stop Now Open localhost:1313 on your browser to see the website. you can make changes to blogpost file to see live changes. ...

March 13, 2017 Â· 3 min Â· Suraj Narwade

How to install OpenStack-packstack from source and test individual patches locally!

Yesterday I was reading about magnum component in OpenStack, then I checked with installing OpenStack Newton by following RDO doc. but it seems that, packstack answer file is not ready with magnum component yet. but fortunately, I found a patch https://review.openstack.org/#/c/360388/ about adding magnum deployment in packstack, so I decided to test this patch via installing openstack-packstack through source as per discussion with Chandan Kumar and Javier Peña have used centos 7 box for this purpose. Installation ...

November 3, 2016 Â· 2 min Â· Suraj Narwade

PyCon India 2016 - Weekend I’ll never forget

Woo! It was so exciting, because It was my First [PyCon]( https://in.pycon.org/2016/`_) ,First conference, First flight and First time Delhi. Was so excited to meet all new people who were known over IRC,dgplug and social media volunteer(PyCon) only. We landed in the capital city at around 2 am in the morning (terrible experience in Indigo flight) . Then, we went to our Stay point Mulberry house (one of my memorable places in Delhi) :P Day1 ...

October 3, 2016 Â· 4 min Â· Suraj Narwade

It's our time Now !!! PythonPune July Meetup

Python Pune July Meetup was held at Red Hat, Pune on 30th July 2016, this meetup was quite different than previous meetups because talks were given by Interns. Around 40 pythonistas were present for meetups, some were students and some were professionals. Topics for the meetup were as below: How do I automate boring stuff using Python? by Suraj Narwade Writing unit tests for any Python Script by Sudhir Verma Static v/s Dynamically typed languages by Ganesh Kadam Regular Expressions in Python by Rahul Bajaj Meetup started with Rahul Bajaj’s topic regarding Regular Expressions. He explained about regex, it’s requirement,how to use it along with simple examples. Click here for Rahul’s slides ...

August 1, 2016 Â· 2 min Â· Suraj Narwade

Jenkins Docker Integration along with Fedora Contribution

Hello Everyone, From Past few days, I was studying Jenkins, have read VMs or cloud instances can be provisioned as the slave for Jenkins, I thought it would be awesome to have more generic setup. So I dig more into the web and found Jenkins Docker Plugin. so that we can provision Jenkins slave on Docker host. and this Docker host can be anywhere on any machine or any cloud instance.I have experimented it and I managed to contributr Jenkins fedora slave image to Fedora Cloud, https://github.com/fedora-cloud/Fedora-Dockerfiles/tree/master/jenkins-slave Few Reasons for Container based slaves: ...

July 11, 2016 Â· 2 min Â· Suraj Narwade