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

feat: add sync service #66

Closed
wants to merge 2 commits into from
Closed
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
6 changes: 3 additions & 3 deletions k8s/sidecar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ spec:
echo "redis-headless resolved."
containers:
- name: testground-sidecar
image: iptestground/sidecar:edge
image: iptestground/sidecar:no-redis
imagePullPolicy: Always
command: ["testground"]
args: ["sidecar", "--runner", "k8s"]
Expand All @@ -44,8 +44,8 @@ spec:
add: ["NET_ADMIN", "SYS_ADMIN", "SYS_TIME"]
privileged: true
env:
- name: REDIS_HOST
value: "testground-infra-redis-headless"
- name: SYNC_SERVICE_HOST
value: "testground-sync-service-headless"
- name: INFLUXDB_HOST
value: "influxdb"
ports:
Expand Down
6 changes: 4 additions & 2 deletions k8s/testground-daemon/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,13 @@ spec:
limits:
memory: 512Mi
- name: testground-daemon
image: iptestground/testground:edge
image: iptestground/testground:sync-service
imagePullPolicy: Always
env:
- name: REDIS_HOST
- name: REDIS_HOST # kept for compatibility with old SDKs
value: "testground-infra-redis-headless"
- name: SYNC_SERVICE_HOST
value: "testground-sync-service-headless"
securityContext:
privileged: true
ports:
Expand Down
14 changes: 14 additions & 0 deletions k8s/testground-daemon/sync-service-headless.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: testground-sync-service-headless
labels:
app: testground-sync-service-headless
spec:
clusterIP: None
ports:
- port: 5050
protocol: TCP
targetPort: 5050
selector:
app: testground-sync-service
31 changes: 31 additions & 0 deletions k8s/testground-daemon/sync-service.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: testground-sync-service
labels:
app: testground-sync-service
spec:
replicas: 1
selector:
matchLabels:
app: testground-sync-service
template:
metadata:
labels:
app: testground-sync-service
spec:
nodeSelector:
testground.node.role.infra: "true"
containers:
- name: testground-sync-service
image: iptestground/sync-service:no-redis
command: ["/service"]
env:
- name: DEBUG
value: "true"
ports:
- containerPort: 5050
resources:
requests:
cpu: 10m
memory: 12Mi
2 changes: 2 additions & 0 deletions k8s/tools/redeploy-daemon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ err_report() {
trap 'err_report $LINENO' ERR

kubectl delete deployment testground-daemon || true
kubectl delete deployment testground-sync-service || true
kubectl delete service testground-daemon || true
kubectl apply -f config-map-env-toml.yml
kubectl apply -f service-account.yml
kubectl apply -f role-binding.yml
kubectl apply -f deployment.yml -f service.yml
kubectl apply -f sync-service.yml -f sync-service-headless.yml