Docker仓库

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
apiVersion: v1
kind: ConfigMap
metadata:
labels:
app: gitlab
name: gitlab
namespace: public-service
data:
GITLAB_OMNIBUS_CONFIG: |-
external_url 'https://***.com';
gitlab_rails['incoming_email_enabled'] = false;
gitlab_rails['ldap_enabled'] = true;
gitlab_rails['prevent_ldap_sign_in'] = false;
letsencrypt['enable'] = false;
nginx['listen_port'] = 80;
nginx['listen_https'] = false;
gitlab_rails['ldap_servers'] = YAML.load <<-EOS;
main:
label: '统一认证'
host: '***.***.***.***'
port: 389
uid: 'uid'
encryption: 'plain'
bind_dn: 'CN=admin,DC=***,DC=com'
password: '***'
smartcard_auth: false
active_directory: false
allow_username_or_email_login: true
lowercase_usernames: true
base: 'OU=people,DC=huodada,DC=com'
user_filter: ''
attributes:
name: ['sn']
username: ['uid', 'cn']
email: ['mail', 'email']
EOS
gitlab_rails['gitlab_shell_ssh_port'] = 22;
gitlab_rails['db_adapter'] = "postgresql";
gitlab_rails['db_encoding'] = "utf8";
gitlab_rails['db_database'] = "gitlab";
gitlab_rails['db_username'] = "gitlab";
gitlab_rails['db_password'] = "***";
gitlab_rails['db_host'] = "***";
gitlab_rails['db_port'] = 1433;
gitlab_rails['redis_host'] = "***";
gitlab_rails['redis_port'] = 6379;
gitlab_rails['redis_ssl'] = false;
gitlab_rails['redis_password'] = "***";
gitlab_rails['redis_database'] = 0;
gitlab_rails['redis_enable_client'] = true;
gitlab_rails['smtp_enable'] = true;
gitlab_rails['smtp_address'] = "smtp.exmail.qq.com";
gitlab_rails['smtp_port'] = 465;
gitlab_rails['smtp_user_name'] = "system@***.com";
gitlab_rails['smtp_password'] = "***";
gitlab_rails['smtp_domain'] = "exmail.qq.com";
gitlab_rails['smtp_authentication'] = "login";
gitlab_rails['smtp_enable_starttls_auto'] = true;
gitlab_rails['smtp_tls'] = true;
gitlab_rails['gitlab_email_from'] = 'system@***.com';
postgresql['enable'] = false;
redis['enable'] = false;
prometheus['enable'] = false;
grafana['enable'] = false;
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: gitlab
name: gitlab
namespace: public-service
spec:
selector:
matchLabels:
app: gitlab
template:
metadata:
labels:
app: gitlab
spec:
containers:
- env:
- name: GITLAB_OMNIBUS_CONFIG
valueFrom:
configMapKeyRef:
key: GITLAB_OMNIBUS_CONFIG
name: gitlab
optional: false
image: gitlab/gitlab-ce:latest
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 3
httpGet:
path: /-/liveness?token=******
port: 80
scheme: HTTP
initialDelaySeconds: 120
periodSeconds: 2
successThreshold: 1
timeoutSeconds: 2
name: gitlab
ports:
- containerPort: 80
name: http
protocol: TCP
- containerPort: 443
name: https
protocol: TCP
- containerPort: 22
name: ssh
protocol: TCP
volumeMounts:
- mountPath: /etc/gitlab
name: data
subPath: config/
- mountPath: /var/log/gitlab
name: data
subPath: logs/
- mountPath: /var/opt/gitlab
name: data
subPath: data/
- mountPath: /opt/gitlab/embedded/service/gitlab-rails/.license_encryption_key.pub
name: license
subPath: .license_encryption_key.pub
volumes:
- name: data
persistentVolumeClaim:
claimName: gitlab
- name: license
secret:
defaultMode: 420
secretName: gitlab-license
---
apiVersion: v1
kind: Service
metadata:
labels:
app: gitlab
name: gitlab
namespace: public-service
spec:
ports:
- name: http
port: 80
protocol: TCP
targetPort: 80
selector:
app: gitlab
type: ClusterIP
---
apiVersion: v1
kind: Service
metadata:
labels:
app: gitlab
name: gitlab-internet
namespace: public-service
spec:
ports:
- name: ssh
port: 22
protocol: TCP
targetPort: 22
selector:
app: gitlab
type: LoadBalancer
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
nginx.ingress.kubernetes.io/proxy-body-size: 200m
nginx.ingress.kubernetes.io/ssl-redirect: "true"
name: gitlab
namespace: public-service
spec:
rules:
- host: ***.com
http:
paths:
- backend:
serviceName: gitlab
servicePort: 80
path: /
tls:
- secretName: ***.com