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

planes-test: gdb on planes-test-0 #15

Open
wants to merge 4 commits into
base: main
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
10 changes: 4 additions & 6 deletions bases/readsb/redux/readsb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ spec:
spec:
volumes:
- name: run
emptyDir: {}
emptyDir:
medium: Memory
- name: serve-run-http-config
configMap:
name: serve-run-http-config
Expand All @@ -20,22 +21,19 @@ spec:
resources:
limits:
cpu: "1"
memory: 512Mi
memory: 768Mi
requests:
cpu: 100m
memory: 128Mi
memory: 256Mi
startupProbe:
tcpSocket:
port: 30004
initialDelaySeconds: 15
livenessProbe:
tcpSocket:
port: 30004
initialDelaySeconds: 15
readinessProbe:
tcpSocket:
port: 30004
initialDelaySeconds: 15
ports:
- containerPort: 30004
name: adsb-in
Expand Down
2 changes: 1 addition & 1 deletion manifests/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ images:
- name: ghcr.io/adsblol/mlat-server-sync-map
newTag: master-413c02fc-1675794709 # {"$imagepolicy": "adsblol:mlat-server-sync-map:tag"}
- name: ghcr.io/katlol/readsb
newTag: 3ef880844dde1a18d5b053cb0775064083171f93
newTag: dev
53 changes: 37 additions & 16 deletions manifests/default/planes/test/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ configMapGenerator:
literals:
- config.js=PageName = "ADSB.lol - Open Source ADSB/MLAT aggregator."; BingMapsAPIKey = "AqCdYNFHcAZuy4k9zT_UXZMdfSo5zN-mImkwN6PzcXNYyo0bYHaHik2F8qg-h1c1"; shareBaseUrl = "https://test.adsb.lol";MapType_tar1090="osm";
- globeRates.json={"refresh:" 500}

- name: mount-run
files:
- run.sh
patches:
- target:
kind: Deployment
Expand All @@ -27,6 +29,7 @@ patches:
- op: add
path: /spec/template/spec/containers/0/command
value:
- /mount-run/run.sh
- /usr/local/bin/readsb
- --net
- --quiet
Expand All @@ -44,7 +47,7 @@ patches:
- --net-json-port=30047
- --net-api-port=30152
- --net-sbs-in-port=32006
- --net-connector=hub-readsb,30006,beast_in
- --net-connector=hub-readsb,30005,beast_in
- --net-connector=mlat-mlat-server,30104,sbs_in_mlat
- --debug=nS
- --net-receiver-id
Expand Down Expand Up @@ -104,23 +107,41 @@ patches:
requests:
storage: 10Gi
# Add another volumeClaimTemplate for run-readsb (remove & add to avoid index 0)
- op: remove
path: /spec/template/spec/volumes/0
- op: add
path: /spec/volumeClaimTemplates/-
value:
metadata:
name: run
spec:
storageClassName: nfs-provisioner
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
- op: add
path: /spec/template/spec/volumes/-
value:
name: html-overlay
configMap:
name: html-overlay
# Add mount-run
- op: add
path: /spec/template/spec/volumes/-
value:
name: mount-run
configMap:
name: mount-run
defaultMode: 0755
# Add volumeMount for container 0 for mount-run/run.sh
- op: add
path: /spec/template/spec/containers/0/volumeMounts/-
value:
name: mount-run
mountPath: /mount-run/run.sh
subPath: run.sh
- op: add
path: /spec/template/spec/containers/0/resources/limits/memory
value: 1500Mi
# add stdin/tty to the container
- op: add
path: /spec/template/spec/containers/0/stdin
value: true
- op: add
path: /spec/template/spec/containers/0/tty
value: true
# UpdateStrategy
- op: add
path: /spec/updateStrategy
value:
type: RollingUpdate
rollingUpdate:
partition: 0
8 changes: 8 additions & 0 deletions manifests/default/planes/test/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
set -ex

if [ "$HOSTNAME" = planes-readsb-test-0 ]; then
exec gdb -ex="set breakpoint pending on" -ex="break exit" -ex="break _exit" -ex=run --args $*
else
exec $*
fi
44 changes: 34 additions & 10 deletions manifests/default/resources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ metadata:
name: globe-reapi
annotations:
external-dns.alpha.kubernetes.io/cloudflare-proxied: "true"
# nginx.ingress.kubernetes.io/affinity: "cookie"
# nginx.ingress.kubernetes.io/session-cookie-name: "globe-reapi-sticky"
# nginx.ingress.kubernetes.io/session-cookie-max-age: "86400"
nginx.ingress.kubernetes.io/affinity: "cookie"
nginx.ingress.kubernetes.io/session-cookie-name: "globe-reapi-sticky"
nginx.ingress.kubernetes.io/session-cookie-max-age: "86400"
spec:
tls:
- hosts:
Expand All @@ -130,7 +130,7 @@ spec:
pathType: Prefix
backend:
service:
name: planes-readsb
name: planes-readsb-test
port:
name: http-api
- host: test.adsb.lol
Expand All @@ -140,7 +140,7 @@ spec:
pathType: Prefix
backend:
service:
name: planes-readsb-test
name: planes-readsb
port:
name: http-api
---
Expand All @@ -149,11 +149,11 @@ apiVersion: networking.k8s.io/v1
metadata:
name: tar1090
annotations:
nginx.ingress.kubernetes.io/affinity: "cookie"
nginx.ingress.kubernetes.io/session-cookie-name: "tar1090-sticky"
nginx.ingress.kubernetes.io/session-cookie-max-age: "86400"
external-dns.alpha.kubernetes.io/cloudflare-proxied: "true"
nginx.ingress.kubernetes.io/configuration-snippet: |
location /graphs1090 {
return 302 https://grafana.adsb.lol/public-dashboards/4fcdab6726f34960b73be95ecb74386e;
}
location /globeRates.json { return 200 "{\"refresh\": 500}" ;}
spec:
tls:
Expand All @@ -168,7 +168,7 @@ spec:
pathType: Prefix
backend:
service:
name: planes-readsb
name: planes-readsb-test
port:
name: http
- host: test.adsb.lol
Expand All @@ -178,7 +178,7 @@ spec:
pathType: Prefix
backend:
service:
name: planes-readsb-test
name: planes-readsb
port:
name: http
---
Expand Down Expand Up @@ -295,6 +295,30 @@ spec:
port:
name: http
---
kind: Ingress
apiVersion: networking.k8s.io/v1
metadata:
name: re-api
annotations:
external-dns.alpha.kubernetes.io/cloudflare-proxied: "true"
spec:
tls:
- hosts:
- adsb.lol
secretName: adsblol-tls
rules:
- host: re-api.adsb.lol
http:
paths:
- path: /re-api/
pathType: Prefix
backend:
service:
name: reapi-readsb
port:
name: http-api

---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
Expand Down