forked from m88i/nexus-operator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nexus-operator.yaml
722 lines (722 loc) · 24 KB
/
nexus-operator.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
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
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
apiVersion: v1
kind: Namespace
metadata:
labels:
control-plane: controller-manager
name: nexus-operator-system
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.3.0
creationTimestamp: null
name: nexus.apps.m88i.io
spec:
additionalPrinterColumns:
- JSONPath: .spec.networking.exposeAs
description: Type of networking access
name: Expose As
type: string
- JSONPath: .spec.automaticUpdate.disabled
description: Flag that indicates if automatic updates are disabled or not
name: Update Disabled
type: boolean
- JSONPath: .status.nexusStatus
description: Instance Status
name: Status
type: string
- JSONPath: .status.reason
description: Status reason
name: Reason
type: string
- JSONPath: .status.serverOperationsStatus.mavenPublicURL
description: Internal Group Maven Public URL
name: Maven Public URL
type: string
group: apps.m88i.io
names:
kind: Nexus
listKind: NexusList
plural: nexus
singular: nexus
scope: Namespaced
subresources:
status: {}
validation:
openAPIV3Schema:
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: NexusSpec defines the desired state of Nexus
properties:
automaticUpdate:
description: Automatic updates configuration
properties:
disabled:
description: Whether or not the Operator should perform automatic
updates. Defaults to `false` (auto updates are enabled). Is set
to `false` if `spec.image` is not empty and is different from
the default community image.
type: boolean
minorVersion:
description: The Nexus image minor version the deployment should
stay in. If left blank and automatic updates are enabled the latest
minor is set.
minimum: 0
type: integer
type: object
generateRandomAdminPassword:
description: 'GenerateRandomAdminPassword enables the random password
generation. Defaults to `false`: the default password for a newly
created instance is ''admin123'', which should be changed in the first
login. If set to `true`, you must use the automatically generated
''admin'' password, stored in the container''s file system at `/nexus-data/admin.password`.
The operator uses the default credentials to create a user for itself
to create default repositories. If set to `true`, the repositories
won''t be created since the operator won''t fetch for the random password.'
type: boolean
image:
description: 'Full image tag name for this specific deployment. Will
be ignored if `spec.useRedHatImage` is set to `true`. Default: docker.io/sonatype/nexus3:latest'
type: string
imagePullPolicy:
description: 'The image pull policy for the Nexus image. If left blank
behavior will be determined by the image tag (`Always` if "latest"
and `IfNotPresent` otherwise). Possible values: `Always`, `IfNotPresent`
or `Never`.'
enum:
- Always
- IfNotPresent
- Never
type: string
livenessProbe:
description: LivenessProbe describes how the Nexus container liveness
probe should work
properties:
failureThreshold:
description: Minimum consecutive failures for the probe to be considered
failed after having succeeded. Defaults to 3. Minimum value is
1.
format: int32
minimum: 1
type: integer
initialDelaySeconds:
description: Number of seconds after the container has started before
probes are initiated. Defaults to 240 seconds. Minimum value is
0.
format: int32
minimum: 0
type: integer
periodSeconds:
description: How often (in seconds) to perform the probe. Defaults
to 10 seconds. Minimum value is 1.
format: int32
minimum: 1
type: integer
successThreshold:
description: Minimum consecutive successes for the probe to be considered
successful after having failed. Defaults to 1. Must be 1 for liveness
and startup. Minimum value is 1.
format: int32
minimum: 1
type: integer
timeoutSeconds:
description: Number of seconds after which the probe times out.
Defaults to 15 seconds. Minimum value is 1.
format: int32
minimum: 1
type: integer
type: object
networking:
description: Networking definition
properties:
expose:
description: Set to `true` to expose the Nexus application. Defaults
to `false`.
type: boolean
exposeAs:
description: 'Type of networking exposure: NodePort, Route or Ingress.
Defaults to Route on OpenShift and Ingress on Kubernetes. Routes
are only available on Openshift and Ingresses are only available
on Kubernetes.'
enum:
- NodePort
- Route
- Ingress
type: string
host:
description: Host where the Nexus service is exposed. This attribute
is required if the service is exposed via Ingress.
type: string
nodePort:
description: NodePort defined in the exposed service. Required if
exposed via NodePort.
format: int32
type: integer
tls:
description: TLS/SSL-related configuration
properties:
mandatory:
description: When exposing via Route, set to `true` to only
allow encrypted traffic using TLS (disables HTTP in favor
of HTTPS). Defaults to `false`.
type: boolean
secretName:
description: When exposing via Ingress, inform the name of the
TLS secret containing certificate and private key for TLS
encryption. It must be present in the same namespace as the
Operator.
type: string
type: object
type: object
persistence:
description: Persistence definition
properties:
persistent:
description: Flag to indicate if this instance will be persistent
or not
type: boolean
storageClass:
description: StorageClass used by the managed PVC.
type: string
volumeSize:
description: 'If persistent, the size of the Volume. Defaults: 10Gi'
type: string
required:
- persistent
type: object
readinessProbe:
description: ReadinessProbe describes how the Nexus container readiness
probe should work
properties:
failureThreshold:
description: Minimum consecutive failures for the probe to be considered
failed after having succeeded. Defaults to 3. Minimum value is
1.
format: int32
minimum: 1
type: integer
initialDelaySeconds:
description: Number of seconds after the container has started before
probes are initiated. Defaults to 240 seconds. Minimum value is
0.
format: int32
minimum: 0
type: integer
periodSeconds:
description: How often (in seconds) to perform the probe. Defaults
to 10 seconds. Minimum value is 1.
format: int32
minimum: 1
type: integer
successThreshold:
description: Minimum consecutive successes for the probe to be considered
successful after having failed. Defaults to 1. Must be 1 for liveness
and startup. Minimum value is 1.
format: int32
minimum: 1
type: integer
timeoutSeconds:
description: Number of seconds after which the probe times out.
Defaults to 15 seconds. Minimum value is 1.
format: int32
minimum: 1
type: integer
type: object
replicas:
description: Number of pod replicas desired. Defaults to 0.
format: int32
maximum: 100
minimum: 0
type: integer
resources:
description: Defined Resources for the Nexus instance
properties:
limits:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: 'Limits describes the maximum amount of compute resources
allowed. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/'
type: object
requests:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
description: 'Requests describes the minimum amount of compute resources
required. If Requests is omitted for a container, it defaults
to Limits if that is explicitly specified, otherwise to an implementation-defined
value. More info: https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/'
type: object
type: object
serverOperations:
description: ServerOperations describes the options for the operations
performed on the deployed server instance
properties:
disableOperatorUserCreation:
description: DisableOperatorUserCreation disables the auto-creation
of the `nexus-operator` user on the deployed server. This user
performs all the operations on the server (such as creating the
community repos). If disabled, the Operator will use the default
`admin` user. Defaults to `false` (always create the user). Setting
this to `true` is not recommended as it grants the Operator more
privileges than it needs and it would not be possible to tell
apart operations performed by the `admin` and the Operator.
type: boolean
disableRepositoryCreation:
description: DisableRepositoryCreation disables the auto-creation
of Apache, JBoss and Red Hat repositories and their addition to
the Maven Public group in this Nexus instance. Defaults to `false`
(always try to create the repos). Set this to `true` to not create
them. Only works if `spec.generateRandomAdminPassword` is `false`.
type: boolean
type: object
serviceAccountName:
description: ServiceAccountName is the name of the ServiceAccount used
to run the Pods. If left blank, a default ServiceAccount is created
with the same name as the Nexus CR (`metadata.name`).
type: string
useRedHatImage:
description: If you have access to Red Hat Container Catalog, set this
to `true` to use the certified image provided by Sonatype Defaults
to `false`
type: boolean
required:
- persistence
- replicas
- useRedHatImage
type: object
status:
description: NexusStatus defines the observed state of Nexus
properties:
deploymentStatus:
description: Condition status for the Nexus deployment
properties:
availableReplicas:
description: Total number of available pods (ready for at least
minReadySeconds) targeted by this deployment.
format: int32
type: integer
collisionCount:
description: Count of hash collisions for the Deployment. The Deployment
controller uses this field as a collision avoidance mechanism
when it needs to create the name for the newest ReplicaSet.
format: int32
type: integer
conditions:
description: Represents the latest available observations of a deployment's
current state.
items:
description: DeploymentCondition describes the state of a deployment
at a certain point.
properties:
lastTransitionTime:
description: Last time the condition transitioned from one
status to another.
format: date-time
type: string
lastUpdateTime:
description: The last time this condition was updated.
format: date-time
type: string
message:
description: A human readable message indicating details about
the transition.
type: string
reason:
description: The reason for the condition's last transition.
type: string
status:
description: Status of the condition, one of True, False,
Unknown.
type: string
type:
description: Type of deployment condition.
type: string
required:
- status
- type
type: object
type: array
observedGeneration:
description: The generation observed by the deployment controller.
format: int64
type: integer
readyReplicas:
description: Total number of ready pods targeted by this deployment.
format: int32
type: integer
replicas:
description: Total number of non-terminated pods targeted by this
deployment (their labels match the selector).
format: int32
type: integer
unavailableReplicas:
description: Total number of unavailable pods targeted by this deployment.
This is the total number of pods that are still required for the
deployment to have 100% available capacity. They may either be
pods that are running but not yet available or pods that still
have not been created.
format: int32
type: integer
updatedReplicas:
description: Total number of non-terminated pods targeted by this
deployment that have the desired template spec.
format: int32
type: integer
type: object
nexusRoute:
description: Route for external service access
type: string
nexusStatus:
description: Will be "OK" when this Nexus instance is up
type: string
reason:
description: Gives more information about a failure status
type: string
serverOperationsStatus:
description: ServerOperationsStatus describes the general status for
the operations performed in the Nexus server instance
properties:
communityRepositoriesCreated:
type: boolean
mavenCentralUpdated:
type: boolean
mavenPublicURL:
type: string
operatorUserCreated:
type: boolean
reason:
type: string
serverReady:
type: boolean
type: object
updateConditions:
description: Conditions reached during an update
items:
type: string
type: array
x-kubernetes-list-type: atomic
type: object
type: object
version: v1alpha1
versions:
- name: v1alpha1
served: true
storage: true
status:
acceptedNames:
kind: ""
plural: ""
conditions: []
storedVersions: []
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: nexus-operator-leader-election-role
namespace: nexus-operator-system
rules:
- apiGroups:
- ""
resources:
- configmaps
verbs:
- get
- list
- watch
- create
- update
- patch
- delete
- apiGroups:
- ""
resources:
- configmaps/status
verbs:
- get
- update
- patch
- apiGroups:
- ""
resources:
- events
verbs:
- create
- patch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
creationTimestamp: null
name: nexus-operator-manager-role
rules:
- apiGroups:
- apps
resources:
- deployments
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- apps
resources:
- deployments/finalizers
verbs:
- update
- apiGroups:
- apps
resources:
- replicasets
verbs:
- get
- apiGroups:
- apps.m88i.io
resources:
- nexus
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- apps.m88i.io
resources:
- nexus/finalizers
verbs:
- get
- patch
- update
- apiGroups:
- apps.m88i.io
resources:
- nexus/status
verbs:
- get
- patch
- update
- apiGroups:
- ""
resources:
- configmaps
verbs:
- create
- get
- apiGroups:
- ""
resources:
- events
- persistentvolumeclaims
- secrets
- serviceaccounts
- services
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- apiGroups:
- monitoring.coreos.com
resources:
- servicemonitors
verbs:
- create
- get
- apiGroups:
- networking.k8s.io
resources:
- ingresses
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- route.openshift.io
resources:
- routes
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: nexus-operator-proxy-role
rules:
- apiGroups:
- authentication.k8s.io
resources:
- tokenreviews
verbs:
- create
- apiGroups:
- authorization.k8s.io
resources:
- subjectaccessreviews
verbs:
- create
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole
metadata:
name: nexus-operator-metrics-reader
rules:
- nonResourceURLs:
- /metrics
verbs:
- get
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: nexus-operator-leader-election-rolebinding
namespace: nexus-operator-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: nexus-operator-leader-election-role
subjects:
- kind: ServiceAccount
name: default
namespace: nexus-operator-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: nexus-operator-manager-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: nexus-operator-manager-role
subjects:
- kind: ServiceAccount
name: default
namespace: nexus-operator-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: nexus-operator-proxy-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: nexus-operator-proxy-role
subjects:
- kind: ServiceAccount
name: default
namespace: nexus-operator-system
---
apiVersion: v1
kind: Service
metadata:
labels:
control-plane: controller-manager
name: nexus-operator-controller-manager-metrics-service
namespace: nexus-operator-system
spec:
ports:
- name: https
port: 8443
targetPort: https
selector:
control-plane: controller-manager
---
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
control-plane: controller-manager
name: nexus-operator-controller-manager
namespace: nexus-operator-system
spec:
replicas: 1
selector:
matchLabels:
control-plane: controller-manager
template:
metadata:
labels:
control-plane: controller-manager
spec:
containers:
- args:
- --secure-listen-address=0.0.0.0:8443
- --upstream=http://127.0.0.1:8080/
- --logtostderr=true
- --v=10
image: gcr.io/kubebuilder/kube-rbac-proxy:v0.5.0
name: kube-rbac-proxy
ports:
- containerPort: 8443
name: https
- args:
- --metrics-addr=127.0.0.1:8080
- --enable-leader-election
command:
- /manager
image: quay.io/m88i/nexus-operator:0.5.0
name: manager
resources:
requests:
cpu: 100m
memory: 20Mi
terminationGracePeriodSeconds: 10
---
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
labels:
control-plane: controller-manager
name: nexus-operator-controller-manager-metrics-monitor
namespace: nexus-operator-system
spec:
endpoints:
- path: /metrics
port: https
selector:
matchLabels:
control-plane: controller-manager