-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeployment.yaml
More file actions
279 lines (269 loc) · 9.43 KB
/
deployment.yaml
File metadata and controls
279 lines (269 loc) · 9.43 KB
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
# =============================================================================
# Git-Bridge Deployment Example
# =============================================================================
#
# Includes: Deployment, Service, and Ingress resources.
#
# Environment variables are injected from the K8s Secret (git-bridge-secret).
# The config file is mounted from the ConfigMap (git-bridge-config).
#
# To add a new provider instance, add env vars in the corresponding section
# and create matching entries in both Secret and ConfigMap.
#
# Naming convention: <TYPE>_<NAME>_<FIELD>
# See docs/naming-convention.md for the full guide.
# =============================================================================
apiVersion: apps/v1
kind: Deployment
metadata:
name: git-bridge
namespace: git-bridge
labels:
app: git-bridge
spec:
replicas: 1
strategy:
type: Recreate # Recreate to avoid concurrent git operations
selector:
matchLabels:
app: git-bridge
template:
metadata:
labels:
app: git-bridge
spec:
# Uncomment if using a private container registry
# imagePullSecrets:
# - name: registry-secret
containers:
- name: git-bridge
image: somaz940/git-bridge:latest
imagePullPolicy: Always
ports:
- containerPort: 8080
protocol: TCP
env:
# -----------------------------------------------------------------
# Config path (mounted from ConfigMap)
# -----------------------------------------------------------------
- name: CONFIG_PATH
value: /etc/git-bridge/config.yaml
# -----------------------------------------------------------------
# CodeCommit — EU
# -----------------------------------------------------------------
- name: CODECOMMIT_EU_REGION
valueFrom:
secretKeyRef:
name: git-bridge-secret
key: CODECOMMIT_EU_REGION
- name: CODECOMMIT_EU_GIT_USERNAME
valueFrom:
secretKeyRef:
name: git-bridge-secret
key: CODECOMMIT_EU_GIT_USERNAME
- name: CODECOMMIT_EU_GIT_PASSWORD
valueFrom:
secretKeyRef:
name: git-bridge-secret
key: CODECOMMIT_EU_GIT_PASSWORD
# CodeCommit — US (uncomment to add multi-region)
# - name: CODECOMMIT_US_REGION
# valueFrom:
# secretKeyRef:
# name: git-bridge-secret
# key: CODECOMMIT_US_REGION
# - name: CODECOMMIT_US_GIT_USERNAME
# valueFrom:
# secretKeyRef:
# name: git-bridge-secret
# key: CODECOMMIT_US_GIT_USERNAME
# - name: CODECOMMIT_US_GIT_PASSWORD
# valueFrom:
# secretKeyRef:
# name: git-bridge-secret
# key: CODECOMMIT_US_GIT_PASSWORD
# -----------------------------------------------------------------
# GitLab — main
# -----------------------------------------------------------------
- name: GITLAB_MAIN_BASE_URL
valueFrom:
secretKeyRef:
name: git-bridge-secret
key: GITLAB_MAIN_BASE_URL
- name: GITLAB_MAIN_TOKEN
valueFrom:
secretKeyRef:
name: git-bridge-secret
key: GITLAB_MAIN_TOKEN
# GitLab — secondary (uncomment to add multi-instance)
# - name: GITLAB_SECONDARY_BASE_URL
# valueFrom:
# secretKeyRef:
# name: git-bridge-secret
# key: GITLAB_SECONDARY_BASE_URL
# - name: GITLAB_SECONDARY_TOKEN
# valueFrom:
# secretKeyRef:
# name: git-bridge-secret
# key: GITLAB_SECONDARY_TOKEN
# -----------------------------------------------------------------
# GitHub — main
# -----------------------------------------------------------------
- name: GITHUB_MAIN_TOKEN
valueFrom:
secretKeyRef:
name: git-bridge-secret
key: GITHUB_MAIN_TOKEN
# GitHub — secondary (uncomment to add multi-account)
# - name: GITHUB_SECONDARY_TOKEN
# valueFrom:
# secretKeyRef:
# name: git-bridge-secret
# key: GITHUB_SECONDARY_TOKEN
# -----------------------------------------------------------------
# SQS Consumer — EU
# -----------------------------------------------------------------
- name: SQS_EU_QUEUE_URL
valueFrom:
secretKeyRef:
name: git-bridge-secret
key: SQS_EU_QUEUE_URL
- name: SQS_EU_REGION
valueFrom:
secretKeyRef:
name: git-bridge-secret
key: SQS_EU_REGION
- name: SQS_EU_ACCESS_KEY
valueFrom:
secretKeyRef:
name: git-bridge-secret
key: SQS_EU_ACCESS_KEY
- name: SQS_EU_SECRET_KEY
valueFrom:
secretKeyRef:
name: git-bridge-secret
key: SQS_EU_SECRET_KEY
# SQS Consumer — US (uncomment to add multi-region)
# - name: SQS_US_QUEUE_URL
# valueFrom:
# secretKeyRef:
# name: git-bridge-secret
# key: SQS_US_QUEUE_URL
# - name: SQS_US_REGION
# valueFrom:
# secretKeyRef:
# name: git-bridge-secret
# key: SQS_US_REGION
# - name: SQS_US_ACCESS_KEY
# valueFrom:
# secretKeyRef:
# name: git-bridge-secret
# key: SQS_US_ACCESS_KEY
# - name: SQS_US_SECRET_KEY
# valueFrom:
# secretKeyRef:
# name: git-bridge-secret
# key: SQS_US_SECRET_KEY
# -----------------------------------------------------------------
# Webhook Secrets
# -----------------------------------------------------------------
- name: WEBHOOK_GITLAB_SECRET
valueFrom:
secretKeyRef:
name: git-bridge-secret
key: WEBHOOK_GITLAB_SECRET
- name: WEBHOOK_GITHUB_SECRET
valueFrom:
secretKeyRef:
name: git-bridge-secret
key: WEBHOOK_GITHUB_SECRET
# -----------------------------------------------------------------
# Notification
# -----------------------------------------------------------------
- name: SLACK_WEBHOOK_URL
valueFrom:
secretKeyRef:
name: git-bridge-secret
key: SLACK_WEBHOOK_URL
volumeMounts:
- name: config
mountPath: /etc/git-bridge
readOnly: true
- name: work
mountPath: /tmp/git-bridge
resources:
requests:
memory: "128Mi"
cpu: "100m"
limits:
memory: "512Mi"
cpu: "500m"
livenessProbe:
httpGet:
path: /health
port: 8080
initialDelaySeconds: 10
periodSeconds: 30
readinessProbe:
httpGet:
path: /ready
port: 8080
initialDelaySeconds: 5
periodSeconds: 10
volumes:
- name: config
configMap:
name: git-bridge-config
- name: work
# Option 1: PVC for persistent mirror cache (recommended for large repos)
# persistentVolumeClaim:
# claimName: git-bridge-work
# Option 2: emptyDir (no persistence across pod restarts)
emptyDir: {}
---
# =============================================================================
# Service
# =============================================================================
apiVersion: v1
kind: Service
metadata:
name: git-bridge
namespace: git-bridge
labels:
app: git-bridge
spec:
type: ClusterIP
ports:
- port: 80
targetPort: 8080
protocol: TCP
selector:
app: git-bridge
---
# =============================================================================
# Ingress
# =============================================================================
# Adjust host, ingressClassName, and annotations for your environment.
# =============================================================================
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: git-bridge
namespace: git-bridge
labels:
app: git-bridge
annotations:
nginx.ingress.kubernetes.io/force-ssl-redirect: "false"
spec:
ingressClassName: nginx
rules:
- host: git-bridge.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: git-bridge
port:
number: 80