-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Kubernetes deployment support (#38)
Provide Kubernetes Deployment for anyone who need to use it.
- Loading branch information
Showing
3 changed files
with
108 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Kubernetes Deployment | ||
|
||
```bash | ||
# Deploy the service | ||
$ kubectl apply -f chatgpt-lite-deployment.yaml -f env-secret.yaml | ||
namespace/chatgpt-lite created | ||
deployment.apps/chatgpt-lite created | ||
service/chatgpt-lite created | ||
secret/env created | ||
|
||
# Get the service | ||
$ kubectl -n chatgpt-lite get svc | ||
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE | ||
chatgpt-lite ClusterIP 10.0.199.26 <none> 3000/TCP 7m8s | ||
|
||
# Use port-forward to access the service | ||
$ kubectl -n chatgpt-lite port-forward svc/chatgpt-lite 5566:3000 | ||
Forwarding from 127.0.0.1:5566 -> 3000 | ||
Forwarding from [::1]:5566 -> 3000 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Namespace | ||
metadata: | ||
name: chatgpt-lite | ||
--- | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app: chatgpt-lite | ||
name: chatgpt-lite | ||
namespace: chatgpt-lite | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: chatgpt-lite | ||
strategy: {} | ||
template: | ||
metadata: | ||
labels: | ||
app: chatgpt-lite | ||
spec: | ||
containers: | ||
- env: | ||
- name: AZURE_OPENAI_API_BASE_URL | ||
valueFrom: | ||
secretKeyRef: | ||
key: AZURE_OPENAI_API_BASE_URL | ||
name: env | ||
- name: AZURE_OPENAI_API_KEY | ||
valueFrom: | ||
secretKeyRef: | ||
key: AZURE_OPENAI_API_KEY | ||
name: env | ||
- name: AZURE_OPENAI_DEPLOYMENT | ||
valueFrom: | ||
secretKeyRef: | ||
key: AZURE_OPENAI_DEPLOYMENT | ||
name: env | ||
- name: OPENAI_API_BASE_URL | ||
valueFrom: | ||
secretKeyRef: | ||
key: OPENAI_API_BASE_URL | ||
name: env | ||
- name: OPENAI_API_KEY | ||
valueFrom: | ||
secretKeyRef: | ||
key: OPENAI_API_KEY | ||
name: env | ||
image: docker.io/blrchen/chatgpt-lite:main | ||
name: chatgpt-lite | ||
ports: | ||
- containerPort: 3000 | ||
resources: {} | ||
restartPolicy: Always | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
creationTimestamp: null | ||
labels: | ||
app: chatgpt-lite | ||
name: chatgpt-lite | ||
namespace: chatgpt-lite | ||
spec: | ||
ports: | ||
- name: "3000" | ||
port: 3000 | ||
targetPort: 3000 | ||
selector: | ||
app: chatgpt-lite |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
apiVersion: v1 | ||
kind: Secret | ||
metadata: | ||
name: env | ||
namespace: chatgpt-lite | ||
type: Opaque | ||
data: | ||
# echo -n 'Hello chatgpi-lite' | base64 | ||
# SGVsbG8gY2hhdGdwaS1saXRl | ||
OPENAI_API_BASE_URL: "" | ||
OPENAI_API_KEY: "" | ||
AZURE_OPENAI_API_BASE_URL: "" | ||
AZURE_OPENAI_API_KEY: "" | ||
AZURE_OPENAI_DEPLOYMENT: "" |
34c484d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
gptlite – ./
gptlite.vercel.app
gptlite-git-main-blrchen.vercel.app
gptlite-blrchen.vercel.app