forked from Pythagora-io/gpt-pilot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yaml
179 lines (159 loc) · 4.11 KB
/
compose.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# -----------------------------------
# Refer to your cluster documentation or platform-specific instructions for configuring CRI-O as the container runtime.
# Example (kubeadm):
# kubeadm init --cri-socket /var/run/crio/crio.sock
# -----------------------------------
# Secrets Management (Helm)
# -----------------------------------
# Install Helm for managing Secrets:
# https://helm.sh/docs/intro/install/
version: "3.9"
services:
# Control Plane
etcd:
image: quay.io/coreos/etcd:latest
volumes:
- etcd-data:/var/lib/etcd
deploy:
replicas: 3
restart: always
placement:
constraints:
kubernetes.io/schedulable: "true"
kube-apiserver:
image: quay.io/kubernetes/kube-apiserver:v1.24.4
volumes:
- kubernetes-config:/etc/kubernetes
depends_on:
- etcd
deploy:
replicas: 1
restart: always
placement:
constraints:
kubernetes.io/schedulable: "true"
kube-controller-manager:
image: quay.io/kubernetes/kube-controller-manager:v1.24.4
volumes:
- kubernetes-config:/etc/kubernetes
depends_on:
- kube-apiserver
deploy:
replicas: 1
restart: always
placement:
constraints:
kubernetes.io/schedulable: "true"
kube-scheduler:
image: quay.io/kubernetes/kube-scheduler:v1.24.4
volumes:
- kubernetes-config:/etc/kubernetes
depends_on:
- kube-apiserver
deploy:
replicas: 1
restart: always
placement:
constraints:
kubernetes.io/schedulable: "true"
# Workers
# Update the number of workers based on your needs and resources
worker-1:
image: ubuntu:latest
deploy:
replicas: 3
restart: always
placement:
constraints:
kubernetes.io/schedulable: "true"
worker-2:
image: ubuntu:latest
deploy:
replicas: 3
restart: always
placement:
constraints:
kubernetes.io/schedulable: "true"
# Pods
msmgo:
image: my_private_registry/msmongodb:latest
environment:
- MONGO_INITDB_ROOT_USERNAME={{ .Values.mongodb.username }} # Reference a Helm Secret
- MONGO_INITDB_ROOT_PASSWORD={{ .Values.mongodb.password }} # Reference a Helm Secret
volumes:
- mongodb-data:/data/db
ports:
- "0-0:27017" # Expose port internally only
deploy:
replicas: 1
frontend:
image: my_private_registry/frontend:latest
volumes:
- frontend-workspace:/workspace
ports:
- "50000:50000"
deploy:
replicas: 1
gptpilot:
image: my_private_registry/gptpilot:latest
environment:
- OPENAI_API_KEY={{ .Values.gptpilot.openai_token }} # Reference a Helm Secret
volumes:
- gptpilot-maintaince:/maintaince
ports:
- "50505:50505" # Adjust if gptpilot exposes a different port
deploy:
replicas: 1
# Service Plane
nginx-ingress:
image: nginx:stable-alpine
depends_on:
- frontend
- gptpilot
ports:
- "80:80"
- "443:443"
deploy:
replicas: 1
# Cluster Networking and DNS
kube-dns:
image: quay.io/coreos/kube-dns:v1.24.4
deploy:
replicas: 1
# Volumes
volumes:
etcd-data: {}
kubernetes-config: {}
mongodb-data: {}
frontend-workspace: {}
gptpilot-maintaince: {}
# Persistent Storage (Customize based on your needs)
# ...
# Services
services:
frontend-service:
type: LoadBalancer
ports:
- port: 80
targetPort: 50000
selector:
app: frontend
gptpilot-service:
type: LoadBalancer
ports:
- port: 80
targetPort: 50505 # Adjust if gptpilot
services:
# ... (rest of the services)
# Pods with Secrets placeholders
msmgo:
image: my_private_registry/msmongodb:latest
environment:
- MONGO_INITDB_ROOT_USERNAME={{ .Values.mongodb.username }} # Reference a Helm Secret
- MONGO_INITDB_ROOT_PASSWORD={{ .Values.mongodb.password }} # Reference a Helm Secret
# ...
gptpilot:
image: my_private_registry/gptpilot:latest
environment:
- OPENAI_API_KEY={{ .Values.gptpilot.openai_token }} # Reference a Helm Secret
# ...