feat: add alexa-bridge deployment, service, and TLS certificate for mTLS communication
Some checks failed
validate / lint (push) Failing after 5s

This commit is contained in:
Nik Afiq 2026-07-26 00:51:01 +09:00
parent 710f3be427
commit f3cef5cd1d
3 changed files with 147 additions and 0 deletions

View File

@ -0,0 +1,38 @@
# Apply: kubectl apply -f manifests/home-services/alexa-bridge-public-ingress.yaml
# Delete: kubectl delete -f manifests/home-services/alexa-bridge-public-ingress.yaml
# Description: Let's Encrypt TLS certificate and public IngressRoute for
# alexa-bridge at alexa-bridge.nik4nao.com, so Alexa's servers can reach the
# skill endpoint over the internet. This is a separate cert/issuer from
# alexa-bridge-tls in certs.yaml - that one is the internal-ca-issuer client
# cert alexa-bridge uses to dial ha-gateway over mTLS; this one is the
# publicly-trusted cert Alexa itself requires for the inbound leg. Modeled
# directly on manifests/gitea/gitea-public-ingress.yaml's shape.
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: alexa-bridge-nik4nao-tls
namespace: home-services
spec:
secretName: alexa-bridge-nik4nao-tls
issuerRef:
name: letsencrypt-prod
kind: ClusterIssuer
dnsNames:
- alexa-bridge.nik4nao.com
---
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: alexa-bridge-public
namespace: home-services
spec:
entryPoints:
- websecure
routes:
- match: Host(`alexa-bridge.nik4nao.com`)
kind: Rule
services:
- name: alexa-bridge
port: 8080
tls:
secretName: alexa-bridge-nik4nao-tls

View File

@ -0,0 +1,86 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: alexa-bridge
namespace: home-services
labels:
app: alexa-bridge
spec:
replicas: 1
selector:
matchLabels:
app: alexa-bridge
template:
metadata:
labels:
app: alexa-bridge
spec:
imagePullSecrets:
- name: gitea-registry-secret
containers:
- name: alexa-bridge
image: gitea.nik4nao.com/nik/alexa-bridge:latest
ports:
- containerPort: 8080
name: http
env:
- name: HTTP_PORT
value: "8080"
# TODO: replace with the real skill ID once the Alexa Custom
# Skill is registered in the developer console (see
# alexa-bridge/plan.md's "Decisions on open questions" #4/#2).
- name: ALEXA_SKILL_ID
value: "amzn1.ask.skill.REPLACE_ME"
- name: HA_GATEWAY_ADDR
value: "ha-gateway.home-services.svc.cluster.local:50051"
- name: HA_GATEWAY_SERVER_NAME
value: "ha-gateway.home-services.svc.cluster.local"
- name: ENTITY_REFRESH_INTERVAL
value: "5m"
- name: OTEL_ENDPOINT
value: "otel-collector-opentelemetry-collector.monitoring.svc.cluster.local:4317"
- name: TLS_DIR
value: /tls
readinessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 5
periodSeconds: 10
livenessProbe:
httpGet:
path: /healthz
port: 8080
initialDelaySeconds: 10
periodSeconds: 30
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
cpu: 200m
memory: 128Mi
volumeMounts:
- name: tls
mountPath: /tls
readOnly: true
volumes:
- name: tls
secret:
secretName: alexa-bridge-tls
---
apiVersion: v1
kind: Service
metadata:
name: alexa-bridge
namespace: home-services
labels:
app: alexa-bridge
spec:
selector:
app: alexa-bridge
ports:
- name: http
port: 8080
targetPort: 8080
type: ClusterIP

View File

@ -71,3 +71,26 @@ spec:
- server auth - server auth
- digital signature - digital signature
- key encipherment - key encipherment
---
# Client-only cert for alexa-bridge's mTLS call to ha-gateway - modeled on
# discord-bot-tls above, not ai-gateway-tls, since alexa-bridge (like
# discord-bot) only dials out over mTLS and doesn't itself serve mTLS gRPC.
# This is a distinct cert/issuer from alexa-bridge's public HTTPS ingress
# cert (see alexa-bridge-public-ingress.yaml) - that one is letsencrypt-prod
# for the internet-facing Alexa endpoint; this one is the internal CA for
# the ha-gateway leg. Do not conflate the two.
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: alexa-bridge-tls
namespace: home-services
spec:
secretName: alexa-bridge-tls
issuerRef:
name: internal-ca-issuer
kind: ClusterIssuer
commonName: alexa-bridge
usages:
- client auth
- digital signature
- key encipherment