使用K8S部署Nexus,并连接LDAP
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
k8s-app: nexus3
name: nexus3
namespace: devops
spec:
replicas: 1
selector:
matchLabels:
k8s-app: nexus3
template:
metadata:
labels:
k8s-app: nexus3
name: nexus3
namespace: devops
spec:
containers:
- name: nexus3
image: sonatype/nexus3
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8081
name: web
protocol: TCP
- containerPort: 8083
name: docker-public
protocol: TCP
- containerPort: 8082
name: docker-dram
protocol: TCP
- containerPort: 8084
name: docker-dram-ssl
protocol: TCP
resources:
limits:
cpu: 1000m
memory: 2Gi
requests:
cpu: 500m
memory: 512Mi
volumeMounts:
- name: nexus-data
mountPath: /nexus-data
volumes:
- name: nexus-data
persistentVolumeClaim:
claimName: nexus-data-pvc
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: nexus-data-pvc
namespace: devops
spec:
accessModes:
- ReadWriteMany
storageClassName: "managed-nfs-storage"
resources:
requests:
storage: 256Gi
---
apiVersion: v1
kind: Service
metadata:
name: nexus3
namespace: devops
labels:
k8s-app: nexus3
spec:
selector:
k8s-app: nexus3
type: NodePort
ports:
- name: web
protocol: TCP
port: 8081
targetPort: 8081
nodePort: 30302
- name: docker-public
protocol: TCP
port: 8083
targetPort: 8083
nodePort: 30303
- name: docker-dram
protocol: TCP
port: 8082
targetPort: 8082
nodePort: 30304
- name: docker-dram-ssl
protocol: TCP
port: 8084
targetPort: 8084
nodePort: 30344
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
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
默认密码 pod内 cat /nexus-data/admin.password
LDAP配置:
LDAP添加用户权限:
上次更新: 10/23/2024