kandi background
Explore Kits

goreplay | source tool for capturing and replaying live HTTP traffic | Monitoring library

 by   buger Go Version: v2.0.0-rc2 License: Non-SPDX

 by   buger Go Version: v2.0.0-rc2 License: Non-SPDX

Download this library from

kandi X-RAY | goreplay Summary

goreplay is a Go library typically used in Performance Management, Monitoring applications. goreplay has no bugs, it has no vulnerabilities and it has medium support. However goreplay has a Non-SPDX License. You can download it from GitHub.
As your application grows, the effort required to test it also grows exponentially. GoReplay offers you the simple idea of reusing your existing traffic for testing, which makes it incredibly powerful. Our state of art technique allows you to analyze and record your application traffic without affecting it. This eliminates the risks that come with putting a third party component in the critical path. GoReplay increases your confidence in code deployments, configuration and infrastructure changes. GoReplay offers a unique approach for shadowing. Instead of being a proxy, GoReplay listens in the background for traffic on your network interfaces, requiring no changes in your production infrastructure, other than running GoReplay daemon on the same machine as your service.
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • goreplay has a medium active ecosystem.
  • It has 15413 star(s) with 1576 fork(s). There are 465 watchers for this library.
  • There were 3 major release(s) in the last 12 months.
  • There are 232 open issues and 439 have been closed. On average issues are closed in 107 days. There are 18 open pull requests and 0 closed requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of goreplay is v2.0.0-rc2
goreplay Support
Best in #Monitoring
Average in #Monitoring
goreplay Support
Best in #Monitoring
Average in #Monitoring

quality kandi Quality

  • goreplay has 0 bugs and 0 code smells.
goreplay Quality
Best in #Monitoring
Average in #Monitoring
goreplay Quality
Best in #Monitoring
Average in #Monitoring

securitySecurity

  • goreplay has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • goreplay code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
goreplay Security
Best in #Monitoring
Average in #Monitoring
goreplay Security
Best in #Monitoring
Average in #Monitoring

license License

  • goreplay has a Non-SPDX License.
  • Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.
goreplay License
Best in #Monitoring
Average in #Monitoring
goreplay License
Best in #Monitoring
Average in #Monitoring

buildReuse

  • goreplay releases are available to install and integrate.
  • Installation instructions are available. Examples and code snippets are not available.
  • It has 13375 lines of code, 498 functions and 89 files.
  • It has high code complexity. Code complexity directly impacts maintainability of the code.
goreplay Reuse
Best in #Monitoring
Average in #Monitoring
goreplay Reuse
Best in #Monitoring
Average in #Monitoring
Top functions reviewed by kandi - BETA

Coming Soon for all Libraries!

Currently covering the most popular Java, JavaScript and Python libraries. See a SAMPLE HERE.
kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.

goreplay Key Features

GoReplay is an open-source tool for capturing and replaying live HTTP traffic into a test environment in order to continuously test your system with real data. It can be used to increase confidence in code deployments, configuration changes and infrastructure changes.

i can't presist data in kubernetes volumes

copy iconCopydownload iconDownload
kubectl exec -it goreplay-deployment-899c49f95-7qdh4 -c goreplay sh
/home/goreplay # ps auxwf
PID   USER     TIME  COMMAND
    1 root      0:00 ./gor --input-raw :3000 --output-file=requests_docker.gor
   36 root      0:00 sh
   42 root      0:00 ps auxwf
/home/goreplay # ls /proc/1/cwd -l
lrwxrwxrwx    1 root     root             0 Feb 19 09:44 /proc/1/cwd -> /home/goreplay
--output-file=/var/lib/gorepath/requests_docker.gor
--input-file=/var/lib/goreplay/requests_docker_0.gor`
-----------------------
kubectl exec -it goreplay-deployment-899c49f95-7qdh4 -c goreplay sh
/home/goreplay # ps auxwf
PID   USER     TIME  COMMAND
    1 root      0:00 ./gor --input-raw :3000 --output-file=requests_docker.gor
   36 root      0:00 sh
   42 root      0:00 ps auxwf
/home/goreplay # ls /proc/1/cwd -l
lrwxrwxrwx    1 root     root             0 Feb 19 09:44 /proc/1/cwd -> /home/goreplay
--output-file=/var/lib/gorepath/requests_docker.gor
--input-file=/var/lib/goreplay/requests_docker_0.gor`
-----------------------
kubectl exec -it goreplay-deployment-899c49f95-7qdh4 -c goreplay sh
/home/goreplay # ps auxwf
PID   USER     TIME  COMMAND
    1 root      0:00 ./gor --input-raw :3000 --output-file=requests_docker.gor
   36 root      0:00 sh
   42 root      0:00 ps auxwf
/home/goreplay # ls /proc/1/cwd -l
lrwxrwxrwx    1 root     root             0 Feb 19 09:44 /proc/1/cwd -> /home/goreplay
--output-file=/var/lib/gorepath/requests_docker.gor
--input-file=/var/lib/goreplay/requests_docker_0.gor`

i can't connect to pods in kubernetes

copy iconCopydownload iconDownload
args:
  - "--input-raw"
  - ":3000"
  - "--output-http=http://service-server.default:3200"
      
      

iptables in kuberntes init container does't work

copy iconCopydownload iconDownload
initContainers:
    - command: 
      - iptables
      args:
      - -t 
      - nat
      - -A
      - PREROUTING
      - -p
      - tcp
      - --dport
      - "80"
      - -j
      - REDIRECT
      - --to-ports
      - "15001"
      image: soarinferret/iptablesproxy
      imagePullPolicy: IfNotPresent
      name: istio-init
      resources:
        limits:
          cpu: 100m
          memory: 50Mi
        requests:
          cpu: 10m
          memory: 10Mi
      securityContext:
        allowPrivilegeEscalation: false
        capabilities:
          add:
          - NET_ADMIN
          - NET_RAW
          drop:
          - ALL
        privileged: true   <---- changed from false
        readOnlyRootFilesystem: false
        runAsGroup: 0
        runAsNonRoot: false
        runAsUser: 0
      terminationMessagePath: /dev/termination-log
      terminationMessagePolicy: File 

Community Discussions

Trending Discussions on goreplay
  • i can't presist data in kubernetes volumes
  • i can't connect to pods in kubernetes
  • iptables in kuberntes init container does't work
Trending Discussions on goreplay

QUESTION

i can't presist data in kubernetes volumes

Asked 2021-Feb-19 at 10:03

i have an application that record live traffic and replay them.

https://github.com/buger/goreplay

it is a simple app to use, but when i tried to use it with kubernetes i get a problem with persisting data in volumes.

i want to do this :

  • in pod number one i use the goreplay container and other container that just have a simple python server... the job is the goreplay will listen to the requests coming from outside to the server and save them to a file , this is the deployment file :
apiVersion: apps/v1
kind: Deployment
metadata:
  name: goreplay-deployment
  labels:
        app: goreplay-app
spec:
  replicas: 1
  selector:
    matchLabels:
      app: goreplay-app
  template:
    metadata:
      labels:
        app: goreplay-app
    spec:
      containers:
      - name: goreplay
        image: feiznouri/goreplay:2.0
        args:
          - "--input-raw"
          - ":3000"
          - "--output-file=requests_docker.gor"
        volumeMounts:
          - name: data
            mountPath: /var/lib/goreplay
      - name: myserver
        image: feiznouri/python-server:1.1
        args:
          - "3000"
        ports:
        - name: server-port
          containerPort: 3000
      volumes:
      - name: data
        persistentVolumeClaim:
          claimName: goreplay-claim

normally this will create the file.

the prblem is that when i delete the deployment, and create one that it's job is to read the file and forward the saving request to a server, it can't find the file , clearly i am using the volumes wrong , this is the second deployment that suppose to find and read the file :

apiVersion: apps/v1
kind: Deployment
metadata:
  name: goreplay-deployment
  labels:
        app: goreplay-app
spec:
  replicas: 1
  selector:
    matchLabels:
      app: goreplay-app
  template:
    metadata:
      labels:
        app: goreplay-app
    spec:
      containers:
      - name: goreplay
        image: feiznouri/goreplay:2.0
        args:
          - "--input-file"
          - "requests_docker_0.gor"
          - "--output-http=http://localhost:3000"
        volumeMounts:
          - name: data
            mountPath: /var/lib/goreplay
      - name: myserver
        image: feiznouri/python-server:1.1
        args:
          - "3000"
        ports:
        - name: server-port
          containerPort: 3000
      volumes:
      - name: data
        persistentVolumeClaim:
          claimName: goreplay-claim

PS: this is the yaml file for the persistent volume :

apiVersion: v1
kind: PersistentVolume
metadata:
  name: goreplay-volume
  labels:
    type: local
spec:
  storageClassName: custum
  capacity:
    storage: 1Gi
  accessModes:
    - ReadWriteMany
  hostPath:
    path: "/mnt/data"

and this the file for the storage class :

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: custom
provisioner: k8s.io/minikube-hostpath
reclaimPolicy: Retain
volumeBindingMode: Immediate

and this for the persistent volume claim :

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: goreplay-claim
spec:
  storageClassName: custum
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 50Mi

how can i make this work and find and use the first file that i created in the second pod !

thank you in advance.

ANSWER

Answered 2021-Feb-19 at 10:03

I replicated it and it looks like the volumes are fine.

What is not fine, is how you pass file paths to goreplay.

Here is what I did:

kubectl exec -it goreplay-deployment-899c49f95-7qdh4 -c goreplay sh
/home/goreplay # ps auxwf
PID   USER     TIME  COMMAND
    1 root      0:00 ./gor --input-raw :3000 --output-file=requests_docker.gor
   36 root      0:00 sh
   42 root      0:00 ps auxwf
/home/goreplay # ls /proc/1/cwd -l
lrwxrwxrwx    1 root     root             0 Feb 19 09:44 /proc/1/cwd -> /home/goreplay

Let me explain what you see here. I execed into goreplay container and checked the PID of goreplay process (PID=1). Next, I checked what is this process's current working directory by checking the /proc/1/cwd symlink. As you see it's symlinked to /home/goreplay.

What does it tell us?

It tells us that --output-file=requests_docker.gor is making goreplay to save the file in /home/goreplay/requests_docker.gor (since you are specifying path relative to process's current working dir instead of using absolute path pointing to volume). It should be set to:

--output-file=/var/lib/gorepath/requests_docker.gor

since it's the directory where the volume is mounted.


Same applies to the second deployment. You should specify:

--input-file=/var/lib/goreplay/requests_docker_0.gor`

so that it reads from the volume and not from the pod's home directory (/home/goreplay).


Change it and it should work.

Source https://stackoverflow.com/questions/66251441

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

Vulnerabilities

No vulnerabilities reported

Install goreplay

Download the latest binary from https://github.com/buger/goreplay/releases or compile by yourself.
The most basic setup will be sudo ./gor --input-raw :8000 --output-stdout which acts like tcpdump. If you already have a test environment, you can start replaying by running: sudo ./gor --input-raw :8000 --output-http http://staging.env. See our documentation and the Getting Started page for more info.

Support

Fork itCreate 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

DOWNLOAD this Library from

Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

Explore Related Topics

Share this Page

share link
Consider Popular Monitoring Libraries
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

  • © 2022 Open Weaver Inc.