diff --git a/core/app/__init__.py b/core/app/__init__.py index 5f16a9d..83f9b7c 100644 --- a/core/app/__init__.py +++ b/core/app/__init__.py @@ -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] diff --git a/core/app/handlers/core.py b/core/app/handlers/core.py new file mode 100644 index 0000000..657cb86 --- /dev/null +++ b/core/app/handlers/core.py @@ -0,0 +1,9 @@ +import hug + +@hug.post('/create-room') +def create_room(): + return "" + +@hug.post('/delete-room') +def delete_room(body): + return "" diff --git a/helm/templates/service.yaml b/helm/templates/service.yaml index d12b478..ca0dc0a 100644 --- a/helm/templates/service.yaml +++ b/helm/templates/service.yaml @@ -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 \ No newline at end of file diff --git a/helm/templates/statefulset.yaml b/helm/templates/statefulset.yaml new file mode 100644 index 0000000..53a0296 --- /dev/null +++ b/helm/templates/statefulset.yaml @@ -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 diff --git a/helm/values.yaml b/helm/values.yaml index 4a0426a..7ddcb82 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -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: ""