-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathharbor-deployment.yaml
179 lines (179 loc) · 4.27 KB
/
harbor-deployment.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
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: harbor-creator
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: harbor-creator
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cluster-admin
subjects:
- kind: ServiceAccount
name: harbor-creator
namespace: kube-system
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: harbor-storage
namespace: kube-system
spec:
accessModes:
- ReadWriteOnce
volumeMode: Filesystem
resources:
requests:
storage: 1Gi
---
apiVersion: v1
kind: ConfigMap
metadata:
name: harbor-api-diagram
namespace: kube-system
data:
api-diagram.json: |
[
{
"name": "/debug",
"path": [
{
"name": "/vnf",
"path": [
{
"name": "/launch/:id",
"type": "get",
"function": "org.augugrumi.harbor.routes.vnfm.VnfLauncherRoute"
},
{
"name": "/stop/:id",
"type": "get",
"function": "org.augugrumi.harbor.routes.vnfm.VnfStopperRoute"
},
{
"name": "/update/:id",
"type": "post",
"function": "org.augugrumi.harbor.routes.nfvo.catalog.UpdateVnfRoute"
}
]
}
]
},
{
"name": "/vnf",
"path": [
{
"name": "/catalog/:id",
"type": "get",
"function": "org.augugrumi.harbor.routes.nfvo.catalog.GetVnfRoute"
},
{
"name": "/catalog/:id",
"type": "post",
"function": "org.augugrumi.harbor.routes.nfvo.catalog.CreateVnfRoute"
},
{
"name": "/catalog/:id",
"type": "delete",
"function": "org.augugrumi.harbor.routes.nfvo.catalog.DeleteVnfRoute"
},
{
"name": "/catalog/",
"type": "get",
"function": "org.augugrumi.harbor.routes.nfvo.catalog.ListVnfsRoute"
}
]
},
{
"name": "/ns",
"path": [
{
"name": "/catalog/:id",
"type": "post",
"function": "org.augugrumi.harbor.routes.nfvo.catalog.CreateNSRoute"
},
{
"name": "/catalog/:id",
"type": "get",
"function": "org.augugrumi.harbor.routes.nfvo.catalog.GetNSRoute"
},
{
"name": "/catalog/:id",
"type": "delete",
"function": "org.augugrumi.harbor.routes.nfvo.catalog.DeleteNSRoute"
},
{
"name": "/launch/:id",
"type": "get",
"function": "org.augugrumi.harbor.routes.nfvo.nsm.NsLauncherRoute"
},
{
"name": "/stop/:id",
"type": "get",
"function": "org.augugrumi.harbor.routes.nfvo.nsm.NsStopperRoute"
}
]
}
]
---
kind: Deployment
apiVersion: extensions/v1beta1
metadata:
name: harbor-creator-deployment
namespace: kube-system
labels:
k8s-app: harbor-creator
spec:
replicas: 1
selector:
matchLabels:
k8s-app: harbor-creator
template:
metadata:
labels:
k8s-app: harbor-creator
name: harbor-creator
spec:
containers:
- name: harbor
image: augugrumi/harbor
imagePullPolicy: Always
ports:
- name: http
containerPort: 80
volumeMounts:
- name: harbor-config
mountPath: /config
- name: harbor-storage
mountPath: /data
env:
- name: HARBOR_API_CONFIG
value: /config/api-diagram.json
- name: HARBOR_STORAGE_PATH
value: /data
volumes:
- name: harbor-config
configMap:
name: harbor-api-diagram
- name: harbor-storage
persistentVolumeClaim:
claimName: harbor-storage
---
kind: Service
apiVersion: v1
metadata:
name: harbor-creator-service
namespace: kube-system
spec:
selector:
k8s-app: harbor-creator
ports:
- protocol: TCP
port: 80
name: web
type: NodePort