From f55c117431ff76f5cd37fc5fce70c5027960b7ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrik=20Bostr=C3=B6m?= Date: Tue, 20 Oct 2020 17:25:14 +0200 Subject: [PATCH] [piaware] Added support for BEASTHOST and BEASTPORT (#93) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrik Boström --- charts/piaware/Chart.yaml | 2 +- charts/piaware/README.md | 19 +++++++++++++++++-- charts/piaware/templates/deployment.yaml | 14 ++++++++++++++ charts/piaware/values.yaml | 5 ++++- 4 files changed, 36 insertions(+), 4 deletions(-) diff --git a/charts/piaware/Chart.yaml b/charts/piaware/Chart.yaml index 696d5fc9..ee78d69d 100644 --- a/charts/piaware/Chart.yaml +++ b/charts/piaware/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 appVersion: v3.8.1 description: Program for forwarding ADS-B data to FlightAware name: piaware -version: 2.0.1 +version: 2.1.0 keywords: - piaware - flight-aware diff --git a/charts/piaware/README.md b/charts/piaware/README.md index a7a728a7..1f8d6585 100644 --- a/charts/piaware/README.md +++ b/charts/piaware/README.md @@ -17,6 +17,15 @@ To install the chart with the release name `my-release`: helm install --name my-release k8s-at-home/piaware ``` +### Configuration +There are two main options for this chart, either use a UBB device on the node where the pod runs or use +[readsb](https://hub.docker.com/r/mikenye/readsb) with beast + +#### USB +Set the value + + device: "/dev/bus/usb/001/004" + **IMPORTANT NOTE:** a flight-aware USB device must be accessible on the node where this pod runs, in order for this chart to function properly. A way to achieve this can be with nodeAffinity rules, for example: @@ -35,6 +44,12 @@ affinity: ... where a node with an attached flight-aware USB device is labeled with `app: flight-aware` +#### Beast +Use this together with the [readsb](https://hub.docker.com/r/mikenye/readsb) +Set the value + + beastHost: + ## Uninstalling the Chart To uninstall/delete the `my-release` deployment: @@ -53,12 +68,12 @@ Specify each parameter using the `--set key=value[,key=value]` argument to `helm ```console helm install --name my-release \ - --set rtspPassword="nosecrets" \ + --set feederId="nosecrets" \ k8s-at-home/piaware ``` Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart. For example, ```console -helm install --name my-release -f values.yaml stable/piaware +helm install --name my-release -f values.yaml k8s-at-home/piaware ``` diff --git a/charts/piaware/templates/deployment.yaml b/charts/piaware/templates/deployment.yaml index 3d999f08..09f56ffd 100644 --- a/charts/piaware/templates/deployment.yaml +++ b/charts/piaware/templates/deployment.yaml @@ -33,8 +33,10 @@ spec: - name: {{ .Chart.Name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- if .Values.device }} securityContext: privileged: true + {{- end }} ports: - name: http containerPort: 8080 @@ -56,15 +58,27 @@ spec: - name: FEEDER_ID value: "{{ .Values.feederId }}" {{- end }} + {{- if .Values.beastHost }} + - name: BEASTHOST + value: "{{ .Values.beastHost }}" + {{- end }} + {{- if .Values.beastPort }} + - name: BEASTPORT + value: "{{ .Values.beastPort }}" + {{- end }} + {{- if .Values.device }} volumeMounts: - mountPath: {{ .Values.device }} name: usb + {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} + {{- if .Values.device }} volumes: - name: usb hostPath: path: {{ .Values.device }} + {{- end }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} diff --git a/charts/piaware/values.yaml b/charts/piaware/values.yaml index 1a9c8244..98cc1653 100644 --- a/charts/piaware/values.yaml +++ b/charts/piaware/values.yaml @@ -21,7 +21,10 @@ image: # longitude: "30.66783" # device where the flight-aware device can be accessed -device: "/dev/bus/usb/001/004" +# device: "/dev/bus/usb/001/004" + +# beastHost: 10.0.1.88 +# beastPort: 30005 imagePullSecrets: [] nameOverride: ""