Skip to content

Commit

Permalink
issue #1: nachet-backend kubernetes deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasCardin committed Jan 5, 2024
1 parent cb82279 commit 4d9ed24
Showing 1 changed file with 46 additions and 13 deletions.
59 changes: 46 additions & 13 deletions kubernetes/apps/nachet/nachet-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,60 @@ metadata:
labels:
name: nachet

---
apiVersion: v1
kind: ServiceAccount
metadata:
name: secrets-reader

---
apiVersion: apps/v1
kind: Deployment
metadata:
name: nachet-deployment
name: nachet
namespace: nachet
spec:
replicas: 2
selector:
matchLabels:
app: nginx
app: nachet
template:
metadata:
labels:
app: nginx
app: nachet
annotations:
vault.hashicorp.com/agent-inject: 'true'
vault.hashicorp.com/role: 'secrets-reader'
vault.hashicorp.com/tls-skip-verify: 'true'
vault.hashicorp.com/agent-inject-template-.env: |
{{- with secret "apps/nachet" -}}
NACHET_AZURE_STORAGE_CONNECTION_STRING="{{ .Data.data.NACHET_AZURE_STORAGE_CONNECTION_STRING }}"
NACHET_DATA="{{ .Data.data.NACHET_DATA }}"
NACHET_MODEL="{{ .Data.data.NACHET_MODEL }}"
NACHET_MODEL_ENDPOINT_ACCESS_KEY="{{ .Data.data.NACHET_MODEL_ENDPOINT_ACCESS_KEY }}"
NACHET_MODEL_ENDPOINT_REST_URL="{{ .Data.data.NACHET_MODEL_ENDPOINT_REST_URL }}"
NACHET_RESOURCE_GROUP="{{ .Data.data.NACHET_RESOURCE_GROUP }}"
NACHET_SUBSCRIPTION_ID="{{ .Data.data.NACHET_SUBSCRIPTION_ID }}"
NACHET_WORKSPACE="{{ .Data.data.NACHET_WORKSPACE }}"
{{- end }}
spec:
serviceAccountName: secrets-reader
containers:
- name: nginx
image: nginx:1.14.2
- name: nachet-backend
image: gcr.io/spartan-rhino-408115/nachet-backend:latest
imagePullPolicy: Always
command: ["/bin/sh", "-c"]
args:
- >
cp /vault/secrets/.env . && hypercorn -b :8080 app:app
ports:
- containerPort: 80
- containerPort: 8080
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 60
periodSeconds: 10

---
apiVersion: v1
Expand All @@ -36,16 +69,16 @@ metadata:
spec:
clusterIP: None
selector:
app: nginx
app: nachet
ports:
- protocol: TCP
port: 80
port: 8080

---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: nachet-ingress
name: nachet
namespace: nachet
annotations:
cert-manager.io/cluster-issuer: letsencrypt-http
Expand All @@ -55,16 +88,16 @@ spec:
ingressClassName: nginx
tls:
- hosts:
- nachet.ninebasetwo.xyz
- nachir.ninebasetwo.xyz
secretName: aciacfia-tls
rules:
- host: nachet.ninebasetwo.xyz
- host: nachir.ninebasetwo.xyz
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: nginx
name: nachet
port:
number: 80
number: 8080

0 comments on commit 4d9ed24

Please sign in to comment.