Kubereplay aims to make integration of Goreplay and Kubernetes as easy and automated as possible.
This is an early alpha version. It is not meant to run in production yet.
Kubereplay is a Kubernetes add-on to automate capturing and redirection of traffic using Goreplay. It consist of 2 parts that need to run in the cluster - controller and initializer.
Kubereplay creates and manages 2 CRDs: Harvesters and Refineries.
Refinery - is responsible for managing dedicated GoReplay deployment used for receiving data from workloads (harvesters). It listens to traffic on tcp socket and then sends it to configured output (stdout, elasticsearch, kafka, http).
Harvester - is used to configure which deployments should be controlled by Kubereplay. Based on selector in Harvester spec Kubereplay will add GoReplay-sidecar to matching deployments. More about initialization process is in the docs
# start minikube with Admission capabilities
$ minikube start --extra-config=apiserver.Admission.PluginNames="Initializers,NamespaceLifecycle,LimitRanger,ServiceAccount,DefaultStorageClass,ResourceQuota"
# start kubereplay controller manager in one console
$ go run cmd/controller-manager/main.go --kubeconfig=~/.kube/config
# start initializer controller in the second
$ go run cmd/initializer-controller/main.go --kubeconfig=~/.kube/config
# add initializer config
$ kubectl create -f sample/initializer-configuration.yaml
# create harvester, refinery and test deployment
$ kubectl create -f sample/harvester.yaml
$ kubectl create -f sample/refinery.yaml
$ kubectl create -f sample/echoserver.yaml
- Kubernetes v1.9+ with admission capabilities enabled.
The easiest way to deploy Kubereplay to a real cluster is by using Helm chart:
# add charts repository
$ helm repo add lwolf-charts https://charts.lwolf.org
# update the index if needed
$ helm repo update
# install
$ helm install lwolf-charts/kubereplay
If you encounter any issues while using Kubereplay, and your issue is not documented, please file an issue.
All kinds of contributions are very much welcome!
- Fork it
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Added some feature')
- Push to the branch (git push origin my-new-feature)
- Create new Pull Request
The list of releases is the best place to look for information on changes between releases.
If you're using kubereplay and want to support the development, buy me a beer at Beerpay!