From d698731c565f5d3d0cc6f1b9a5c5596b6cc0603e Mon Sep 17 00:00:00 2001 From: FranciZhong Date: Sat, 12 Oct 2024 23:05:45 +1100 Subject: [PATCH] feat: ingress --- .gitignore | 8 ++++---- k8s/chatemo-service.yml | 2 +- k8s/ingress.yml | 18 ++++++++++++++++++ src/lib/constants.ts | 2 +- 4 files changed, 24 insertions(+), 6 deletions(-) create mode 100644 k8s/ingress.yml diff --git a/.gitignore b/.gitignore index 35e9e3e..d08b085 100644 --- a/.gitignore +++ b/.gitignore @@ -38,11 +38,11 @@ next-env.d.ts # env .env .env.local -.env.development -.env.production -# migration -# /prisma/migrations +# ssl/tsl +*.csr +*.key +*.crt # test */test.* diff --git a/k8s/chatemo-service.yml b/k8s/chatemo-service.yml index fc7b040..f701f41 100644 --- a/k8s/chatemo-service.yml +++ b/k8s/chatemo-service.yml @@ -3,7 +3,7 @@ kind: Service metadata: name: chatemo spec: - type: LoadBalancer + type: NodePort selector: app: chatemo ports: diff --git a/k8s/ingress.yml b/k8s/ingress.yml new file mode 100644 index 0000000..45adb98 --- /dev/null +++ b/k8s/ingress.yml @@ -0,0 +1,18 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: chatemo-ingress +spec: + tls: + - secretName: chatemo-ingress + rules: + - host: chatemo.chat + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: chatemo + port: + number: 80 diff --git a/src/lib/constants.ts b/src/lib/constants.ts index f036cf6..d1ac636 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -123,7 +123,7 @@ export const DEFAULT_MODEL = { }; export const DEFAULT_TRANSFORM_DELAY = 300; -export const SOCKET_HOST = 'http://www.chatemo.chat'; +export const SOCKET_HOST = 'https://www.chatemo.chat'; export const GITHUB_LINK = 'https://github.com/FranciZhong/chatemo'; export const MAX_IMAGE_FILE_SIZE = 5 * 1024 * 1024;