Skip to content

Instantly share code, notes, and snippets.

View theundefined's full-sized avatar

Andrzej Dopierała theundefined

View GitHub Profile
@theundefined
theundefined / HAProxy_and_K8s.md
Created June 14, 2017 06:45 — forked from suside/HAProxy_and_K8s.md
Kubernetes + HAProxy sticky session affinity

Kubernetes + HAProxy sticky session affinity

  1. Make sure you have balance source in haproxy.
  2. Backend server section in haproxy config should have all your k8s nodes.
  3. sessionAffinity in k8s is irrelevant.
  4. Exposed k8s service need to have nodePort set and this annotation:

kubectl annotate service myService service.beta.kubernetes.io/external-traffic=OnlyLocal

This will cause internal k8s loadbalancer on nodeⁿ to route traffic only to pod on nodeⁿ. From Haproxy point of view it will look like nodeⁿ:nodePort === pod on nodeⁿ:port thus disabling k8s LB completly.

@theundefined
theundefined / sourceforge.to.github.impor.markdown
Created May 7, 2017 21:48 — forked from binarytemple/sourceforge.to.github.impor.markdown
import a sourceforge project (with full history) to github

In order to clone the TVN application from sourceforge to github I performed the following steps.

rsync -av rsync://tnv.cvs.sourceforge.net/cvsroot/tnv/* .
svn export --username=guest http://cvs2svn.tigris.org/svn/cvs2svn/trunk cvs2svn-trunk
cp ./cvs2svn-trunk/cvs2git-example.options ./cvs2git.options
vim cvs2git.options
cvs2svn-trunk/cvs2git --options=cvs2git.options --fallback-encoding utf-8
git@github.com:binarytemple/tnv.git tnv-github
git clone git@github.com:binarytemple/tnv.git tnv-github