在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):travelaudience/kubernetes-nexus开源软件地址(OpenSource Url):https://github.com/travelaudience/kubernetes-nexus开源编程语言(OpenSource Language):Shell 100.0%开源软件介绍(OpenSource Introduction):kubernetes-nexusNexus Repository Manager OSS (3.19.1) on top of Kubernetes. Table of ContentsPre-Requisites
Attention: On RBAC-enabled clusters, and due to the way GKE checks permissions, one must also grant themselves the $ MY_GCLOUD_USER=$(gcloud info | grep Account | awk -F'[][]' '{print $2}')
$ kubectl create clusterrolebinding ${MY_GCLOUD_USER} --clusterrole=cluster-admin --user=${MY_GCLOUD_USER} DeploymentDeploying NexusThe very first thing one must do after deploying Nexus is to log-in into the
Nexus UI with the default credentials ( The $ cd kubernetes/
$ NEXUS_CREDENTIALS=$(echo -n 'admin:<new-password>' | base64)
$ NEXUS_AUTH=$(echo -n "Basic ${NEXUS_CREDENTIALS}" | base64)
$ sed -i.bkp "s/QmFzaWMgWVdSdGFXNDZZV1J0YVc0eE1qTT0=/${NEXUS_AUTH}/" nexus-secret.yaml One must also update the contents of After updating Attention: If one wants to have GCP IAM authentication enabled, one must follow these instructions instead. $ kubectl create -f nexus-secret.yaml
$ kubectl create -f nexus-statefulset.yaml
$ kubectl create -f nexus-proxy-svc.yaml
$ kubectl create -f nexus-ingress.yaml One should allow for 5 to 10 minutes for GCLB to update. Nexus should then become available over HTTP at http://nexus.example.com. Securing Nexus with HTTPSIn order to secure Nexus external access one must configure HTTPS access.
The easiest and cheapest way to obtain a trusted TLS certificate is using
Let's Encrypt, and the easiest way to automate the
process of obtaining and renewing certificates from Let's Encrypt is by using
The easiest way is to install As soon as it starts, After installation, one will need to setup an issuer and actually request a certificate for Nexus: Attention: One must edit the $ cd ../cert-manager/
$ kubectl create -f issuer.yaml
$ kubectl create -f certificate.yaml NOTE: Let's Encrypt must be able to reach port If everything goes well, after a while one will
be able to access https://nexus.example.com securely and proceed to log-in
into Nexus with the default credentials ( Configuring NexusOne should head over to
Configuring Backup RetentionAttention: As mentioned in the pre-requisites, the GKE cluster needs read-write permissions on GCP Cloud Storage in order to upload backups. The backup procedure uses Google Cloud Storage to save backups. In order to
configure a backup retention policy, one should head over to the $ ./gsutil-lifecycle-set <policy-file> <bucket-name> Google Cloud Storage will then automatically purge backups older than the number of days specified. Using NexusBelow are linked detailed instructions on how to configure a bunch of tools in order to download and upload artifacts from and to Nexus. DockerPlease, read Using Nexus with Docker. MavenPlease, read Using Nexus with Maven. GradlePlease, read Using Nexus with Gradle. sbtPlease, read Using Nexus with sbt. PythonPlease, read Using Nexus with Python. Backup and RestoreAttention: As mentioned in the pre-requisites, the GKE cluster needs read-write permissions on GCP Cloud Storage in order to upload backups. BackupNexus has a built-in Export databases for backup task which can be used to backup configuration and metadata. However, the generated backup doesn't include blob stores, rendering it semi-useless in a disaster recovery scenario. It is thus of the utmost importance to backup blob stores separately and at roughly the same time this task runs in order to achieve consistent backups. This is the role of the
and initiates the backup process:
It is advisable to configure this backup procedure to run at off-peak hours, as described in the aforementioned document. RestoreIn a disaster recovery scenario, the latest backup made by the
Attention: after terminating Nexus, with the default readiness/liveness probe settings in the chart kubernetes will restart the nexus pod before you've been able to untar the back-up files. If you meet that problem (the At this point, Nexus is stopped but the container is still running, giving one a chance to perform the restore procedure. Attention: One must not close this terminal window just yet. One should now open another terminal window and login into the $ kubectl exec -i -t nexus-0 --container nexus-backup -- /bin/bash Now one should go as follows:
At this point the backup is ready to be restored by Nexus and one can leave the nexus-backup container.
One must now go back to the terminal of the
This will automatically start Nexus and perform the restore process. If one watches the |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论