Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions knoq/backend-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: knoq-backend
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

この辺の名前から-backendを削除して欲しいです(フロントエンドも実行されるので)
ファイル名からもお願いします🙏

labels:
app: knoq-backend

spec:
selector:
matchLabels:
app: knoq-backend
template:
metadata:
labels:
app: knoq-backend
spec:
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- preference:
matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- las211.tokyotech.org
weight: 1

containers:
- name: knoq-backend
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

フロントエンドのリポジトリをpullしてVolumeをアタッチするinitContainersの用意をお願いします

image: ghcr.io/traptitech/knoq:main
env:
- name: DB_USER
value: "service_knoq"
- name: DB_PORT
value: "3306"
- name: DB_HOST
value: "tailscale.kmbk.tokyotech.org"
- name: DB_NAME
value: "service_knoq"
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: knoq-secrets
key: DB_PASSWORD
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

READMEに従って、この値を格納するSecretの用意をお願いします
わからなかったら聞いて下さい!

ports:
- containerPort: 3000
resources:
requests:
cpu: "10m"
memory: "10Mi"
limits:
cpu: "200m"
memory: "300Mi"
13 changes: 13 additions & 0 deletions knoq/backend-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: knoq-backend-service

spec:
type: ClusterIP
selector:
app: knoq-backend
ports:
- name: http
port: 3000
targetPort: 3000
14 changes: 14 additions & 0 deletions knoq/certificate.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: knoq-certificate

spec:
issuerRef:
kind: ClusterIssuer
name: cluster-issuer
secretName: knoq-tls
duration: 2160h0m0s # 90d
renewBefore: 720h0m0s # 30d
dnsNames:
- knoq.trap.jp
21 changes: 21 additions & 0 deletions knoq/ingress-route.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: knoq-ingressroute

spec:
entryPoints:
- websecure
tls:
secretName: knoq-tls

routes:
- match: (Host(`knoq.trap.jp`) && PathPrefix(`/api/`)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

フロントエンドも同じコンテナで実行されるので、PathPrefixは必要ないです
あと余分な(が先頭についてます

middlewares:
- name: auth-trap-jp-hard
namespace: auth
services:
- kind: Service
name: knoq-backend-service
port: 3000
scheme: http
5 changes: 5 additions & 0 deletions knoq/kustamization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
resources:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ファイル名ミス: kustomization.yamlです

- backend-deployment.yaml
- backend-service.yaml
- ingress-route.yaml
- certificate.yaml
Loading