Skip to content

Commit

Permalink
WIP on statefulset in helm chart
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasHerve-Descours-Cabaud committed Mar 27, 2024
1 parent 63bbdf0 commit 0907d9b
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 4 deletions.
4 changes: 2 additions & 2 deletions core/app/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import hug
from handlers import test
from handlers import test, core


@hug.extend_api("")
def api():
return [test]
return [test, core]

9 changes: 9 additions & 0 deletions core/app/handlers/core.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import hug

@hug.post('/create-room')
def create_room():
return ""

@hug.post('/delete-room')
def delete_room(body):
return ""
16 changes: 15 additions & 1 deletion helm/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,18 @@ spec:
selector:
app.kubernetes.io/instance: asyncunitytemplate
app.kubernetes.io/name: core

---
apiVersion: v1
kind: Service
metadata:
name: instance
labels:
app: instance
spec:
ports:
- port: 80
name: http
type: ClusterIP
selector:
app.kubernetes.io/instance: asyncunitytemplate
app.kubernetes.io/name: instance
32 changes: 32 additions & 0 deletions helm/templates/statefulset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: instance
labels:
app.kubernetes.io/instance: asyncunitytemplate
app.kubernetes.io/name: instance
annotations:
keel.sh/policy: force
keel.sh/trigger: poll
keel.sh/pollSchedule: "@every 10m"
spec:
serviceName: instance
replicas: {{ .Values.instance.replicas }}
selector:
matchLabels:
app.kubernetes.io/instance: asyncunitytemplate
app.kubernetes.io/name: instance
template:
metadata:
labels:
app.kubernetes.io/instance: asyncunitytemplate
app.kubernetes.io/name: instance
spec:
terminationGracePeriodSeconds: 10
containers:
- name: instance
image: "{{ .Values.instance.repository }}:{{ .Values.instance.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.instance.pullPolicy }}
ports:
- containerPort: 80
name: web
7 changes: 6 additions & 1 deletion helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ namespace: asyncunity
image:
repository: thomasherve/asymetric-unity-core
pullPolicy: Always
# Overrides the image tag whose default is the chart appVersion.
tag: "latest"

instance:
repository: thomasherve/asymetric-unity-instance
pullPolicy: Always
tag: "latest"
replicas: 0

imagePullSecrets:
name: thomashervecredentials
dockerconfigjson: ""
Expand Down

0 comments on commit 0907d9b

Please sign in to comment.