File tree 3 files changed +108
-0
lines changed
3 files changed +108
-0
lines changed Original file line number Diff line number Diff line change
1
+ # Kubernetes Deployment
2
+
3
+ ``` bash
4
+ # Deploy the service
5
+ $ kubectl apply -f chatgpt-lite-deployment.yaml -f env-secret.yaml
6
+ namespace/chatgpt-lite created
7
+ deployment.apps/chatgpt-lite created
8
+ service/chatgpt-lite created
9
+ secret/env created
10
+
11
+ # Get the service
12
+ $ kubectl -n chatgpt-lite get svc
13
+ NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
14
+ chatgpt-lite ClusterIP 10.0.199.26 < none> 3000/TCP 7m8s
15
+
16
+ # Use port-forward to access the service
17
+ $ kubectl -n chatgpt-lite port-forward svc/chatgpt-lite 5566:3000
18
+ Forwarding from 127.0.0.1:5566 -> 3000
19
+ Forwarding from [::1]:5566 -> 3000
20
+ ```
Original file line number Diff line number Diff line change
1
+ ---
2
+ apiVersion : v1
3
+ kind : Namespace
4
+ metadata :
5
+ name : chatgpt-lite
6
+ ---
7
+ apiVersion : apps/v1
8
+ kind : Deployment
9
+ metadata :
10
+ labels :
11
+ app : chatgpt-lite
12
+ name : chatgpt-lite
13
+ namespace : chatgpt-lite
14
+ spec :
15
+ replicas : 1
16
+ selector :
17
+ matchLabels :
18
+ app : chatgpt-lite
19
+ strategy : {}
20
+ template :
21
+ metadata :
22
+ labels :
23
+ app : chatgpt-lite
24
+ spec :
25
+ containers :
26
+ - env :
27
+ - name : AZURE_OPENAI_API_BASE_URL
28
+ valueFrom :
29
+ secretKeyRef :
30
+ key : AZURE_OPENAI_API_BASE_URL
31
+ name : env
32
+ - name : AZURE_OPENAI_API_KEY
33
+ valueFrom :
34
+ secretKeyRef :
35
+ key : AZURE_OPENAI_API_KEY
36
+ name : env
37
+ - name : AZURE_OPENAI_DEPLOYMENT
38
+ valueFrom :
39
+ secretKeyRef :
40
+ key : AZURE_OPENAI_DEPLOYMENT
41
+ name : env
42
+ - name : OPENAI_API_BASE_URL
43
+ valueFrom :
44
+ secretKeyRef :
45
+ key : OPENAI_API_BASE_URL
46
+ name : env
47
+ - name : OPENAI_API_KEY
48
+ valueFrom :
49
+ secretKeyRef :
50
+ key : OPENAI_API_KEY
51
+ name : env
52
+ image : docker.io/blrchen/chatgpt-lite:main
53
+ name : chatgpt-lite
54
+ ports :
55
+ - containerPort : 3000
56
+ resources : {}
57
+ restartPolicy : Always
58
+ ---
59
+ apiVersion : v1
60
+ kind : Service
61
+ metadata :
62
+ creationTimestamp : null
63
+ labels :
64
+ app : chatgpt-lite
65
+ name : chatgpt-lite
66
+ namespace : chatgpt-lite
67
+ spec :
68
+ ports :
69
+ - name : " 3000"
70
+ port : 3000
71
+ targetPort : 3000
72
+ selector :
73
+ app : chatgpt-lite
Original file line number Diff line number Diff line change
1
+ ---
2
+ apiVersion : v1
3
+ kind : Secret
4
+ metadata :
5
+ name : env
6
+ namespace : chatgpt-lite
7
+ type : Opaque
8
+ data :
9
+ # echo -n 'Hello chatgpi-lite' | base64
10
+ # SGVsbG8gY2hhdGdwaS1saXRl
11
+ OPENAI_API_BASE_URL : " "
12
+ OPENAI_API_KEY : " "
13
+ AZURE_OPENAI_API_BASE_URL : " "
14
+ AZURE_OPENAI_API_KEY : " "
15
+ AZURE_OPENAI_DEPLOYMENT : " "
You can’t perform that action at this time.
0 commit comments