Compare commits
91 Commits
NEXUS-3484
...
NEXUS-3620
Author | SHA1 | Date | |
---|---|---|---|
![]() |
3bafb6516c | ||
![]() |
0d832f8909 | ||
![]() |
1207dee299 | ||
![]() |
14472c593b | ||
![]() |
85adad84ef | ||
![]() |
c8b1ad3059 | ||
![]() |
7dd8cd5112 | ||
![]() |
5db6031514 | ||
![]() |
70d639ca4e | ||
![]() |
95b8a984ca | ||
![]() |
3f0979d531 | ||
![]() |
c164995fbf | ||
![]() |
3a22af41bd | ||
![]() |
59e8ebcd98 | ||
![]() |
5d0bfa8e4e | ||
![]() |
4b4bbd13f3 | ||
![]() |
77aac91a9f | ||
![]() |
0c51e4c7be | ||
![]() |
0adb4a9fc7 | ||
![]() |
1a821d1032 | ||
![]() |
1fa72df38c | ||
![]() |
8123c3db21 | ||
![]() |
595206fdc9 | ||
![]() |
7d1dfaa1bd | ||
![]() |
de46a3ca1f | ||
![]() |
298a49e994 | ||
![]() |
786e5717d2 | ||
![]() |
6ed696ec15 | ||
![]() |
e82e7a3208 | ||
![]() |
d9da79bb8d | ||
![]() |
670344d45a | ||
![]() |
b5168a2dc3 | ||
![]() |
96b919241d | ||
![]() |
5410733d72 | ||
![]() |
1b4585d89c | ||
![]() |
4b91e48ef5 | ||
![]() |
02c19b39ee | ||
![]() |
f351b8e244 | ||
![]() |
4902991b0c | ||
![]() |
0734d746eb | ||
![]() |
c7c527174f | ||
![]() |
595db96ef1 | ||
![]() |
97dfe39202 | ||
![]() |
10ee4a5efb | ||
![]() |
1e5ce73111 | ||
![]() |
862f179251 | ||
![]() |
769c3b7f7c | ||
![]() |
e3af231002 | ||
![]() |
a0318927b0 | ||
![]() |
702f846cb2 | ||
![]() |
53b1ba9fcb | ||
![]() |
1cddb6982b | ||
![]() |
cc34987953 | ||
![]() |
d6ac3edf71 | ||
![]() |
9c80534bd0 | ||
![]() |
d90c7f36e8 | ||
![]() |
6e1c74c877 | ||
![]() |
b3785cf228 | ||
![]() |
6dd1b3c662 | ||
![]() |
a40171ae42 | ||
![]() |
c55540bcc7 | ||
![]() |
5c359b9c2c | ||
![]() |
737c1fdc07 | ||
![]() |
662f32ab62 | ||
![]() |
694a919144 | ||
![]() |
4f6f86c972 | ||
![]() |
073dc3d51d | ||
![]() |
526fb55499 | ||
![]() |
a7feecb463 | ||
![]() |
e5abf26148 | ||
![]() |
6238cb0609 | ||
![]() |
80cbc2c1b2 | ||
![]() |
dce7ce20b4 | ||
![]() |
e1a1b9baed | ||
![]() |
af6729642c | ||
![]() |
e33e0077b2 | ||
![]() |
93553957c5 | ||
![]() |
5ee93839e4 | ||
![]() |
6ec044c09b | ||
![]() |
24ee4fc9ed | ||
![]() |
9979f3623f | ||
![]() |
b5ef7c6481 | ||
![]() |
191c271e35 | ||
![]() |
f60bc6237d | ||
![]() |
4c6584ed83 | ||
![]() |
5c5e88f8f1 | ||
![]() |
3ddd0ba925 | ||
![]() |
9e7106f9d1 | ||
![]() |
a6a8a3c60f | ||
![]() |
9fd454a8dd | ||
![]() |
f3c87e8d32 |
6
.gitignore
vendored
Normal file
6
.gitignore
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
.vs/**
|
||||
.idea/**
|
||||
|
||||
**/test-output.xml
|
||||
|
||||
.DS_Store
|
25
Dockerfile
25
Dockerfile
@@ -1,17 +1,20 @@
|
||||
#
|
||||
# Copyright (c) 2019-present Sonatype, Inc. All rights reserved.
|
||||
# Includes the third-party code listed at http://links.sonatype.com/products/clm/attributions.
|
||||
# "Sonatype" is a trademark of Sonatype, Inc.
|
||||
# Sonatype Nexus (TM) Open Source Version
|
||||
# Copyright (c) 2008-present Sonatype, Inc.
|
||||
# All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions.
|
||||
#
|
||||
# This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0,
|
||||
# which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html.
|
||||
#
|
||||
# Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks
|
||||
# of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
|
||||
# Eclipse Foundation. All other trademarks are the property of their respective owners.
|
||||
#
|
||||
|
||||
# FROM docker-all.repo.sonatype.com/alpine:latest
|
||||
# LABEL maintainer="operations-group@sontype.com"
|
||||
FROM docker-all.repo.sonatype.com/alpine/helm:3.10.1
|
||||
|
||||
# RUN apk update
|
||||
RUN apk update && apk upgrade && \
|
||||
apk add --no-cache bash git openssh
|
||||
|
||||
# WORKDIR /app
|
||||
# COPY ./src ./
|
||||
RUN mkdir /.local /.cache && chmod 777 /.local /.cache
|
||||
|
||||
# EXPOSE 8080
|
||||
|
||||
# CMD ["./runit"]
|
||||
|
31
Jenkinsfile
vendored
Normal file
31
Jenkinsfile
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Sonatype Nexus (TM) Open Source Version
|
||||
* Copyright (c) 2008-present Sonatype, Inc.
|
||||
* All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions.
|
||||
*
|
||||
* This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0,
|
||||
* which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html.
|
||||
*
|
||||
* Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks
|
||||
* of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
|
||||
* Eclipse Foundation. All other trademarks are the property of their respective owners.
|
||||
*/
|
||||
@Library(['private-pipeline-library', 'jenkins-shared', 'nxrm-jenkins-shared']) _
|
||||
|
||||
dockerizedBuildPipeline(
|
||||
prepare: {
|
||||
githubStatusUpdate('pending')
|
||||
},
|
||||
buildAndTest: {
|
||||
sh './build.sh'
|
||||
},
|
||||
skipVulnerabilityScan: true,
|
||||
archiveArtifacts: 'docs/*',
|
||||
testResults: ['**/test-output.xml'],
|
||||
onSuccess: {
|
||||
nxrmBuildNotifications(currentBuild, env)
|
||||
},
|
||||
onFailure: {
|
||||
nxrmBuildNotifications(currentBuild, env)
|
||||
}
|
||||
)
|
97
Jenkinsfile-Release
Normal file
97
Jenkinsfile-Release
Normal file
@@ -0,0 +1,97 @@
|
||||
/*
|
||||
* Copyright (c) 2020-present Sonatype, Inc. All rights reserved.
|
||||
*
|
||||
* This program is licensed to you under the Apache License Version 2.0,
|
||||
* and you may not use this file except in compliance with the Apache License Version 2.0.
|
||||
* You may obtain a copy of the Apache License Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0.
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the Apache License Version 2.0 is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the Apache License Version 2.0 for the specific language governing permissions and limitations there under.
|
||||
*/
|
||||
@Library(['private-pipeline-library', 'jenkins-shared', 'nxrm-jenkins-shared']) _
|
||||
|
||||
final jira = [
|
||||
versionPrefix: '', project: 'NEXUS', projectId: '12410',
|
||||
credentialId : 'jenkins-jira', autoRelease: true, failOnError: true
|
||||
]
|
||||
|
||||
properties([
|
||||
parameters([
|
||||
string(
|
||||
name: 'appVersion',
|
||||
description: 'Version of the application image, like "3.41.0"',
|
||||
),
|
||||
string(
|
||||
name: 'chartVersion',
|
||||
description: '(Optional) Version of the Chart, like "41.0.0". If omitted, it will be calculated from the appVersion.',
|
||||
),
|
||||
])
|
||||
])
|
||||
|
||||
final chartVersion = calculateChartVersion(params.chartVersion, params.appVersion)
|
||||
|
||||
dockerizedBuildPipeline(
|
||||
prepare: {
|
||||
if (! params.appVersion) {
|
||||
error('The appVersion is required.')
|
||||
}
|
||||
githubStatusUpdate('pending')
|
||||
},
|
||||
buildAndTest: {
|
||||
sonatypeZionGitConfig()
|
||||
runSafely "git checkout ${gitBranch(env)}"
|
||||
runSafely "./upgrade.sh ./nexus-repository-manager ${chartVersion} ${params.appVersion}"
|
||||
runSafely "./upgrade.sh ./nxrm-aws-resiliency ${chartVersion} ${params.appVersion}"
|
||||
runSafely './build.sh'
|
||||
runSafely 'git add nxrm-aws-resiliency'
|
||||
runSafely 'git add nexus-repository-manager'
|
||||
},
|
||||
skipVulnerabilityScan: true,
|
||||
archiveArtifacts: 'docs/*',
|
||||
testResults: [],
|
||||
deployCondition: { true },
|
||||
deploy: {
|
||||
runSafely 'git add docs'
|
||||
runSafely "git commit -m 'Release Update for ${chartVersion}'"
|
||||
|
||||
sshagent(credentials: [sonatypeZionCredentialsId()]) {
|
||||
runSafely 'git push'
|
||||
}
|
||||
},
|
||||
postDeploy: {
|
||||
// Create tags
|
||||
String tagName = "${chartVersion}"
|
||||
runSafely "git tag -a ${tagName} -m 'Release Update: ${chartVersion}'"
|
||||
sshagent(credentials: [sonatypeZionCredentialsId()]) {
|
||||
runSafely "git push origin ${tagName}"
|
||||
}
|
||||
},
|
||||
onSuccess: {
|
||||
nxrmBuildNotifications(currentBuild, env)
|
||||
},
|
||||
onFailure: {
|
||||
nxrmBuildNotifications(currentBuild, env)
|
||||
}
|
||||
)
|
||||
|
||||
String calculateChartVersion(final String chartVersion, final String appVersion) {
|
||||
if (chartVersion) {
|
||||
return chartVersion
|
||||
}
|
||||
|
||||
if (! appVersion) {
|
||||
error 'Failed to calculate chartVersion with no appVersion.'
|
||||
}
|
||||
|
||||
final versionParts = parseVersionString(appVersion)
|
||||
final chartMajor = versionParts[1]
|
||||
final chartMinor = versionParts[2]
|
||||
|
||||
if (! chartMajor || ! chartMinor) {
|
||||
error "Failed to calculate chartVersion from appVersion: ${appVersion}"
|
||||
}
|
||||
|
||||
return [chartMajor, chartMinor, '0'].join('.')
|
||||
}
|
28
LICENSE
28
LICENSE
@@ -1,21 +1,13 @@
|
||||
MIT License
|
||||
Copyright (c) 2020-present Sonatype, Inc.
|
||||
|
||||
Copyright (c) 2020 Sonatype
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
65
OPSDOC.md
65
OPSDOC.md
@@ -1,65 +0,0 @@
|
||||
<!--
|
||||
Copyright (c) 2019-present Sonatype, Inc. All rights reserved.
|
||||
Includes the third-party code listed at http://links.sonatype.com/products/clm/attributions.
|
||||
"Sonatype" is a trademark of Sonatype, Inc.
|
||||
-->
|
||||
|
||||
## Overview
|
||||
Overview of the service: what is it, why do we have it, who are the primary
|
||||
contacts, how to report bugs, links to design docs and other relevant
|
||||
information.
|
||||
|
||||
### Public Facing Endpoints
|
||||
The URLs (or IPs) and ports used by the service and what they are used for
|
||||
(ALB? SSH? FTP?) and notes about any certificates and their location.
|
||||
|
||||
## Monitoring
|
||||
|
||||
Monitoring dashboards / logging / introspection & obseverbility info.
|
||||
|
||||
### Runbooks
|
||||
|
||||
A list of every alert your monitoring system may generate for this service and
|
||||
a step-by-step "what do to when..." for each of them.
|
||||
|
||||
### SLO
|
||||
Service Level Objectives in a succinct format: a target value or range of
|
||||
values for a service level that is measured by an SLI. A natural structure for
|
||||
SLOs is thus SLI ≤ target, or lower bound ≤ SLI ≤ upper bound. For example, we
|
||||
might decide that we will return Shakespeare search results "quickly," adopting
|
||||
an SLO that our average search request latency should be less than 100
|
||||
milliseconds.
|
||||
|
||||
For more detailed information, please check out the Service Level Objectives
|
||||
doc. If you're still unsure of what your SLOs should be, please reach out to
|
||||
the SREs at #ops-sre-chat.
|
||||
|
||||
Optionally but recommended, have a section of monitoring and dashboards for SLO
|
||||
tracking (see the auth-service OpsDoc for examples of dashboards).
|
||||
|
||||
## Build
|
||||
|
||||
How to build the software that makes the service. Where to download it from,
|
||||
where the source code repository is, steps for building and making a package or
|
||||
other distribution mechanisms. If it is software that you modify in any way
|
||||
(open source project you contribute to or a local project) include instructions
|
||||
for how a new developer gets started. Ideally the end result is a package that
|
||||
can be copied to other machines for installation.
|
||||
|
||||
## Deploy
|
||||
|
||||
How to deploy the service. How to build something from scratch: RAM/disk
|
||||
requirements, OS version and configuration, what packages to install, and so
|
||||
on. If this is automated with a configuration management tool like ansible/etc,
|
||||
then say so.
|
||||
|
||||
## Common Tasks
|
||||
|
||||
Step-by-step instructions for common things like provisioning
|
||||
(add/change/delete), common problems and their solutions, and so on.
|
||||
|
||||
## DR
|
||||
Where are backups of data stored? What are disaster / data recovery
|
||||
procedures?
|
||||
|
||||
|
22
README.md
22
README.md
@@ -1,13 +1,31 @@
|
||||
<!--
|
||||
|
||||
Sonatype Nexus (TM) Open Source Version
|
||||
Copyright (c) 2008-present Sonatype, Inc.
|
||||
All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions.
|
||||
|
||||
This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0,
|
||||
which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html.
|
||||
|
||||
Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks
|
||||
of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
|
||||
Eclipse Foundation. All other trademarks are the property of their respective owners.
|
||||
|
||||
-->
|
||||
# ⚠️ Archive Notice
|
||||
|
||||
As of October 24, 2023, we will no longer update or support the [Single-Instance OSS/Pro Kubernetes Chart](https://github.com/sonatype/nxrm3-helm-repository/tree/main/nexus-repository-manager).
|
||||
|
||||
## Helm Charts for Sonatype Nexus Repository Manager 3
|
||||
|
||||
We provide Helm charts for two different deployment scenarios:
|
||||
|
||||
See the [AWS Single-Instance Resiliency Chart](./https://github.com/sonatype/nxrm3-helm-repository/tree/main/aws-single-instance-resiliency) if you are doing the following:
|
||||
See the [AWS Single-Instance Resiliency Chart](https://github.com/sonatype/nxrm3-helm-repository/tree/main/nxrm-aws-resiliency) if you are doing the following:
|
||||
* Deploying Nexus Repository Pro to an AWS cloud environment with the desire for automatic failover across Availability Zones (AZs) within a single region
|
||||
* Planning to configure a single Nexus Repository Pro instance within your Kubernetes/EKS cluster with two or more nodes spread across different AZs within an AWS region
|
||||
* Using an external PostgreSQL database (required)
|
||||
|
||||
See the [Single-Instance OSS/Pro Kubernetes Chart](./https://github.com/sonatype/nxrm3-helm-repository/tree/main/single-inst-oss-pro-kubernetes) if you are doing the following:
|
||||
See the [Single-Instance OSS/Pro Kubernetes Chart](https://github.com/sonatype/nxrm3-helm-repository/tree/main/nexus-repository-manager) if you are doing the following:
|
||||
* Using embedded OrientDB (required)
|
||||
* Deploying either Nexus Repository Pro or OSS to an on-premises environment with bare metal/VM server (Node)
|
||||
* Deploying a single Nexus Repository instance within a Kubernetes cluster that has a single Node configured
|
||||
|
14
SECURITY.md
14
SECURITY.md
@@ -1,11 +1,17 @@
|
||||
<!--
|
||||
|
||||
Copyright (c) 2019-present Sonatype, Inc. All rights reserved.
|
||||
Includes the third-party code listed at http://links.sonatype.com/products/clm/attributions.
|
||||
"Sonatype" is a trademark of Sonatype, Inc.
|
||||
Sonatype Nexus (TM) Open Source Version
|
||||
Copyright (c) 2008-present Sonatype, Inc.
|
||||
All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions.
|
||||
|
||||
This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0,
|
||||
which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html.
|
||||
|
||||
Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks
|
||||
of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
|
||||
Eclipse Foundation. All other trademarks are the property of their respective owners.
|
||||
|
||||
-->
|
||||
|
||||
# Reporting Security Vulnerabilities
|
||||
|
||||
## When to report
|
||||
|
@@ -1,21 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 Sonatype
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
@@ -1,28 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: {{ .Chart.Name }}-{{ .Chart.Version }}.{{ .Release.Name }}-ebs-pv
|
||||
spec:
|
||||
capacity:
|
||||
storage: {{ .Values.pv.storage }}
|
||||
volumeMode: Filesystem
|
||||
accessModes:
|
||||
- {{ .Values.pv.accessModes }}
|
||||
persistentVolumeReclaimPolicy: {{ .Values.pv.reclaimPolicy }}
|
||||
storageClassName: local-storage
|
||||
local:
|
||||
path: {{ .Values.pv.path }}
|
||||
nodeAffinity:
|
||||
required:
|
||||
nodeSelectorTerms:
|
||||
- matchExpressions:
|
||||
- key: topology.kubernetes.io/zone
|
||||
operator: In
|
||||
values:
|
||||
{{- range $zone := .Values.pv.zones }}
|
||||
- {{ $zone }}
|
||||
{{- end }}
|
||||
|
||||
|
||||
|
||||
|
@@ -1,12 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: {{ .Chart.Name }}-{{ .Chart.Version }}.{{ .Release.Name }}-ebs-claim
|
||||
namespace: {{ .Values.namespaces.nexusNs }}
|
||||
spec:
|
||||
accessModes:
|
||||
- {{ .Values.pvc.accessModes }}
|
||||
storageClassName: local-storage
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.pvc.storage }}
|
@@ -1,7 +0,0 @@
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ .Values.serviceAccount.name }}
|
||||
namespace: {{ .Values.namespaces.nexusNs }}
|
||||
annotations:
|
||||
eks.amazonaws.com/role-arn: {{ .Values.serviceAccount.role }}
|
@@ -1,7 +0,0 @@
|
||||
apiVersion: storage.k8s.io/v1
|
||||
kind: StorageClass
|
||||
metadata:
|
||||
name: {{ .Chart.Name }}-{{ .Chart.Version }}.{{ .Release.Name }}-local-storage
|
||||
namespace: {{ .Values.namespaces.nexusNs }}
|
||||
provisioner: kubernetes.io/no-provisioner
|
||||
volumeBindingMode: WaitForFirstConsumer
|
@@ -1,79 +0,0 @@
|
||||
# Declare variables to be passed into your templates.
|
||||
namespaces:
|
||||
nexusNs: nexusrepo
|
||||
cloudwatchNs: amazon-cloudwatch
|
||||
deployment:
|
||||
name: nxrm.deployment
|
||||
clusterName: nxrm-nexus
|
||||
logsRegion: us-east-1
|
||||
initContainer:
|
||||
image:
|
||||
repository: busybox
|
||||
tag: 1.33.1
|
||||
container:
|
||||
image:
|
||||
repository: sonatype/nexus3
|
||||
tag: 3.41.1
|
||||
containerPort: 8081
|
||||
pullPolicy: IfNotPresent
|
||||
env:
|
||||
nexusDBName: nexus
|
||||
nexusDBPort: 3306
|
||||
requestLogContainer:
|
||||
image:
|
||||
repository: busybox
|
||||
tag: 1.33.1
|
||||
auditLogContainer:
|
||||
image:
|
||||
repository: busybox
|
||||
tag: 1.33.1
|
||||
taskLogContainer:
|
||||
image:
|
||||
repository: busybox
|
||||
tag: 1.33.1
|
||||
serviceAccount:
|
||||
name: nexus-repository-deployment-sa #This SA is created as part of steps under "AWS Secrets Manager"
|
||||
role: arn:aws:iam::000000000000:role/nxrm-nexus-role #Role with secretsmanager permissions
|
||||
ingress:
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: alb
|
||||
alb.ingress.kubernetes.io/scheme: internal # scheme
|
||||
alb.ingress.kubernetes.io/subnets: subnet-1,subnet-2 #comma separated list of subnet ids
|
||||
dockerIngress: #Ingress for Docker Connector
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: alb
|
||||
alb.ingress.kubernetes.io/scheme: internal # scheme
|
||||
alb.ingress.kubernetes.io/subnets: subnet-1,subnet-2 #comma separated list of subnet ids
|
||||
port: 9090
|
||||
pv:
|
||||
storage: 120Gi
|
||||
volumeMode: Filesystem
|
||||
accessModes: ReadWriteOnce
|
||||
reclaimPolicy: Retain
|
||||
path: /mnt
|
||||
zones:
|
||||
zone1: us-east-1a
|
||||
zone2: us-east-1b
|
||||
pvc:
|
||||
accessModes: ReadWriteOnce
|
||||
storage: 100Gi
|
||||
|
||||
service: #Nexus Repo NodePort Service
|
||||
nexus:
|
||||
type: NodePort
|
||||
protocol: TCP
|
||||
port: 80
|
||||
targetPort: 8081
|
||||
docker: #Nodeport Service for Docker connector
|
||||
type: NodePort
|
||||
protocol: TCP
|
||||
port: 9090
|
||||
targetPort: 9090
|
||||
secret:
|
||||
license:
|
||||
arn: arn:aws:secretsmanager:us-east-1:000000000000:secret:nxrm-nexus-license
|
||||
alias: nxrm-license.lic
|
||||
rds:
|
||||
arn: arn:aws:secretsmanager:us-east-1:000000000000:secret:nxrmrds-cred-nexus
|
||||
adminpassword:
|
||||
arn: arn:aws:secretsmanager:us-east-1:000000000000:secret:admin-nxrm-password
|
29
build.sh
Executable file
29
build.sh
Executable file
@@ -0,0 +1,29 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Sonatype Nexus (TM) Open Source Version
|
||||
# Copyright (c) 2008-present Sonatype, Inc.
|
||||
# All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions.
|
||||
#
|
||||
# This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0,
|
||||
# which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html.
|
||||
#
|
||||
# Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks
|
||||
# of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
|
||||
# Eclipse Foundation. All other trademarks are the property of their respective owners.
|
||||
#
|
||||
|
||||
helm plugin install https://github.com/quintush/helm-unittest
|
||||
|
||||
set -e
|
||||
|
||||
# lint yaml of charts
|
||||
helm lint ./nxrm-aws-resiliency
|
||||
helm lint ./nexus-repository-manager
|
||||
|
||||
# unit test
|
||||
(cd ./nxrm-aws-resiliency; helm unittest -3 -t junit -o test-output.xml .)
|
||||
(cd ./nexus-repository-manager; helm unittest -3 -t junit -o test-output.xml .)
|
||||
|
||||
# package the charts into tgz archives
|
||||
helm package ./nxrm-aws-resiliency --destination docs
|
||||
helm package ./nexus-repository-manager --destination docs
|
BIN
docs/nexus-repository-manager-42.0.0.tgz
Normal file
BIN
docs/nexus-repository-manager-42.0.0.tgz
Normal file
Binary file not shown.
BIN
docs/nexus-repository-manager-42.0.1.tgz
Normal file
BIN
docs/nexus-repository-manager-42.0.1.tgz
Normal file
Binary file not shown.
BIN
docs/nexus-repository-manager-43.0.0.tgz
Normal file
BIN
docs/nexus-repository-manager-43.0.0.tgz
Normal file
Binary file not shown.
BIN
docs/nxrm-aws-resiliency-41.1.0.tgz
Normal file
BIN
docs/nxrm-aws-resiliency-41.1.0.tgz
Normal file
Binary file not shown.
BIN
docs/nxrm-aws-resiliency-41.1.1.tgz
Normal file
BIN
docs/nxrm-aws-resiliency-41.1.1.tgz
Normal file
Binary file not shown.
BIN
docs/nxrm-aws-resiliency-41.1.2.tgz
Normal file
BIN
docs/nxrm-aws-resiliency-41.1.2.tgz
Normal file
Binary file not shown.
BIN
docs/nxrm-aws-resiliency-41.1.3.tgz
Normal file
BIN
docs/nxrm-aws-resiliency-41.1.3.tgz
Normal file
Binary file not shown.
BIN
docs/nxrm-aws-resiliency-42.0.0.tgz
Normal file
BIN
docs/nxrm-aws-resiliency-42.0.0.tgz
Normal file
Binary file not shown.
BIN
docs/nxrm-aws-resiliency-42.0.1.tgz
Normal file
BIN
docs/nxrm-aws-resiliency-42.0.1.tgz
Normal file
Binary file not shown.
BIN
docs/nxrm-aws-resiliency-43.0.0.tgz
Normal file
BIN
docs/nxrm-aws-resiliency-43.0.0.tgz
Normal file
Binary file not shown.
13
header.txt
13
header.txt
@@ -1,3 +1,10 @@
|
||||
Copyright (c) 2019-present Sonatype, Inc. All rights reserved.
|
||||
Includes the third-party code listed at http://links.sonatype.com/products/clm/attributions.
|
||||
"Sonatype" is a trademark of Sonatype, Inc.
|
||||
Sonatype Nexus (TM) Open Source Version
|
||||
Copyright (c) 2008-present Sonatype, Inc.
|
||||
All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions.
|
||||
|
||||
This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0,
|
||||
which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html.
|
||||
|
||||
Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks
|
||||
of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
|
||||
Eclipse Foundation. All other trademarks are the property of their respective owners.
|
||||
|
24
nexus-repository-manager/.helmignore
Normal file
24
nexus-repository-manager/.helmignore
Normal file
@@ -0,0 +1,24 @@
|
||||
# Patterns to ignore when building packages.
|
||||
# This supports shell glob matching, relative path matching, and
|
||||
# negation (prefixed with !). Only one pattern per line.
|
||||
.DS_Store
|
||||
# Common VCS dirs
|
||||
.git/
|
||||
.gitignore
|
||||
.bzr/
|
||||
.bzrignore
|
||||
.hg/
|
||||
.hgignore
|
||||
.svn/
|
||||
# Common backup files
|
||||
*.swp
|
||||
*.bak
|
||||
*.tmp
|
||||
*~
|
||||
# Various IDEs
|
||||
.project
|
||||
.idea/
|
||||
*.tmproj
|
||||
# OWNERS file for Kubernetes
|
||||
OWNERS
|
||||
*.tar
|
@@ -3,10 +3,10 @@ name: nexus-repository-manager
|
||||
|
||||
# This is the chart version. This version number should be incremented each time you make changes
|
||||
# to the chart and its templates, including the app version.
|
||||
version: 38.1.0
|
||||
version: 43.0.0
|
||||
# This is the version number of the application being deployed. This version number should be
|
||||
# incremented each time you make changes to the application.
|
||||
appVersion: 3.38.1
|
||||
appVersion: 3.43.0
|
||||
|
||||
description: Sonatype Nexus Repository Manager - Universal Binary repository
|
||||
|
@@ -1,3 +1,21 @@
|
||||
<!--
|
||||
|
||||
Sonatype Nexus (TM) Open Source Version
|
||||
Copyright (c) 2008-present Sonatype, Inc.
|
||||
All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions.
|
||||
|
||||
This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0,
|
||||
which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html.
|
||||
|
||||
Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks
|
||||
of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
|
||||
Eclipse Foundation. All other trademarks are the property of their respective owners.
|
||||
|
||||
-->
|
||||
# ⚠️ Archive Notice
|
||||
|
||||
As of October 24, 2023, we will no longer update or support this Helm chart.
|
||||
|
||||
# Nexus Repository
|
||||
|
||||
[Nexus Repository OSS](https://www.sonatype.com/nexus-repository-oss) provides universal support for all major build tools.
|
||||
@@ -52,14 +70,9 @@ Do not use this Helm chart and, instead, refer to our [resiliency documentation]
|
||||
|
||||
By default, this Chart uses Sonatype's Public Docker image. If you want to use a different image, run with the following: `--set nexus.imageName=<my>/<image>`.
|
||||
|
||||
### With Red Hat Certified container
|
||||
## Adding the Sonatype Repository to your Helm
|
||||
|
||||
If you're looking run our Certified Red Hat image in an OpenShift4 environment, there is a Certified Operator in OperatorHub.
|
||||
|
||||
---
|
||||
|
||||
## Adding the repo
|
||||
To add as a Helm Repo, use the following:
|
||||
To add as a Helm Repo
|
||||
```helm repo add sonatype https://sonatype.github.io/helm3-charts/```
|
||||
|
||||
---
|
||||
@@ -96,6 +109,7 @@ The default login is randomized and can be found in `/nexus-data/admin.password`
|
||||
by setting the environment variable `NEXUS_SECURITY_RANDOMPASSWORD` to `false` in your `values.yaml`.
|
||||
|
||||
---
|
||||
|
||||
## Uninstalling the Chart
|
||||
|
||||
To uninstall/delete the deployment, use the following:
|
||||
@@ -118,16 +132,16 @@ The following table lists the configurable parameters of the Nexus chart and the
|
||||
| Parameter | Description | Default |
|
||||
|--------------------------------------------|----------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
| `deploymentStrategy` | Deployment Strategy | `Recreate` |
|
||||
| `nexus.imagePullPolicy` | Nexus Repository image pull policy | `IfNotPresent` |
|
||||
| `nexus.imagePullSecrets` | Secret to download Nexus Repository image from private registry | `nil` |
|
||||
| `nexus.imagePullPolicy` | Nexus Repository image pull policy | `IfNotPresent` |
|
||||
| `imagePullSecrets` | The names of the kubernetes secrets with credentials to login to a registry | `[]` |
|
||||
| `nexus.docker.enabled` | Enable/disable Docker support | `false` |
|
||||
| `nexus.docker.registries` | Support multiple Docker registries | (see below) |
|
||||
| `nexus.docker.registries[0].host` | Host for the Docker registry | `cluster.local` |
|
||||
| `nexus.docker.registries[0].port` | Port for the Docker registry | `5000` |
|
||||
| `nexus.docker.registries[0].secretName` | TLS Secret Name for the ingress | `registrySecret` |
|
||||
| `nexus.env` | Nexus Repository environment variables | `[{INSTALL4J_ADD_VM_PARAMS: -Xms1200M -Xmx1200M -XX:MaxDirectMemorySize=2G -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap}]` |
|
||||
| `nexus.resources` | Nexus Repository resource requests and limits | `{}` |
|
||||
| `nexus.nexusPort` | Internal port for Nexus Repository service | `8081` |
|
||||
| `nexus.env` | Nexus Repository environment variables | `[{INSTALL4J_ADD_VM_PARAMS: -Xms1200M -Xmx1200M -XX:MaxDirectMemorySize=2G -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap}]` |
|
||||
| `nexus.resources` | Nexus Repository resource requests and limits | `{}` |
|
||||
| `nexus.nexusPort` | Internal port for Nexus Repository service | `8081` |
|
||||
| `nexus.securityContext` | Security Context (for enabling official image use `fsGroup: 2000`) | `{}` |
|
||||
| `nexus.labels` | Service labels | `{}` |
|
||||
| `nexus.podAnnotations` | Pod Annotations | `{}` |
|
||||
@@ -144,17 +158,17 @@ The following table lists the configurable parameters of the Nexus chart and the
|
||||
| `nexus.hostAliases` | Aliases for IPs in /etc/hosts | [] |
|
||||
| `nexus.properties.override` | Set to true to override default nexus.properties | `false` |
|
||||
| `nexus.properties.data` | A map of custom nexus properties if `override` is set to true | `nexus.scripts.allowCreation: true` |
|
||||
| `ingress.enabled` | Create an ingress for Nexus Repository | `true` |
|
||||
| `ingress.enabled` | Create an ingress for Nexus Repository | `false` |
|
||||
| `ingress.annotations` | Annotations to enhance ingress configuration | `{kubernetes.io/ingress.class: nginx}` |
|
||||
| `ingress.tls.secretName` | Name of the secret storing TLS cert, `false` to use the Ingress' default certificate | `nexus-tls` |
|
||||
| `ingress.path` | Path for ingress rules. GCP users should set to `/*`. | `/` |
|
||||
| `ingress.path` | Path for ingress rules. GCP users should set to `/*`. | `/` |
|
||||
| `tolerations` | tolerations list | `[]` |
|
||||
| `config.enabled` | Enable configmap | `false` |
|
||||
| `config.mountPath` | Path to mount the config | `/sonatype-nexus-conf` |
|
||||
| `config.data` | Configmap data | `nil` |
|
||||
| `deployment.annotations` | Annotations to enhance deployment configuration | `{}` |
|
||||
| `deployment.initContainers` | Init containers to run before main containers | `nil` |
|
||||
| `deployment.postStart.command` | Command to run after starting the container | `nil` |
|
||||
| `deployment.postStart.command` | Command to run after starting the container | `nil` |
|
||||
| `deployment.terminationGracePeriodSeconds` | Update termination grace period (in seconds) | 120s |
|
||||
| `deployment.additionalContainers` | Add additional Container | `nil` |
|
||||
| `deployment.additionalVolumes` | Add additional Volumes | `nil` |
|
||||
@@ -173,16 +187,44 @@ The following table lists the configurable parameters of the Nexus chart and the
|
||||
| `route.portName` | Target port name of service | `docker` |
|
||||
| `route.labels` | Labels to be added to route | `{}` |
|
||||
| `route.annotations` | Annotations to be added to route | `{}` |
|
||||
| `route.path` | Host name of Route e.g. jenkins.example.com | nil |
|
||||
| `route.path` | Host name of Route e.g. jenkins.example.com | nil |
|
||||
| `serviceAccount.create` | Set to true to create ServiceAccount | `true` |
|
||||
| `serviceAccount.annotations` | Set annotations for ServiceAccount | `{}` |
|
||||
| `serviceAccount.name` | The name of the service account to use. Auto-generate if not set and create is true. | `{}` |
|
||||
| `serviceAccount.name` | The name of the service account to use. Auto-generate if not set and create is true. | `{}` |
|
||||
| `persistence.enabled` | Set false to eliminate persistent storage | `true` |
|
||||
| `persistence.existingClaim` | Specify the name of an existing persistent volume claim to use instead of creating a new one | nil |
|
||||
| `persistence.storageSize` | Size of the storage the chart will request | `8Gi` |
|
||||
| `persistence.storageSize` | Size of the storage the chart will request | `8Gi` |
|
||||
|
||||
### Persistence
|
||||
|
||||
By default, a `PersistentVolumeClaim` is created and mounted into the `/nexus-data` directory. In order to disable this functionality, you can change the `values.yaml` to disable persistence, which will use an `emptyDir` instead.
|
||||
|
||||
> *"An emptyDir volume is first created when a Pod is assigned to a Node, and exists as long as that Pod is running on that node. When a Pod is removed from a node for any reason, the data in the emptyDir is deleted forever."*
|
||||
|
||||
## Using the Image from the Red Hat Registry
|
||||
|
||||
To use the [Nexus Repository Manager image available from Red Hat's registry](https://catalog.redhat.com/software/containers/sonatype/nexus-repository-manager/594c281c1fbe9847af657690),
|
||||
you'll need to:
|
||||
* Load the credentials for the registry as a secret in your cluster
|
||||
```shell
|
||||
kubectl create secret docker-registry redhat-pull-secret \
|
||||
--docker-server=registry.connect.redhat.com \
|
||||
--docker-username=<user_name> \
|
||||
--docker-password=<password> \
|
||||
--docker-email=<email>
|
||||
```
|
||||
See Red Hat's [Registry Authentication documentation](https://access.redhat.com/RegistryAuthentication)
|
||||
for further details.
|
||||
* Provide the name of the secret in `imagePullSecrets` in this chart's `values.yaml`
|
||||
```yaml
|
||||
imagePullSecrets:
|
||||
- name: redhat-pull-secret
|
||||
```
|
||||
* Set `image.name` and `image.tag` in `values.yaml`
|
||||
```yaml
|
||||
image:
|
||||
repository: registry.connect.redhat.com/sonatype/nexus-repository-server
|
||||
tag: 3.39.0-ubi-1
|
||||
```
|
||||
|
||||
---
|
@@ -48,7 +48,7 @@ spec:
|
||||
hostAliases:
|
||||
{{ toYaml .Values.nexus.hostAliases | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.nexus.imagePullSecrets }}
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
@@ -59,7 +59,14 @@ spec:
|
||||
- name: {{ .Chart.Name }}
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
|
||||
securityContext:
|
||||
allowPrivilegeEscalation: false
|
||||
runAsNonRoot: true
|
||||
seccompProfile:
|
||||
type: RuntimeDefault
|
||||
capabilities:
|
||||
drop:
|
||||
- ALL
|
||||
lifecycle:
|
||||
{{- if .Values.deployment.postStart.command }}
|
||||
postStart:
|
@@ -62,6 +62,9 @@ metadata:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if $.Values.ingress.ingressClassName }}
|
||||
ingressClassName: {{ $.Values.ingress.ingressClassName }}
|
||||
{{- end }}
|
||||
tls:
|
||||
- hosts:
|
||||
- {{ $registry.host | quote }}
|
@@ -36,7 +36,14 @@ tests:
|
||||
pattern: sonatype/nexus3:3\.\d+\.\d+
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].securityContext
|
||||
value: null
|
||||
value:
|
||||
allowPrivilegeEscalation: false
|
||||
capabilities:
|
||||
drop:
|
||||
- ALL
|
||||
runAsNonRoot: true
|
||||
seccompProfile:
|
||||
type: RuntimeDefault
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].imagePullPolicy
|
||||
value: IfNotPresent
|
||||
@@ -44,12 +51,17 @@ tests:
|
||||
path: spec.template.spec.containers[0].env
|
||||
value:
|
||||
- name: INSTALL4J_ADD_VM_PARAMS
|
||||
value: -Xms2703M -Xmx2703M -XX:MaxDirectMemorySize=2703M -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap
|
||||
value: |-
|
||||
-Xms2703M -Xmx2703M
|
||||
-XX:MaxDirectMemorySize=2703M
|
||||
-XX:+UnlockExperimentalVMOptions
|
||||
-XX:+UseCGroupMemoryLimitForHeap
|
||||
-Djava.util.prefs.userRoot=/nexus-data/javaprefs
|
||||
- name: NEXUS_SECURITY_RANDOMPASSWORD
|
||||
value: "true"
|
||||
- equal:
|
||||
path: spec.template.spec.containers[0].ports
|
||||
value:
|
||||
value:
|
||||
- containerPort: 8081
|
||||
name: nexus-ui
|
||||
- equal:
|
||||
@@ -83,3 +95,26 @@ tests:
|
||||
- name: nexus-repository-manager-data
|
||||
persistentVolumeClaim:
|
||||
claimName: RELEASE-NAME-nexus-repository-manager-data
|
||||
- equal:
|
||||
path: spec.template.spec.securityContext
|
||||
value:
|
||||
fsGroup: 200
|
||||
runAsGroup: 200
|
||||
runAsUser: 200
|
||||
|
||||
- it: should use our simple values
|
||||
template: deployment.yaml
|
||||
set:
|
||||
deploymentStrategy: my-strategy
|
||||
imagePullSecrets:
|
||||
- name: top-secret
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 1
|
||||
- equal:
|
||||
path: spec.strategy.type
|
||||
value: my-strategy
|
||||
- equal:
|
||||
path: spec.template.spec.imagePullSecrets
|
||||
value:
|
||||
- name: top-secret
|
@@ -1,3 +1,4 @@
|
||||
---
|
||||
suite: ingress
|
||||
templates:
|
||||
- ingress.yaml
|
||||
@@ -97,7 +98,105 @@ tests:
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: RELEASE-NAME-nexus-repository-manager
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec
|
||||
value:
|
||||
ingressClassName: nginx
|
||||
rules:
|
||||
- host: repo.demo
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: RELEASE-NAME-nexus-repository-manager
|
||||
port:
|
||||
number: 8081
|
||||
- documentIndex: 1
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: RELEASE-NAME-nexus-repository-manager-docker-5000
|
||||
- documentIndex: 1
|
||||
equal:
|
||||
path: spec
|
||||
value:
|
||||
ingressClassName: nginx
|
||||
rules:
|
||||
- host: docker.repo.demo
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: RELEASE-NAME-nexus-repository-manager-docker-5000
|
||||
port:
|
||||
number: 5000
|
||||
tls:
|
||||
- hosts:
|
||||
- docker.repo.demo
|
||||
secretName: registry-secret
|
||||
- it: we can exclude ingressClassName for repo ingress and docker ingress
|
||||
set:
|
||||
ingress:
|
||||
enabled: true
|
||||
ingressClassName: {}
|
||||
nexus:
|
||||
docker:
|
||||
enabled: true
|
||||
registries:
|
||||
- host: docker.repo.demo
|
||||
port: 5000
|
||||
secretName: registry-secret
|
||||
asserts:
|
||||
- hasDocuments:
|
||||
count: 2
|
||||
- isKind:
|
||||
of: Ingress
|
||||
- equal:
|
||||
path: apiVersion
|
||||
value: networking.k8s.io/v1
|
||||
- equal:
|
||||
path: metadata.labels.[app.kubernetes.io/instance]
|
||||
value: RELEASE-NAME
|
||||
- equal:
|
||||
path: metadata.labels.[app.kubernetes.io/managed-by]
|
||||
value: Helm
|
||||
- matchRegex:
|
||||
path: metadata.labels.[app.kubernetes.io/version]
|
||||
pattern: \d+\.\d+\.\d+
|
||||
- matchRegex:
|
||||
path: metadata.labels.[helm.sh/chart]
|
||||
pattern: nexus-repository-manager-\d+\.\d+\.\d+
|
||||
- equal:
|
||||
path: metadata.labels.[app.kubernetes.io/name]
|
||||
value: nexus-repository-manager
|
||||
- equal:
|
||||
path: metadata.annotations
|
||||
value:
|
||||
nginx.ingress.kubernetes.io/proxy-body-size: "0"
|
||||
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: metadata.name
|
||||
value: RELEASE-NAME-nexus-repository-manager
|
||||
- documentIndex: 0
|
||||
equal:
|
||||
path: spec
|
||||
value:
|
||||
rules:
|
||||
- host: repo.demo
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: RELEASE-NAME-nexus-repository-manager
|
||||
port:
|
||||
number: 8081
|
||||
- documentIndex: 1
|
||||
equal:
|
||||
path: metadata.name
|
||||
@@ -119,9 +218,8 @@ tests:
|
||||
number: 5000
|
||||
tls:
|
||||
- hosts:
|
||||
- docker.repo.demo
|
||||
- docker.repo.demo
|
||||
secretName: registry-secret
|
||||
|
||||
- it: is disabled by default
|
||||
asserts:
|
||||
- hasDocuments:
|
@@ -2,13 +2,16 @@
|
||||
statefulset:
|
||||
# This is not supported
|
||||
enabled: false
|
||||
# By default deploymentStrategy is set to rollingUpdate with maxSurge of 25% and maxUnavailable of 25% . you can change type to `Recreate` or can uncomment `rollingUpdate` specification and adjust them to your usage.
|
||||
deploymentStrategy: Recreate
|
||||
image:
|
||||
# Sonatype Official Public Image
|
||||
repository: sonatype/nexus3
|
||||
tag: 3.38.1
|
||||
tag: 3.43.0
|
||||
pullPolicy: IfNotPresent
|
||||
imagePullSecrets:
|
||||
# for image registries that require login, specify the name of the existing
|
||||
# kubernetes secret
|
||||
# - name: <pull-secret-name>
|
||||
|
||||
nexus:
|
||||
docker:
|
||||
@@ -16,12 +19,17 @@ nexus:
|
||||
# registries:
|
||||
# - host: chart.local
|
||||
# port: 5000
|
||||
# secretName: registrySecret
|
||||
# secretName: registry-secret
|
||||
env:
|
||||
# minimum recommended memory settings for a small, person instance from
|
||||
# https://help.sonatype.com/repomanager3/product-information/system-requirements
|
||||
- name: INSTALL4J_ADD_VM_PARAMS
|
||||
value: "-Xms2703M -Xmx2703M -XX:MaxDirectMemorySize=2703M -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap"
|
||||
value: |-
|
||||
-Xms2703M -Xmx2703M
|
||||
-XX:MaxDirectMemorySize=2703M
|
||||
-XX:+UnlockExperimentalVMOptions
|
||||
-XX:+UseCGroupMemoryLimitForHeap
|
||||
-Djava.util.prefs.userRoot=/nexus-data/javaprefs
|
||||
- name: NEXUS_SECURITY_RANDOMPASSWORD
|
||||
value: "true"
|
||||
properties:
|
||||
@@ -72,8 +80,6 @@ nexus:
|
||||
# - "example.com"
|
||||
# - "www.example.com"
|
||||
|
||||
|
||||
imagePullSecrets: []
|
||||
nameOverride: ""
|
||||
fullnameOverride: ""
|
||||
|
@@ -1,6 +1,6 @@
|
||||
apiVersion: v2
|
||||
name: nxrm-aws-resiliency
|
||||
description: Helm chart for a Resilient Nexus Repository deployment in AWS
|
||||
description: Resilient AWS Deployment of Sonatype Nexus Repository Manager - Universal Binary repository
|
||||
|
||||
# A chart can be either an 'application' or a 'library' chart.
|
||||
#
|
||||
@@ -15,10 +15,27 @@ type: application
|
||||
# This is the chart version. This version number should be incremented each time you make changes
|
||||
# to the chart and its templates, including the app version.
|
||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||
version: 41.1.0
|
||||
version: 43.0.0
|
||||
|
||||
# This is the version number of the application being deployed. This version number should be
|
||||
# incremented each time you make changes to the application. Versions are not expected to
|
||||
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||
# It is recommended to use it with quotes.
|
||||
appVersion: "3.41.1"
|
||||
appVersion: 3.43.0
|
||||
|
||||
keywords:
|
||||
- artifacts
|
||||
- dependency
|
||||
- management
|
||||
- sonatype
|
||||
- nexus
|
||||
- repository
|
||||
- quickstart
|
||||
- ci
|
||||
- repository-manager
|
||||
- nexus3
|
||||
home: https://www.sonatype.com/nexus-repository-oss
|
||||
icon: https://sonatype.github.io/helm3-charts/NexusRepo_Vertical.svg
|
||||
maintainers:
|
||||
- name: Sonatype
|
||||
|
13
nxrm-aws-resiliency/LICENSE
Normal file
13
nxrm-aws-resiliency/LICENSE
Normal file
@@ -0,0 +1,13 @@
|
||||
Copyright (c) 2020-present Sonatype, Inc.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
@@ -1,3 +1,18 @@
|
||||
<!--
|
||||
|
||||
Sonatype Nexus (TM) Open Source Version
|
||||
Copyright (c) 2008-present Sonatype, Inc.
|
||||
All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions.
|
||||
|
||||
This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0,
|
||||
which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html.
|
||||
|
||||
Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks
|
||||
of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
|
||||
Eclipse Foundation. All other trademarks are the property of their respective owners.
|
||||
|
||||
-->
|
||||
|
||||
# Helm Chart for a Resilient Nexus Repository Deployment in AWS
|
||||
|
||||
This Helm chart configures the Kubernetes resources that are needed for a resilient Nexus Repository deployment on AWS as described in our documented [single-node cloud resilient deployment example using AWS](https://help.sonatype.com/repomanager3/planning-your-implementation/resiliency-and-high-availability/single-node-cloud-resilient-deployment-example-using-aws).
|
||||
@@ -47,14 +62,110 @@ You will also need to complete the steps below. See the referenced AWS documenta
|
||||
|
||||
---
|
||||
|
||||
## External-dns
|
||||
|
||||
This helm chart uses [external-dns](https://github.com/kubernetes-sigs/external-dns) to create 'A' records in AWS Route 53 for our [Docker subdomain feature](https://help.sonatype.com/repomanager3/nexus-repository-administration/formats/docker-registry/docker-subdomain-connector).
|
||||
|
||||
See the ```external-dns.alpha.kubernetes.io/hostname``` annotation in the dockerIngress resource in the values.yaml.
|
||||
|
||||
### Permissions for external-dns
|
||||
|
||||
Open a terminal that has connectivity to your EKS cluster and run the following commands:
|
||||
```
|
||||
|
||||
cat <<'EOF' >> external-dns-r53-policy.json
|
||||
{
|
||||
"Version": "2012-10-17",
|
||||
"Statement": [
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Action": [
|
||||
"route53:ChangeResourceRecordSets"
|
||||
],
|
||||
"Resource": [
|
||||
"arn:aws:route53:::hostedzone/*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Action": [
|
||||
"route53:ListHostedZones",
|
||||
"route53:ListResourceRecordSets"
|
||||
],
|
||||
"Resource": [
|
||||
"*"
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
EOF
|
||||
|
||||
|
||||
aws iam create-policy --policy-name "AllowExternalDNSUpdates" --policy-document file://external-dns-r53-policy.json
|
||||
|
||||
|
||||
POLICY_ARN=$(aws iam list-policies --query 'Policies[?PolicyName==`AllowExternalDNSUpdates`].Arn' --output text)
|
||||
|
||||
|
||||
EKS_CLUSTER_NAME=<Your EKS Cluster Name>
|
||||
|
||||
|
||||
aws eks describe-cluster --name $EKS_CLUSTER_NAME --query "cluster.identity.oidc.issuer" --output text
|
||||
|
||||
|
||||
eksctl utils associate-iam-oidc-provider --cluster $EKS_CLUSTER_NAME --approve
|
||||
|
||||
ACCOUNT_ID=$(aws sts get-caller-identity --query "Account" --output text)
|
||||
OIDC_PROVIDER=$(aws eks describe-cluster --name $EKS_CLUSTER_NAME --query "cluster.identity.oidc.issuer" --output text | sed -e 's|^https://||')
|
||||
```
|
||||
|
||||
Note: The value you assign to the 'EXTERNALDNS_NS' variable below should be the same as the one you specify in your values.yaml for namespaces.externaldnsNs
|
||||
```
|
||||
EXTERNALDNS_NS=nexus-externaldns
|
||||
|
||||
cat <<-EOF > externaldns-trust.json
|
||||
{
|
||||
"Version": "2012-10-17",
|
||||
"Statement": [
|
||||
{
|
||||
"Effect": "Allow",
|
||||
"Principal": {
|
||||
"Federated": "arn:aws:iam::$ACCOUNT_ID:oidc-provider/$OIDC_PROVIDER"
|
||||
},
|
||||
"Action": "sts:AssumeRoleWithWebIdentity",
|
||||
"Condition": {
|
||||
"StringEquals": {
|
||||
"$OIDC_PROVIDER:sub": "system:serviceaccount:${EXTERNALDNS_NS}:external-dns",
|
||||
"$OIDC_PROVIDER:aud": "sts.amazonaws.com"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
EOF
|
||||
|
||||
IRSA_ROLE="nexusrepo-external-dns-irsa-role"
|
||||
aws iam create-role --role-name $IRSA_ROLE --assume-role-policy-document file://externaldns-trust.json
|
||||
aws iam attach-role-policy --role-name $IRSA_ROLE --policy-arn $POLICY_ARN
|
||||
|
||||
ROLE_ARN=$(aws iam get-role --role-name $IRSA_ROLE --query Role.Arn --output text)
|
||||
echo $ROLE_ARN
|
||||
```
|
||||
|
||||
2. Take note of the ROLE_ARN outputted last above and specify it in your values.yaml for serviceAccount.externaldns.role
|
||||
|
||||
## Deployment
|
||||
1. Pull the [nxrm-resiliency-aws-helmchart](https://github.com/sonatype/nxrm3-helm-repository/blob/main/aws-single-instance-resiliency/Chart.yaml).
|
||||
1. Add the sonatype repo to your helm:
|
||||
```helm repo add sonatype https://sonatype.github.io/helm3-charts/ ```
|
||||
2. Ensure you have updated your values.yaml with appropriate values for your environment.
|
||||
- Note that you can specify Ingress annotations via the values.yaml.
|
||||
- If you wish to add [Labels](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/), you can do so via kubectl. See the [kubectl Cheat Sheet](https://kubernetes.io/docs/reference/kubectl/cheatsheet/) for specific commands.
|
||||
|
||||
3. Install the chart using the following:
|
||||
|
||||
```helm install nxrm nexus/nxrm-aws-resiliency --values values.yaml```
|
||||
```helm install nxrm sonatype/nxrm-aws-resiliency -f values.yaml```
|
||||
|
||||
3. Get the Nexus Repository link using the following:
|
||||
4. Get the Nexus Repository link using the following:
|
||||
|
||||
```kubectl get ingresses -n nexusrepo```
|
||||
|
66
nxrm-aws-resiliency/templates/external-dns-rbac.yml
Normal file
66
nxrm-aws-resiliency/templates/external-dns-rbac.yml
Normal file
@@ -0,0 +1,66 @@
|
||||
# comment out sa if it was previously created
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: external-dns
|
||||
namespace: {{ .Values.namespaces.externaldnsNs }}
|
||||
labels:
|
||||
app.kubernetes.io/name: external-dns
|
||||
rules:
|
||||
- apiGroups: [""]
|
||||
resources: ["services","endpoints","pods","nodes"]
|
||||
verbs: ["get","watch","list"]
|
||||
- apiGroups: ["extensions","networking.k8s.io"]
|
||||
resources: ["ingresses"]
|
||||
verbs: ["get","watch","list"]
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: external-dns-viewer
|
||||
namespace: {{ .Values.namespaces.externaldnsNs }}
|
||||
labels:
|
||||
app.kubernetes.io/name: external-dns
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: external-dns
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ .Values.serviceAccount.externaldns.name }}
|
||||
namespace: {{ .Values.namespaces.externaldnsNs }}
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: external-dns
|
||||
namespace: {{ .Values.namespaces.externaldnsNs }}
|
||||
labels:
|
||||
app.kubernetes.io/name: external-dns
|
||||
spec:
|
||||
strategy:
|
||||
type: Recreate
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: external-dns
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: external-dns
|
||||
spec:
|
||||
serviceAccountName: external-dns
|
||||
containers:
|
||||
- name: external-dns
|
||||
image: k8s.gcr.io/external-dns/external-dns:v0.11.0
|
||||
args:
|
||||
- --source=service
|
||||
- --source=ingress
|
||||
- --domain-filter={{ .Values.externaldns.domainFilter }} # will make ExternalDNS see only the hosted zones matching provided domain, omit to process all available hosted zones
|
||||
- --provider=aws
|
||||
- --policy=upsert-only # would prevent ExternalDNS from deleting any records, omit to enable full synchronization
|
||||
- --aws-zone-type={{ .Values.externaldns.awsZoneType }} # only look at public hosted zones (valid values are public, private or no value for both)
|
||||
- --registry=txt
|
||||
- --txt-owner-id=external-dns
|
||||
env:
|
||||
- name: AWS_DEFAULT_REGION
|
||||
value: {{ .Values.statefulset.clusterRegion }}
|
@@ -39,12 +39,12 @@ metadata:
|
||||
name: fluent-bit-cluster-info
|
||||
namespace: {{ .Values.namespaces.cloudwatchNs }}
|
||||
data:
|
||||
cluster.name: {{ .Values.deployment.clusterName }}
|
||||
cluster.name: {{ .Values.statefulset.clusterName }}
|
||||
http.server: "On"
|
||||
http.port: "2020"
|
||||
read.head: "Off"
|
||||
read.tail: "On"
|
||||
logs.region: {{ .Values.deployment.logsRegion }}
|
||||
logs.region: {{ .Values.statefulset.logsRegion }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
@@ -77,7 +77,7 @@ data:
|
||||
[INPUT]
|
||||
Name tail
|
||||
Tag nexus.nexus-log
|
||||
Path /var/log/containers/{{ .Chart.Name }}-{{ .Chart.Version }}.{{ .Release.Name }}-nxrm.deployment-*-*_{{ .Values.namespaces.nexusNs }}_nxrm-app-*.log
|
||||
Path /var/log/containers/{{ .Chart.Name }}-{{ .Chart.Version | replace "." "-" }}-{{ .Release.Name }}-{{ .Values.statefulset.name }}*{{ .Values.namespaces.nexusNs }}_nxrm-app-*.log
|
||||
Parser docker
|
||||
DB /var/fluent-bit/state/flb_container.db
|
||||
Mem_Buf_Limit 5MB
|
||||
@@ -112,7 +112,7 @@ data:
|
||||
[INPUT]
|
||||
Name tail
|
||||
Tag nexus.request-log
|
||||
Path /var/log/containers/{{ .Chart.Name }}-{{ .Chart.Version }}.{{ .Release.Name }}-nxrm.deployment-*-*_{{ .Values.namespaces.nexusNs }}_request-log-*.log
|
||||
Path /var/log/containers/{{ .Chart.Name }}-{{ .Chart.Version | replace "." "-" }}-{{ .Release.Name }}-{{ .Values.statefulset.name }}*{{ .Values.namespaces.nexusNs }}_request-log-*.log
|
||||
Parser docker
|
||||
DB /var/fluent-bit/state/flb_container.db
|
||||
Mem_Buf_Limit 5MB
|
||||
@@ -147,7 +147,7 @@ data:
|
||||
[INPUT]
|
||||
Name tail
|
||||
Tag nexus.audit-log
|
||||
Path /var/log/containers/{{ .Chart.Name }}-{{ .Chart.Version }}.{{ .Release.Name }}-nxrm.deployment-*-*_{{ .Values.namespaces.nexusNs }}_audit-log-*.log
|
||||
Path /var/log/containers/{{ .Chart.Name }}-{{ .Chart.Version | replace "." "-" }}-{{ .Release.Name }}-{{ .Values.statefulset.name }}*{{ .Values.namespaces.nexusNs }}_audit-log-*.log
|
||||
Parser docker
|
||||
DB /var/fluent-bit/state/flb_container.db
|
||||
Mem_Buf_Limit 5MB
|
||||
@@ -182,7 +182,7 @@ data:
|
||||
[INPUT]
|
||||
Name tail
|
||||
Tag nexus.tasks-log
|
||||
Path /var/log/containers/{{ .Chart.Name }}-{{ .Chart.Version }}.{{ .Release.Name }}-nxrm.deployment-*-*_{{ .Values.namespaces.nexusNs }}_tasks-log-*.log
|
||||
Path /var/log/containers/{{ .Chart.Name }}-{{ .Chart.Version | replace "." "-" }}-{{ .Release.Name }}-{{ .Values.statefulset.name }}*{{ .Values.namespaces.nexusNs }}_tasks-log-*.log
|
||||
Parser docker
|
||||
DB /var/fluent-bit/state/flb_container.db
|
||||
Mem_Buf_Limit 5MB
|
||||
@@ -263,7 +263,7 @@ spec:
|
||||
spec:
|
||||
containers:
|
||||
- name: fluent-bit
|
||||
image: amazon/aws-for-fluent-bit:2.10.0
|
||||
image: amazon/aws-for-fluent-bit:{{ .Values.statefulset.fluentBitVersion }}
|
||||
imagePullPolicy: Always
|
||||
env:
|
||||
- name: AWS_REGION
|
@@ -9,7 +9,12 @@ metadata:
|
||||
{{- end }}
|
||||
spec:
|
||||
rules:
|
||||
{{- if .Values.ingress.host }}
|
||||
- host: {{ .Values.ingress.host }}
|
||||
http:
|
||||
{{- else }}
|
||||
- http:
|
||||
{{- end }}
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
@@ -30,7 +35,12 @@ metadata:
|
||||
{{- end }}
|
||||
spec:
|
||||
rules:
|
||||
{{- if .Values.ingress.dockerIngress.host }}
|
||||
- host: {{ .Values.ingress.dockerIngress.host }}
|
||||
http:
|
||||
{{- else}}
|
||||
- http:
|
||||
{{- end }}
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
@@ -38,4 +48,4 @@ spec:
|
||||
service:
|
||||
name: {{ .Chart.Name }}-docker-service
|
||||
port:
|
||||
number: {{ .Values.ingress.dockerIngress.port }}
|
||||
number: {{ .Values.service.docker.port }}
|
@@ -8,3 +8,8 @@ kind: Namespace
|
||||
metadata:
|
||||
name: {{ .Values.namespaces.cloudwatchNs }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: {{ .Values.namespaces.externaldnsNs }}
|
||||
---
|
16
nxrm-aws-resiliency/templates/serviceaccount.yaml
Normal file
16
nxrm-aws-resiliency/templates/serviceaccount.yaml
Normal file
@@ -0,0 +1,16 @@
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ .Values.serviceAccount.name }}
|
||||
namespace: {{ .Values.namespaces.nexusNs }}
|
||||
annotations:
|
||||
eks.amazonaws.com/role-arn: {{ .Values.serviceAccount.role }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ .Values.serviceAccount.externaldns.name }}
|
||||
namespace: {{ .Values.namespaces.externaldnsNs }}
|
||||
annotations:
|
||||
eks.amazonaws.com/role-arn: {{ .Values.serviceAccount.externaldns.role }}
|
||||
---
|
@@ -26,7 +26,7 @@ spec:
|
||||
selector:
|
||||
app: nxrm
|
||||
ports:
|
||||
- name: docker-connector
|
||||
- name: docker-service
|
||||
protocol: {{ .Values.service.docker.protocol }}
|
||||
port: {{ .Values.service.docker.port }}
|
||||
targetPort: {{ .Values.service.docker.targetPort }}
|
@@ -1,12 +1,13 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: {{ .Chart.Name }}-{{ .Chart.Version }}.{{ .Release.Name }}-{{ .Values.deployment.name }}
|
||||
name: {{ .Chart.Name }}-{{ .Chart.Version | replace "." "-"}}-{{ .Release.Name }}-{{ .Values.statefulset.name }}
|
||||
namespace: {{ .Values.namespaces.nexusNs }}
|
||||
labels:
|
||||
app: nxrm
|
||||
spec:
|
||||
replicas: 1
|
||||
serviceName: "{{ .Chart.Name }}-{{ .Chart.Version | replace "." "-"}}-{{ .Release.Name }}-{{ .Values.statefulset.name }}"
|
||||
selector:
|
||||
matchLabels:
|
||||
app: nxrm
|
||||
@@ -21,7 +22,7 @@ spec:
|
||||
# otherwise the side car containers will crash a couple of times and backoff whilst waiting
|
||||
# for nxrm-app to start and this increases the total start up time.
|
||||
- name: chown-nexusdata-owner-to-nexus-and-init-log-dir
|
||||
image: {{ .Values.deployment.initContainer.image.repository }}:{{ .Values.deployment.initContainer.image.tag }}
|
||||
image: {{ .Values.statefulset.initContainer.image.repository }}:{{ .Values.statefulset.initContainer.image.tag }}
|
||||
command: [/bin/sh]
|
||||
args:
|
||||
- -c
|
||||
@@ -34,19 +35,20 @@ spec:
|
||||
touch -a /nexus-data/log/request.log &&
|
||||
chown -R '200:200' /nexus-data
|
||||
volumeMounts:
|
||||
- name: nexusdata
|
||||
- name: nexus-data
|
||||
mountPath: /nexus-data
|
||||
terminationGracePeriodSeconds: 20
|
||||
containers:
|
||||
- name: nxrm-app
|
||||
image: {{ .Values.deployment.container.image.repository }}:{{ .Values.deployment.container.image.tag }}
|
||||
image: {{ .Values.statefulset.container.image.repository }}:{{ .Values.statefulset.container.image.tag }}
|
||||
securityContext:
|
||||
runAsUser: 200
|
||||
imagePullPolicy: {{ .Values.deployment.container.pullPolicy }}
|
||||
imagePullPolicy: {{ .Values.statefulset.container.pullPolicy }}
|
||||
ports:
|
||||
- containerPort: {{ .Values.deployment.container.containerPort }}
|
||||
- containerPort: {{ .Values.statefulset.container.containerPort }}
|
||||
env:
|
||||
- name: DB_NAME
|
||||
value: "{{ .Values.deployment.container.env.nexusDBName }}"
|
||||
value: "{{ .Values.statefulset.container.env.nexusDBName }}"
|
||||
- name: DB_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
@@ -70,41 +72,38 @@ spec:
|
||||
- name: NEXUS_SECURITY_RANDOMPASSWORD
|
||||
value: "false"
|
||||
- name: INSTALL4J_ADD_VM_PARAMS
|
||||
value: "-Xms2703m -Xmx2703m -XX:MaxDirectMemorySize=2703m -Dnexus.licenseFile=/nxrm-secrets/{{ .Values.secret.license.alias }} \
|
||||
value: "{{ .Values.statefulset.container.env.install4jAddVmParams }} -Dnexus.licenseFile=/nxrm-secrets/{{ .Values.secret.license.alias }} \
|
||||
-Dnexus.datastore.enabled=true -Djava.util.prefs.userRoot=${NEXUS_DATA}/javaprefs \
|
||||
-Dnexus.datastore.nexus.jdbcUrl=jdbc:postgresql://${DB_HOST}:{{ .Values.deployment.container.env.nexusDBPort }}/${DB_NAME} \
|
||||
-Dnexus.datastore.nexus.jdbcUrl=jdbc:postgresql://${DB_HOST}:{{ .Values.statefulset.container.env.nexusDBPort }}/${DB_NAME} \
|
||||
-Dnexus.datastore.nexus.username=${DB_USER} \
|
||||
-Dnexus.datastore.nexus.password=${DB_PASSWORD}"
|
||||
volumeMounts:
|
||||
- mountPath: /nxrm-secrets
|
||||
name: nxrm-secrets
|
||||
- name: nexusdata
|
||||
- name: nexus-data
|
||||
mountPath: /nexus-data
|
||||
- name: logback-tasklogfile-override
|
||||
mountPath: /nexus-data/etc/logback/logback-tasklogfile-appender-override.xml
|
||||
subPath: logback-tasklogfile-appender-override.xml
|
||||
- name: request-log
|
||||
image: {{ .Values.deployment.requestLogContainer.image.repository }}:{{ .Values.deployment.requestLogContainer.image.tag }}
|
||||
image: {{ .Values.statefulset.requestLogContainer.image.repository }}:{{ .Values.statefulset.requestLogContainer.image.tag }}
|
||||
args: [/bin/sh, -c, 'tail -n+1 -F /nexus-data/log/request.log']
|
||||
volumeMounts:
|
||||
- name: nexusdata
|
||||
- name: nexus-data
|
||||
mountPath: /nexus-data
|
||||
- name: audit-log
|
||||
image: {{ .Values.deployment.auditLogContainer.image.repository }}:{{ .Values.deployment.auditLogContainer.image.tag }}
|
||||
image: {{ .Values.statefulset.auditLogContainer.image.repository }}:{{ .Values.statefulset.auditLogContainer.image.tag }}
|
||||
args: [/bin/sh, -c, 'tail -n+1 -F /nexus-data/log/audit/audit.log']
|
||||
volumeMounts:
|
||||
- name: nexusdata
|
||||
- name: nexus-data
|
||||
mountPath: /nexus-data
|
||||
- name: tasks-log
|
||||
image: {{ .Values.deployment.taskLogContainer.image.repository }}:{{ .Values.deployment.taskLogContainer.image.tag }}
|
||||
image: {{ .Values.statefulset.taskLogContainer.image.repository }}:{{ .Values.statefulset.taskLogContainer.image.tag }}
|
||||
args: [/bin/sh, -c, 'tail -n+1 -F /nexus-data/log/tasks/allTasks.log']
|
||||
volumeMounts:
|
||||
- name: nexusdata
|
||||
- name: nexus-data
|
||||
mountPath: /nexus-data
|
||||
volumes:
|
||||
- name: nexusdata
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ .Chart.Name }}-{{ .Chart.Version }}.{{ .Release.Name }}-ebs-claim
|
||||
- name: nxrm-secrets
|
||||
csi:
|
||||
driver: secrets-store.csi.k8s.io
|
||||
@@ -118,3 +117,12 @@ spec:
|
||||
items:
|
||||
- key: logback-tasklogfile-appender-override.xml
|
||||
path: logback-tasklogfile-appender-override.xml
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: nexus-data
|
||||
spec:
|
||||
accessModes: [ "{{.Values.pvc.accessModes }}" ]
|
||||
storageClassName: "{{ .Chart.Name }}-{{ .Chart.Version}}-{{ .Release.Name }}-ebs-storage"
|
||||
resources:
|
||||
requests:
|
||||
storage: {{.Values.pvc.storage }}
|
11
nxrm-aws-resiliency/templates/storageclass.yaml
Normal file
11
nxrm-aws-resiliency/templates/storageclass.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: storage.k8s.io/v1
|
||||
kind: StorageClass
|
||||
metadata:
|
||||
name: "{{ .Chart.Name }}-{{ .Chart.Version}}-{{ .Release.Name }}-ebs-storage"
|
||||
namespace: {{ .Values.namespaces.nexusNs }}
|
||||
provisioner: kubernetes.io/aws-ebs
|
||||
parameters:
|
||||
type: io1
|
||||
fsType: "ext4"
|
||||
iopsPerGB: "{{ .Values.storageClass.iopsPerGB }}"
|
||||
volumeBindingMode: WaitForFirstConsumer
|
91
nxrm-aws-resiliency/values.yaml
Normal file
91
nxrm-aws-resiliency/values.yaml
Normal file
@@ -0,0 +1,91 @@
|
||||
# Declare variables to be passed into your templates.
|
||||
namespaces:
|
||||
nexusNs: nexusrepo
|
||||
cloudwatchNs: amazon-cloudwatch
|
||||
externaldnsNs: nexus-externaldns
|
||||
externaldns:
|
||||
domainFilter: example.com #your root domain e.g example.com
|
||||
awsZoneType: private # hosted zone to look at (valid values are public, private or no value for both)
|
||||
statefulset:
|
||||
clusterRegion: us-east-1
|
||||
name: nxrm-statefulset
|
||||
clusterName: nxrm-nexus
|
||||
logsRegion: us-east-1
|
||||
fluentBitVersion: 2.28.0
|
||||
initContainer:
|
||||
image:
|
||||
repository: busybox
|
||||
tag: 1.33.1
|
||||
container:
|
||||
image:
|
||||
repository: sonatype/nexus3
|
||||
tag: 3.44.0
|
||||
containerPort: 8081
|
||||
pullPolicy: IfNotPresent
|
||||
env:
|
||||
nexusDBName: nexus
|
||||
nexusDBPort: 3306
|
||||
install4jAddVmParams: "-Xms2703m -Xmx2703m"
|
||||
requestLogContainer:
|
||||
image:
|
||||
repository: busybox
|
||||
tag: 1.33.1
|
||||
auditLogContainer:
|
||||
image:
|
||||
repository: busybox
|
||||
tag: 1.33.1
|
||||
taskLogContainer:
|
||||
image:
|
||||
repository: busybox
|
||||
tag: 1.33.1
|
||||
serviceAccount:
|
||||
name: nexus-repository-deployment-sa #This SA is created as part of steps under "AWS Secrets Manager"
|
||||
role: arn:aws:iam::000000000000:role/nxrm-nexus-role #Role with secretsmanager permissions
|
||||
externaldns:
|
||||
name: external-dns
|
||||
role: arn:aws:iam::000000000000:role/nexusrepo-external-dns-irsa-role #Role with route53 permissions needed by external-dns
|
||||
ingress:
|
||||
#host: "example.com" #host to apply this ingress rule to. Uncomment this in your values.yaml and set it as you wish
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: alb
|
||||
alb.ingress.kubernetes.io/scheme: internal # scheme
|
||||
alb.ingress.kubernetes.io/subnets: subnet-1,subnet-2 #comma separated list of subnet ids
|
||||
alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS":443}]'
|
||||
alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:us-east-1:0000000000000:certificate/00000000-1111-2222-3333-444444444444 # The AWS Certificate Manager ARN for your HTTPS certificate
|
||||
dockerIngress: #Ingress for Docker Connector - comment out if you don't use docker repositories
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: alb # comment out if you don't use docker repositories
|
||||
alb.ingress.kubernetes.io/scheme: internal # scheme comment out if you don't use docker repositories
|
||||
alb.ingress.kubernetes.io/subnets: subnet-1,subnet-2 #comma separated list of subnet ids, comment out if you don't use docker repositories
|
||||
alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS":443}]' #comment out if you don't use docker repositories
|
||||
alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:us-east-1:0000000000000:certificate/00000000-1111-2222-3333-444444444444 # Comment out if you don't use docker repositories - The AWS Certificate Manager ARN for your HTTPS certificate
|
||||
external-dns.alpha.kubernetes.io/hostname: dockerrepo1.example.com, dockerrepo2.example.com, dockerrepo3.example.com # Add more docker subdomains using dockerrepoName.example.com otherwise comment out if you don't use docker repositories
|
||||
storageClass:
|
||||
zones:
|
||||
zone1: zone1
|
||||
zone2: zone2
|
||||
zone3: zone3
|
||||
iopsPerGB: "10"
|
||||
pvc:
|
||||
accessModes: ReadWriteOnce
|
||||
storage: 100Gi
|
||||
|
||||
service: #Nexus Repo NodePort Service
|
||||
nexus:
|
||||
type: NodePort
|
||||
protocol: TCP
|
||||
port: 80
|
||||
targetPort: 8081
|
||||
docker: #Nodeport Service for Docker Service
|
||||
type: NodePort
|
||||
protocol: TCP
|
||||
port: 9090
|
||||
targetPort: 8081
|
||||
secret:
|
||||
license:
|
||||
arn: arn:aws:secretsmanager:us-east-1:000000000000:secret:nxrm-nexus-license
|
||||
alias: nxrm-license.lic
|
||||
rds:
|
||||
arn: arn:aws:secretsmanager:us-east-1:000000000000:secret:nxrmrds-cred-nexus
|
||||
adminpassword:
|
||||
arn: arn:aws:secretsmanager:us-east-1:000000000000:secret:admin-nxrm-password
|
BIN
single-inst-oss-pro-kubernetes/.DS_Store
vendored
BIN
single-inst-oss-pro-kubernetes/.DS_Store
vendored
Binary file not shown.
BIN
single-inst-oss-pro-kubernetes/templates/.DS_Store
vendored
BIN
single-inst-oss-pro-kubernetes/templates/.DS_Store
vendored
Binary file not shown.
39
upgrade.sh
Executable file
39
upgrade.sh
Executable file
@@ -0,0 +1,39 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# Sonatype Nexus (TM) Open Source Version
|
||||
# Copyright (c) 2008-present Sonatype, Inc.
|
||||
# All rights reserved. Includes the third-party code listed at http://links.sonatype.com/products/nexus/oss/attributions.
|
||||
#
|
||||
# This program and the accompanying materials are made available under the terms of the Eclipse Public License Version 1.0,
|
||||
# which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html.
|
||||
#
|
||||
# Sonatype Nexus (TM) Professional Version is available from Sonatype, Inc. "Sonatype" and "Sonatype Nexus" are trademarks
|
||||
# of Sonatype, Inc. Apache Maven is a trademark of the Apache Software Foundation. M2eclipse is a trademark of the
|
||||
# Eclipse Foundation. All other trademarks are the property of their respective owners.
|
||||
#
|
||||
|
||||
if [ $# != 3 ]; then
|
||||
echo "Usage: $0 <dir> <chart-version> <app-version>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DIR="$1"
|
||||
CHART_VERSION="$2"
|
||||
APP_VERSION="$3"
|
||||
|
||||
OUTPUT_FILE=$(mktemp)
|
||||
|
||||
cat "$DIR/Chart.yaml" \
|
||||
| sed -E "s/version: .+/version: $CHART_VERSION/" \
|
||||
| sed -E "s/appVersion: .+/appVersion: $APP_VERSION/" \
|
||||
> "$OUTPUT_FILE"
|
||||
|
||||
mv "$OUTPUT_FILE" "$DIR/Chart.yaml"
|
||||
|
||||
cat "$DIR/values.yaml" \
|
||||
| sed -E "s/^ tag: .+$/ tag: $APP_VERSION/" \
|
||||
> "$OUTPUT_FILE"
|
||||
|
||||
mv "$OUTPUT_FILE" "$DIR/values.yaml"
|
||||
|
||||
git diff "$DIR"
|
Reference in New Issue
Block a user