typhon: register app and add v2-safe ble/control runtime toggles

This commit is contained in:
Brad Stein 2026-04-13 22:02:57 -03:00
parent c573012a7c
commit 50a9bda808
4 changed files with 57 additions and 3 deletions

View File

@ -13,6 +13,7 @@ spec:
name: flux-system name: flux-system
targetNamespace: climate targetNamespace: climate
dependsOn: dependsOn:
- name: vault
- name: vault-csi - name: vault-csi
- name: monitoring - name: monitoring
healthChecks: healthChecks:

View File

@ -30,11 +30,36 @@ spec:
vault.hashicorp.com/agent-inject-secret-aci-env.sh: "kv/data/atlas/climate/typhon/ac-infinity" vault.hashicorp.com/agent-inject-secret-aci-env.sh: "kv/data/atlas/climate/typhon/ac-infinity"
vault.hashicorp.com/agent-inject-template-aci-env.sh: | vault.hashicorp.com/agent-inject-template-aci-env.sh: |
{{- with secret "kv/data/atlas/climate/typhon/ac-infinity" -}} {{- with secret "kv/data/atlas/climate/typhon/ac-infinity" -}}
export ACI_EMAIL="{{ .Data.data.ACI_EMAIL }}" {{- if index .Data.data "ACI_EMAIL" }}
export ACI_PASSWORD="{{ .Data.data.ACI_PASSWORD }}" export ACI_EMAIL="{{ index .Data.data "ACI_EMAIL" }}"
{{- end }}
{{- if index .Data.data "ACI_PASSWORD" }}
export ACI_PASSWORD="{{ index .Data.data "ACI_PASSWORD" }}"
{{- end }}
{{- if index .Data.data "ACI_HOST" }} {{- if index .Data.data "ACI_HOST" }}
export ACI_HOST="{{ index .Data.data "ACI_HOST" }}" export ACI_HOST="{{ index .Data.data "ACI_HOST" }}"
{{- end }} {{- end }}
{{- if index .Data.data "TYPHON_MODE" }}
export TYPHON_MODE="{{ index .Data.data "TYPHON_MODE" }}"
{{- end }}
{{- if index .Data.data "ENABLE_CONTROL_API" }}
export ENABLE_CONTROL_API="{{ index .Data.data "ENABLE_CONTROL_API" }}"
{{- end }}
{{- if index .Data.data "TY_BLE_DEFAULT_MAC" }}
export TY_BLE_DEFAULT_MAC="{{ index .Data.data "TY_BLE_DEFAULT_MAC" }}"
{{- end }}
{{- if index .Data.data "TY_BLE_ALLOWED_MACS" }}
export TY_BLE_ALLOWED_MACS="{{ index .Data.data "TY_BLE_ALLOWED_MACS" }}"
{{- end }}
{{- if index .Data.data "TY_BLE_DEVICE_TYPE" }}
export TY_BLE_DEVICE_TYPE="{{ index .Data.data "TY_BLE_DEVICE_TYPE" }}"
{{- end }}
{{- if index .Data.data "TY_BLE_SCAN_TIMEOUT_MS" }}
export TY_BLE_SCAN_TIMEOUT_MS="{{ index .Data.data "TY_BLE_SCAN_TIMEOUT_MS" }}"
{{- end }}
{{- if index .Data.data "TY_BLE_PORT_BASE" }}
export TY_BLE_PORT_BASE="{{ index .Data.data "TY_BLE_PORT_BASE" }}"
{{- end }}
{{- end -}} {{- end -}}
typhon.bstein.dev/restart-rev: "2" typhon.bstein.dev/restart-rev: "2"
spec: spec:
@ -52,20 +77,38 @@ spec:
args: args:
- | - |
set -eu set -eu
. /vault/secrets/aci-env.sh if [ -f /vault/secrets/aci-env.sh ]; then
. /vault/secrets/aci-env.sh
fi
: "${TYPHON_MODE:=cloud}"
: "${ENABLE_CONTROL_API:=false}"
exec node dist/index.js exec node dist/index.js
env: env:
- name: TYPHON_MODE
value: "cloud"
- name: ENABLE_CONTROL_API
value: "false"
- name: POLL_INTERVAL_SECONDS - name: POLL_INTERVAL_SECONDS
value: "30" value: "30"
- name: REQUEST_TIMEOUT_MS - name: REQUEST_TIMEOUT_MS
value: "10000" value: "10000"
- name: LISTEN_PORT - name: LISTEN_PORT
value: "9108" value: "9108"
- name: CONTROL_LISTEN_PORT
value: "9110"
- name: TY_BLE_DEVICE_TYPE
value: "11"
- name: TY_BLE_SCAN_TIMEOUT_MS
value: "20000"
- name: TY_BLE_PORT_BASE
value: "1"
- name: LOG_LEVEL - name: LOG_LEVEL
value: "info" value: "info"
ports: ports:
- name: metrics - name: metrics
containerPort: 9108 containerPort: 9108
- name: control
containerPort: 9110
volumeMounts: volumeMounts:
- name: tmp - name: tmp
mountPath: /tmp mountPath: /tmp

View File

@ -19,6 +19,13 @@ spec:
ports: ports:
- protocol: TCP - protocol: TCP
port: 9108 port: 9108
- from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: climate
ports:
- protocol: TCP
port: 9110
egress: egress:
- to: - to:
- namespaceSelector: - namespaceSelector:

View File

@ -16,3 +16,6 @@ spec:
- name: metrics - name: metrics
port: 9108 port: 9108
targetPort: metrics targetPort: metrics
- name: control
port: 9110
targetPort: control