Skip to content

Commit

Permalink
kube/aks: add api.yaml
Browse files Browse the repository at this point in the history
Add YAML definition for the main API service.  This relies on the
kernelci/api Docker image and runs locally on port 8000 on the pod
with a regular user, but the service routes it to port 80.  It then
gets used by the ingress to route traffic over HTTPS.

Signed-off-by: Guillaume Tucker <[email protected]>
  • Loading branch information
gctucker committed Aug 30, 2023
1 parent abf9eb7 commit feb915b
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions kube/aks/api.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
#
# Copyright (C) 2023 Collabora Limited
# Author: Guillaume Tucker <[email protected]>

apiVersion: apps/v1
kind: Deployment
metadata:
name: api
namespace: kernelci-api
spec:
replicas: 1
selector:
matchLabels:
app: api
template:
metadata:
labels:
app: api
spec:
containers:
- name: api
image: kernelci/api
imagePullPolicy: Always
ports:
- containerPort: 8000
command: ["uvicorn"]
args: ["api.main:app", "--port", "8000", "--host", "0.0.0.0"]
env:
- name: SECRET_KEY
valueFrom:
secretKeyRef:
name: kernelci-api-secret-key
key: secret-key
- name: MONGO_SERVICE
valueFrom:
secretKeyRef:
name: kernelci-api-mongo-service
key: mongo-service
- name: REDIS_HOST
value: redis
---
apiVersion: v1
kind: Service
metadata:
name: api
namespace: kernelci-api
spec:
ports:
- port: 80
targetPort: 8000
selector:
app: api

0 comments on commit feb915b

Please sign in to comment.