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

LoadBalancer experiments #41

Draft
wants to merge 2 commits into
base: k8s
Choose a base branch
from
Draft
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
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ jobs:
kubectl get services -o wide

- name: Run sanity checks
run: make sanity-checks
run: make kind-sanity

- name: Destroy Kind cluster
run: make kind-down
Expand Down
13 changes: 10 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@ tests: tests/*.py
online-tests: tests/*.py
$(PYTHON) -m pytest -raP tests/test_emitter_*.py

sanity-checks: PORT ?= 30000
sanity-checks:
for n in `seq 30`; do \
curl -s --fail http://localhost:30000/api/v1/version && exit 0 || sleep 1; \
curl -s --fail http://localhost:$(PORT)/api/v1/version && exit 0 || sleep 1; \
done; exit 1

stack-pull:
Expand Down Expand Up @@ -60,8 +61,14 @@ docker-push:
kind-up:
$(KIND) create cluster --config=etc/kind-config.yml
$(KIND) load docker-image geneve
kubectl apply -f etc/pods/geneve.yml
kubectl apply -f etc/services/geneve.yml
kubectl apply -f etc/k8s/geneve-cfg.yml
kubectl apply -f etc/k8s/geneve-pod.yml
kubectl apply -f etc/k8s/geneve-svc.yml

kind-sanity:
$(MAKE) sanity-checks PORT=30000
$(MAKE) sanity-checks PORT=30001
$(MAKE) sanity-checks PORT=30002

kind-down:
$(KIND) delete cluster
Expand Down
20 changes: 20 additions & 0 deletions etc/k8s/geneve-cfg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: geneve-linux
data:
rule-tags: linux
---
apiVersion: v1
kind: ConfigMap
metadata:
name: geneve-macos
data:
rule-tags: macos
---
apiVersion: v1
kind: ConfigMap
metadata:
name: geneve-windows
data:
rule-tags: windows
53 changes: 53 additions & 0 deletions etc/k8s/geneve-pod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
apiVersion: v1
kind: Pod
metadata:
name: geneve-linux
labels:
app: geneve-linux
spec:
containers:
- name: geneve
image: geneve
imagePullPolicy: Never
env:
- name: GENEVE_RULE_TAGS
valueFrom:
configMapKeyRef:
name: geneve-linux
key: rule-tags
---
apiVersion: v1
kind: Pod
metadata:
name: geneve-macos
labels:
app: geneve-macos
spec:
containers:
- name: geneve
image: geneve
imagePullPolicy: Never
env:
- name: GENEVE_RULE_TAGS
valueFrom:
configMapKeyRef:
name: geneve-macos
key: rule-tags
---
apiVersion: v1
kind: Pod
metadata:
name: geneve-windows
labels:
app: geneve-windows
spec:
containers:
- name: geneve
image: geneve
imagePullPolicy: Never
env:
- name: GENEVE_RULE_TAGS
valueFrom:
configMapKeyRef:
name: geneve-windows
key: rule-tags
35 changes: 35 additions & 0 deletions etc/k8s/geneve-svc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: v1
kind: Service
metadata:
name: geneve-linux
spec:
type: NodePort
selector:
app: geneve-linux
ports:
- port: 5000
nodePort: 30000
---
apiVersion: v1
kind: Service
metadata:
name: geneve-macos
spec:
type: NodePort
selector:
app: geneve-macos
ports:
- port: 5000
nodePort: 30001
---
apiVersion: v1
kind: Service
metadata:
name: geneve-windows
spec:
type: NodePort
selector:
app: geneve-windows
ports:
- port: 5000
nodePort: 30002
8 changes: 6 additions & 2 deletions etc/kind-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ kind: Cluster
nodes:
- role: control-plane
extraPortMappings:
- containerPort: 30000
hostPort: 30000
- containerPort: 30000
hostPort: 30000
- containerPort: 30001
hostPort: 30001
- containerPort: 30002
hostPort: 30002
- role: worker
- role: worker
11 changes: 0 additions & 11 deletions etc/pods/geneve.yml

This file was deleted.

11 changes: 0 additions & 11 deletions etc/services/geneve.yml

This file was deleted.