File tree Expand file tree Collapse file tree
docs/modules/administration Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66
77
88### Changed
9+ - Nexus storage change ([ #1341 ] ( https://github.com/opendevstack/ods-core/issues/1341 ) )
910
1011
1112### Fixed
Original file line number Diff line number Diff line change @@ -179,6 +179,13 @@ backup-sonarqube:
179179.PHONY : backup-sonarqube
180180
181181
182+ # PVC MIGRATION
183+ # # Migrate data from one PVC to another.
184+ migrate-pvc-data :
185+ ./scripts/migrate_pvc_data.sh --source-pvc $(SOURCE_PVC ) --target-pvc $(TARGET_PVC ) --namespace $(ODS_NAMESPACE )
186+ .PHONY : migrate-pvc-data
187+
188+
182189# ## HELP
183190# ## Based on https://gist.github.com/prwhite/8168133#gistcomment-2278355.
184191help :
Original file line number Diff line number Diff line change @@ -45,8 +45,8 @@ ODS_BITBUCKET_PROJECT=opendevstack
4545# Nexus base image
4646# See Dockerhub https://hub.docker.com/r/sonatype/nexus3/tags.
4747# Officially supported is:
48- # - 3.70.3 -java11-ubi
49- NEXUS_IMAGE_TAG=3.70.3 -java11-ubi
48+ # - 3.70.4 -java11-ubi
49+ NEXUS_IMAGE_TAG=3.70.4 -java11-ubi
5050
5151# Nexus host without protocol.
5252# The domain should be equal to OPENSHIFT_APPS_BASEDOMAIN (see below).
@@ -77,9 +77,26 @@ NEXUS_MEMORY_REQUEST=3Gi
7777NEXUS_CPU_LIMIT=1
7878NEXUS_MEMORY_LIMIT=5Gi
7979
80- # Nexus data and backup capacity
80+ # Nexus data capacity
8181NEXUS_DATA_CAPACITY=60Gi
82- NEXUS_DATA_BACKUP_CAPACITY=10Gi
82+
83+ # Nexus storage name
84+ NEXUS_STORAGE_NAME="storage"
85+
86+ # Storage class provisioner, for AWS this should be "kubernetes.io/aws-ebs"
87+ NEXUS_STORAGE_PROVISIONER=""
88+
89+ # Storage class for Nexus data, for AWS this should be "gp3"
90+ NEXUS_STORAGE_CLASS_DATA=""
91+
92+ # Storage class for Nexus backup, for AWS this should be "gp2-encrypted"
93+ NEXUS_STORAGE_CLASS_BACKUP=""
94+
95+ # Nexus snapshot configuration, default to run daily at 2 AM
96+ NEXUS_SNAPSHOT_SCHEDULE="0 2 * * *"
97+
98+ # Nexus snapshot TTL in seconds (default: 30 days)
99+ NEXUS_SNAPSHOT_TTL=2592000
83100
84101#############
85102# SonarQube #
Original file line number Diff line number Diff line change 22** xref:administration:installation.adoc[Installation]
33** Upgrade
44*** xref:administration:helm-migration.adoc[Helm migration]
5+ *** xref:administration:pvc-migration.adoc[PVC Migration]
56*** xref:administration:update-2-to-3.adoc[2.x to 3.x]
67*** xref:administration:update-older.adoc[older]
78** xref:provisioning-app:configuration.adoc[Provisioning App]
Original file line number Diff line number Diff line change 1+ = PVC Migration
2+
3+ This document describes the process to migrate data from one Persistent Volume Claim (PVC) to another within the OpenShift cluster.
4+
5+ == Prerequisites
6+
7+ - Ensure the source and target PVCs exist in the desired namespace.
8+ - Have access to the `ods-core` repository.
9+
10+ == Migration Process
11+
12+ To migrate data between PVCs, follow these steps:
13+
14+ 1. Navigate to the `ods-core` repository.
15+ 2. Run the following command:
16+
17+ [source,sh]
18+ ----
19+ make migrate-pvc-data SOURCE_PVC=<source-pvc-name> TARGET_PVC=<target-pvc-name>
20+ ----
21+
22+ Replace `<source-pvc-name>`, and `<target-pvc-name>` with the appropriate values for your environment.
23+
24+ == Details
25+
26+ - The migration process creates a temporary pod that uses `rsync` to copy data from the source PVC to the target PVC.
27+ - Logs of the migration are stored in `/tmp/target/rsync.log` within the target PVC.
28+ - After the migration, verify the data integrity and delete the temporary pod if necessary.
Original file line number Diff line number Diff line change @@ -15,10 +15,10 @@ type: application
1515# This is the chart version. This version number should be incremented each time you make changes
1616# to the chart and its templates, including the app version.
1717# Versions are expected to follow Semantic Versioning (https://semver.org/)
18- version : 1.1 .0
18+ version : 1.2 .0
1919
2020# This is the version number of the application being deployed. This version number should be
2121# incremented each time you make changes to the application. Versions are not expected to
2222# follow Semantic Versioning. They should reflect the version the application is using.
2323# It is recommended to use it with quotes.
24- appVersion : " 3.70.3 -java11-ubi"
24+ appVersion : " 3.70.4 -java11-ubi"
Original file line number Diff line number Diff line change 1- OpenDevStack Nexus OSS edition on version {{ .Values.global.nexusImageTag }} released with Helm!
1+ Thank you for installing the OpenDevStack Nexus OSS Helm chart!
2+
3+ Nexus Repository Manager has been deployed.
4+
5+ Access Nexus UI:
6+ https://{{ .Values.global.nexusHost }}
7+
8+ Docker Registry Endpoint:
9+ {{ .Values.global.nexusDockerGroup }}-{{ .Values.global.odsNamespace }}{{ .Values.global.openshiftAppDomain}}
10+
11+ Nexus Version: {{ .Values.global.nexusImageTag }}
12+
13+ For more information, visit:
14+ - Sonatype Nexus Repository OSS: https://help.sonatype.com/en/ce-onboarding.html
15+ - OpenDevStack: https://www.opendevstack.org/ods-documentation/opendevstack/latest/nexus/administration.html
16+ - Community Support: https://community.sonatype.com/
Original file line number Diff line number Diff line change 3737 volumes :
3838 - name : {{ .Values.global.appName }}-data
3939 persistentVolumeClaim :
40- claimName : {{ .Values.global.appName }}-data
41- - name : {{ .Values.global.appName }}-db-backup
42- persistentVolumeClaim :
43- claimName : {{ .Values.global.appName }}-db-backup
40+ claimName : {{ .Values.global.nexusStorageName }}
4441 containers :
4542 - resources :
4643 limits :
8885 volumeMounts :
8986 - name : {{ .Values.global.appName }}-data
9087 mountPath : /nexus-data
91- - name : {{ .Values.global.appName }}-db-backup
92- mountPath : /nexus-backup
9388 terminationMessagePolicy : File
9489 image : {{ .Values.global.registry }}/{{ .Values.global.odsNamespace }}/{{ .Values.global.appName }}:{{ .Values.global.odsImageTag }}
9590 restartPolicy : Always
Original file line number Diff line number Diff line change 1+ apiVersion : batch/v1
2+ kind : CronJob
3+ metadata :
4+ name : nexus-volume-snapshot
5+ labels :
6+ app : nexus
7+ spec :
8+ schedule : " {{ .Values.global.nexusSnapshotSchedule }}"
9+ concurrencyPolicy : Forbid
10+ jobTemplate :
11+ spec :
12+ ttlSecondsAfterFinished : {{ .Values.global.nexusSnapshotTTL }}
13+ template :
14+ spec :
15+ serviceAccountName : ods-edit
16+ containers :
17+ - name : snapshot-creator
18+ image : image-registry.openshift-image-registry.svc:5000/openshift/ose-cli:latest
19+ command :
20+ - /bin/sh
21+ - -c
22+ - |
23+ cat <<EOF | oc apply -f -
24+ apiVersion: snapshot.storage.k8s.io/v1
25+ kind: VolumeSnapshot
26+ metadata:
27+ name: {{ .Values.global.appName }}-snapshot.$(date +%Y-%m-%d.%H-%M-%S)
28+ namespace: {{ .Values.global.odsNamespace }}
29+ spec:
30+ volumeSnapshotClassName: {{ .Values.global.nexusSnapshotClass }}
31+ source:
32+ persistentVolumeClaimName: {{ .Values.global.nexusStorageName }}
33+ EOF
34+ # Cleanup snapshots older than the TTL
35+ oc get volumesnapshots --namespace {{ .Values.global.odsNamespace }} \
36+ --no-headers -o custom-columns=NAME:.metadata.name,CREATED:.metadata.creationTimestamp | \
37+ while read name created; do
38+ if [[ $(date -d "$created" +%s) -lt $(date -d "-{{ .Values.global.nexusSnapshotTTL }} seconds" +%s) ]]; then
39+ oc delete volumesnapshot "$name" --namespace {{ .Values.global.odsNamespace }}
40+ fi
41+ done
42+ resources : {}
43+ imagePullPolicy : IfNotPresent
44+ restartPolicy : OnFailure
45+ successfulJobsHistoryLimit : 30
46+ failedJobsHistoryLimit : 30
Original file line number Diff line number Diff line change @@ -3,11 +3,12 @@ kind: PersistentVolumeClaim
33metadata :
44 annotations :
55 volume.beta.kubernetes.io/storage-provisioner : {{ .Values.global.storageProvisioner }}
6+ helm.sh/resource-policy : keep
67 finalizers :
78 - kubernetes.io/pvc-protection
89 labels :
910 app : {{ .Values.global.appName }}
10- name : {{ .Values.global.appName }}-data
11+ name : {{ .Values.global.nexusStorageName }}
1112spec :
1213 accessModes :
1314 - ReadWriteOnce
You can’t perform that action at this time.
0 commit comments