-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.yaml
More file actions
706 lines (706 loc) · 22.2 KB
/
Copy pathinstall.yaml
File metadata and controls
706 lines (706 loc) · 22.2 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
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
apiVersion: v1
kind: Namespace
metadata:
labels:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: golang
control-plane: controller-manager
name: openapi-aggregator-system
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
name: openapiaggregators.observability.aggregator.io
spec:
group: observability.aggregator.io
names:
kind: OpenAPIAggregator
listKind: OpenAPIAggregatorList
plural: openapiaggregators
singular: openapiaggregator
scope: Namespaced
versions:
- name: v1alpha1
schema:
openAPIV3Schema:
description: OpenAPIAggregator is the Schema for the openapiaggregators API
properties:
apiVersion:
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
description: OpenAPIAggregatorSpec defines the desired state of OpenAPIAggregator
properties:
allowedMethodsAnnotation:
default: openapi.aggregator.io/allowed-methods
description: AllowedMethodsAnnotation is the annotation key for allowed
HTTP methods in Swagger UI
type: string
defaultPath:
default: /v2/api-docs
description: DefaultPath is the default path for OpenAPI documentation
type: string
defaultPort:
default: "8080"
description: DefaultPort is the default port for OpenAPI documentation
type: string
labelSelector:
additionalProperties:
type: string
description: |-
LabelSelector selects target deployments to collect OpenAPI specs from
This field is currently not used if WatchNamespaces is implemented as primary.
Consider removing or marking as deprecated if WatchNamespaces becomes the sole method.
type: object
pathAnnotation:
default: openapi.aggregator.io/path
description: PathAnnotation is the annotation key for OpenAPI path
type: string
portAnnotation:
default: openapi.aggregator.io/port
description: PortAnnotation is the annotation key for OpenAPI port
type: string
swaggerAnnotation:
default: openapi.aggregator.io/swagger
description: SwaggerAnnotation is the annotation key that indicates
if the Service should be included
type: string
watchNamespaces:
description: |-
WatchNamespaces specifies a list of namespaces to watch for services.
If empty or not provided, the controller will watch services in the same namespace as the OpenAPIAggregator CR.
If set to [""] (a list containing a single empty string), the controller will watch services in all namespaces.
Requires appropriate RBAC permissions for watching services in the specified namespaces (e.g., ClusterRole for all namespaces).
items:
type: string
type: array
type: object
status:
description: OpenAPIAggregatorStatus defines the observed state of OpenAPIAggregator
properties:
collectedAPIs:
description: CollectedAPIs contains information about the OpenAPI
specs that have been collected
items:
description: APIInfo contains information about a collected OpenAPI
spec
properties:
allowedMethods:
description: AllowedMethods stores the allowed HTTP methods
for Swagger UI
items:
type: string
type: array
annotations:
additionalProperties:
type: string
description: Annotations stores relevant annotations from the
resource
type: object
error:
description: Error is set if there was an error collecting the
spec
type: string
lastUpdated:
description: LastUpdated is when the spec was last successfully
collected
type: string
name:
description: Name is the name of the API (usually same as deployment
name)
type: string
namespace:
description: Namespace is the namespace of the kubernetes resource
type: string
path:
description: Path is the OpenAPI spec path for this service
type: string
port:
description: Port is the port for this service's OpenAPI spec
type: string
resourceName:
description: ResourceName is the name of the kubernetes resource
type: string
resourceType:
description: ResourceType is the type of the kubernetes resource
(Deployment)
type: string
url:
description: URL is the full URL where the OpenAPI spec can
be accessed
type: string
required:
- lastUpdated
- name
- namespace
- path
- port
- resourceName
- resourceType
- url
type: object
type: array
type: object
type: object
served: true
storage: true
subresources:
status: {}
---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.16.1
name: swaggerservers.observability.aggregator.io
spec:
group: observability.aggregator.io
names:
kind: SwaggerServer
listKind: SwaggerServerList
plural: swaggerservers
singular: swaggerserver
scope: Namespaced
versions:
- additionalPrinterColumns:
- jsonPath: .status.ready
name: READY
type: boolean
- jsonPath: .status.url
name: URL
type: string
- jsonPath: .metadata.creationTimestamp
name: AGE
type: date
name: v1alpha1
schema:
openAPIV3Schema:
description: SwaggerServer is the Schema for the swaggerservers API
properties:
apiVersion:
description: |-
APIVersion defines the versioned schema of this representation of an object.
Servers should convert recognized schemas to the latest internal value, and
may reject unrecognized values.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
type: string
kind:
description: |-
Kind is a string value representing the REST resource this object represents.
Servers may infer this from the endpoint the client submits requests to.
Cannot be updated.
In CamelCase.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
type: string
metadata:
type: object
spec:
description: SwaggerServerSpec defines the desired state of SwaggerServer
properties:
configMapName:
description: ConfigMapName is the name of the ConfigMap containing
the OpenAPI specifications.
type: string
devMode:
description: |-
DevMode enables or disables development mode for the Swagger UI server, which provides more verbose logging.
Valid values are: "true", "false".
Defaults to "false".
enum:
- "true"
- "false"
type: string
image:
description: |-
Image is the Docker image to use for the Swagger UI server.
If not specified, defaults to "ghcr.io/hellices/openapi-multi-swagger:latest".
type: string
imagePullPolicy:
description: |-
ImagePullPolicy defines the policy for pulling the Docker image.
Defaults to "IfNotPresent".
enum:
- Always
- Never
- IfNotPresent
type: string
logLevel:
description: |-
LogLevel is the logging level for the Swagger UI server.
Valid values are: "trace", "debug", "info", "warn", "error", "fatal", "panic".
Defaults to "info".
enum:
- trace
- debug
- info
- warn
- error
- fatal
- panic
type: string
port:
description: Port is the port number on which the Swagger UI will
be exposed.
format: int32
maximum: 65535
minimum: 1
type: integer
resources:
description: Resources defines the CPU and memory resources for the
Swagger UI server.
properties:
limits:
additionalProperties:
type: string
description: Limits describes the maximum amount of compute resources
allowed
type: object
requests:
additionalProperties:
type: string
description: Requests describes the minimum amount of compute
resources required
type: object
type: object
watchIntervalSeconds:
description: |-
WatchIntervalSeconds is the interval in seconds for the server to check for updates to the ConfigMap.
Defaults to "10".
type: string
required:
- configMapName
- port
type: object
status:
description: SwaggerServerStatus defines the observed state of SwaggerServer
properties:
conditions:
description: Conditions represent the latest available observations
of an object's state
items:
description: Condition contains details for one aspect of the current
state of this API Resource.
properties:
lastTransitionTime:
description: |-
lastTransitionTime is the last time the condition transitioned from one status to another.
This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
type: string
message:
description: |-
message is a human readable message indicating details about the transition.
This may be an empty string.
maxLength: 32768
type: string
observedGeneration:
description: |-
observedGeneration represents the .metadata.generation that the condition was set based upon.
For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date
with respect to the current state of the instance.
format: int64
minimum: 0
type: integer
reason:
description: |-
reason contains a programmatic identifier indicating the reason for the condition's last transition.
Producers of specific condition types may define expected values and meanings for this field,
and whether the values are considered a guaranteed API.
The value should be a CamelCase string.
This field may not be empty.
maxLength: 1024
minLength: 1
pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
type: string
status:
description: status of the condition, one of True, False, Unknown.
enum:
- "True"
- "False"
- Unknown
type: string
type:
description: type of condition in CamelCase or in foo.example.com/CamelCase.
maxLength: 316
pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
type: string
required:
- lastTransitionTime
- message
- reason
- status
- type
type: object
type: array
ready:
description: Ready indicates whether the Swagger UI server is ready
to serve requests
type: boolean
url:
description: URL is the URL where the Swagger UI is accessible
type: string
required:
- ready
type: object
type: object
served: true
storage: true
subresources:
status: {}
---
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: golang
name: openapi-aggregator-controller-manager
namespace: openapi-aggregator-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
labels:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: golang
name: openapi-aggregator-leader-election-role
namespace: openapi-aggregator-system
rules:
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: openapi-aggregator-manager-role
rules:
- apiGroups:
- apps
resources:
- deployments
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- configmaps
- services
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- observability.aggregator.io
resources:
- openapiaggregators
- swaggerservers
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- observability.aggregator.io
resources:
- openapiaggregators/finalizers
- swaggerservers/finalizers
verbs:
- update
- apiGroups:
- observability.aggregator.io
resources:
- openapiaggregators/status
- swaggerservers/status
verbs:
- get
- patch
- update
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: openapi-aggregator-metrics-auth-role
rules:
- apiGroups:
- authentication.k8s.io
resources:
- tokenreviews
verbs:
- create
- apiGroups:
- authorization.k8s.io
resources:
- subjectaccessreviews
verbs:
- create
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: openapi-aggregator-metrics-reader
rules:
- nonResourceURLs:
- /metrics
verbs:
- get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: golang
name: openapi-aggregator-openapiaggregator-editor-role
rules:
- apiGroups:
- observability.aggregator.io
resources:
- openapiaggregators
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- observability.aggregator.io
resources:
- openapiaggregators/status
verbs:
- get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: golang
name: openapi-aggregator-openapiaggregator-viewer-role
rules:
- apiGroups:
- observability.aggregator.io
resources:
- openapiaggregators
verbs:
- get
- list
- watch
- apiGroups:
- observability.aggregator.io
resources:
- openapiaggregators/status
verbs:
- get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
labels:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: golang
name: openapi-aggregator-leader-election-rolebinding
namespace: openapi-aggregator-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: openapi-aggregator-leader-election-role
subjects:
- kind: ServiceAccount
name: openapi-aggregator-controller-manager
namespace: openapi-aggregator-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
app.kubernetes.io/component: rbac
app.kubernetes.io/created-by: openapi-aggregator-operator
app.kubernetes.io/instance: manager-rolebinding
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: clusterrolebinding
app.kubernetes.io/part-of: openapi-aggregator-operator
name: openapi-aggregator-manager-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: openapi-aggregator-manager-role
subjects:
- kind: ServiceAccount
name: openapi-aggregator-controller-manager
namespace: openapi-aggregator-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: openapi-aggregator-metrics-auth-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: openapi-aggregator-metrics-auth-role
subjects:
- kind: ServiceAccount
name: openapi-aggregator-controller-manager
namespace: openapi-aggregator-system
---
apiVersion: v1
kind: Service
metadata:
labels:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: golang
control-plane: controller-manager
name: openapi-aggregator-controller-manager-metrics-service
namespace: openapi-aggregator-system
spec:
ports:
- name: metrics
port: 8080
protocol: TCP
targetPort: metrics
selector:
control-plane: controller-manager
---
apiVersion: v1
kind: Service
metadata:
labels:
control-plane: controller-manager
name: openapi-aggregator-openapi-aggregator-metrics
namespace: openapi-aggregator-system
spec:
ports:
- name: metrics
port: 8080
protocol: TCP
targetPort: metrics
selector:
control-plane: controller-manager
type: ClusterIP
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: golang
control-plane: controller-manager
name: openapi-aggregator-controller-manager
namespace: openapi-aggregator-system
spec:
replicas: 1
selector:
matchLabels:
control-plane: controller-manager
template:
metadata:
annotations:
kubectl.kubernetes.io/default-container: manager
labels:
control-plane: controller-manager
spec:
containers:
- args:
- --metrics-bind-address=:8080
- --leader-elect
- --health-probe-bind-address=:8081
- --metrics-secure=false
- --metrics-bind-address=:8080
command:
- /manager
image: ghcr.io/hellices/openapi-aggregator-operator:latest
livenessProbe:
httpGet:
path: /healthz
port: 8081
initialDelaySeconds: 15
periodSeconds: 20
name: manager
ports:
- containerPort: 8080
name: metrics
protocol: TCP
- containerPort: 8081
name: health-probe
protocol: TCP
readinessProbe:
httpGet:
path: /readyz
port: 8081
initialDelaySeconds: 5
periodSeconds: 10
resources:
limits:
cpu: 500m
memory: 128Mi
requests:
cpu: 10m
memory: 64Mi
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
securityContext:
runAsNonRoot: true
serviceAccountName: openapi-aggregator-controller-manager
terminationGracePeriodSeconds: 10