Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor k8s manifest files and add dns policy for daemonset #1233

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions k8s/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,23 @@ Following format supported:
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: goreplay-daemon
name: goreplay-daemon
spec:
  template:
    spec:
selector:
matchLabels:
name: goreplay-daemon
template:
metadata:
labels:
name: goreplay-daemon
spec:
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
serviceAccountName: goreplay
      containers:
      - name: goreplay
        image: buger/goreplay:2.0.0-rc2
containers:
- name: goreplay
imagePullPolicy: Always
image: buger/goreplay:2.0.0-rc2
command:
- "--input-raw k8s://deployments/nginx:80"
- "--output-stdout"
Expand Down Expand Up @@ -122,7 +130,7 @@ spec:
apiVersion: v1
kind: Service
metadata:
name: ngnix-service
name: nginx-service
spec:
selector:
app: nginx
Expand All @@ -141,4 +149,3 @@ Find url for your service using `kubectl get svc` or `minikube service --url ngn

Get GoReplay logs, and check if it capture traffic of your service.
`kubectl logs -n goreplay -l name=goreplay-daemon --all-containers`

2 changes: 1 addition & 1 deletion k8s/clusterrole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ rules:
verbs: ["get", "watch", "list"]
- apiGroups: ["apps"]
resources: ["daemonsets"]
verbs: ["get", "watch", "list"]
verbs: ["get", "watch", "list"]
22 changes: 15 additions & 7 deletions k8s/goreplay.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: goreplay-daemon
name: goreplay-daemon
spec:
  template:
    spec:
selector:
matchLabels:
name: goreplay-daemon
template:
metadata:
labels:
name: goreplay-daemon
spec:
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet # For replaying to local dns eg. --output-http http://nginx-service.goreplay.svc.cluster.local:80
serviceAccountName: goreplay
      containers:
      - name: goreplay
        image: buger/goreplay:2.0.0-rc2
containers:
- name: goreplay
imagePullPolicy: Always
image: buger/goreplay:2.0.0-rc2
command:
- "--input-raw k8s://deployments/nginx:80"
- "--output-stdout"
- "--output-stdout"
3 changes: 1 addition & 2 deletions k8s/nginx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spec:
apiVersion: v1
kind: Service
metadata:
name: ngnix-service
name: nginx-service
spec:
selector:
app: nginx
Expand All @@ -33,4 +33,3 @@ spec:
- protocol: TCP
port: 80
targetPort: 80