Jenkins is a powerful automation tool, it provides hundreds of plugins to support building, deploying and automating any project. So does for Go! I would like to follow an example of creating a task for CoreDNS to illustrate what should be paid attention to. This is a basic tutorial for beginners that starts from setting up a new Jenkins service from scratch.

Prometheus natively supports pull model, but there’s a long discussion for Prometheus between pull and push, e.g. Pull doesn’t scale - or does it?. In this post it gives detailed pros and cons. Considering that we prefer not to expose an extra HTTP endpoint for each worker node, we would like to take some walk around to implement a push based monitoring with node_exporter, pushgateway and prometheus.

I used to create a shell script to start a service if I have to pass arguments to the binary, since it does not support command line arguments in the field ExecStart in service file.

I worked well except that when I tried to restart a web server with systemctl restart XXX.service, it failed to listen on the port as the port was being used by another process. That was wired because that port was used by the web server right before I restarted the service. I checked the port state by using netstat -nalp, found that it was actually being listened by the web server. I did run restart and I was pretty sure the service is down because its status is inactive.

It’s a common case to download a file with full size, but what if we want to download only the first few bytes of the file? For example if we want to check the file header or to check the file existence.

Should we download file to buffer and copy it to local disk by counting bytes? No, Go offers a super easy function to handle this, io.Copy().