当前位置: 首页 > news >正文

kubernetes部署Nexus(Helm3)

参考文献:

  • https://help.sonatype.com/en/single-data-center-on-premises-deployment-example-using-kubernetes.html
  • https://github.com/sonatype/helm3-charts
  • https://support.sonatype.com/hc/en-us/articles/7706583820691-How-to-install-Nexus-Pro-instance-using-Sonatype-helm3-chart

Nexus3简介

Nexus 是 Maven 仓库管理器,通过 nexus 可以搭建 Maven仓库,极大的简化了本地内部仓库的维护和外部仓库的访问,同时是一套开箱即用的系统不需要数据库,并且还提供强大的仓库管理、构建、搜索等功能

优点

  • 节省外网带宽
  • 加速Maven构建
  • 可以为本地建立本地内部仓库
  • 方便项目组存放各种jar的管理

部署 PVC

准备命名空间

kubectl create ns ops-nexus

创建PVC

cat > nexus-volume.yaml <<EOF
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:name: pvc-nexus-storage
spec:accessModes:- ReadWriteMany# 指定 storageClass 的名字,这里使用默认的 standardstorageClassName: nfs-storageresources:requests:storage: 1000Gi
EOF
kubectl apply -f nexus-volume.yaml -n ops-nexus

华为云SFS配置

---
kind: PersistentVolume
apiVersion: v1
metadata:name: pv-efs-ops-nexusannotations:everest.io/reclaim-policy: retain-volume-onlypv.kubernetes.io/bound-by-controller: 'yes'pv.kubernetes.io/provisioned-by: everest-csi-provisionerfinalizers:- kubernetes.io/pv-protection
spec:capacity:storage: 1000Gicsi:driver: sfsturbo.csi.everest.iovolumeHandle: pv-efs-ops-nexusfsType: nfsvolumeAttributes:everest.io/enterprise-project-id: cfxxxx4d-16c4-4206-a3cb-111xxxxbyyyeverest.io/sfsturbo-share-id: 73xxxx6a-6xxx-xxx0-8xxx-fxxxxx6cxxxxstorage.kubernetes.io/csiProvisionerIdentity: everest-csi-provisionereverest.io/share-export-location: 73xxxx6a-6xxx-xxx0-8xxx-fxxxxx6cxxxx.sfsturbo.internal:/Nexuseverest.io/volume-as: absolute-pathaccessModes:- ReadWriteManypersistentVolumeReclaimPolicy: RetainstorageClassName: csi-sfsturbomountOptions:- vers=3- timeo=600- nolock- hardvolumeMode: Filesystem---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:name: pvc-nexus-storageannotations:everest.io/enterprise-project-id: cfxxxx4d-16c4-4206-a3cb-111xxxxbyyypv.kubernetes.io/bind-completed: 'yes'volume.beta.kubernetes.io/storage-provisioner: everest-csi-provisionerfinalizers:- kubernetes.io/pvc-protection
spec:accessModes:- ReadWriteManyresources:requests:storage: 1000GivolumeName: pv-efs-ops-nexusstorageClassName: csi-sfsturbovolumeMode: Filesystem

获取Chart配置

将 Sonatype Repo 添加到你的 Helm

helm repo add sonatype https://sonatype.github.io/helm3-charts/

获取图表的values.yaml默认值。

  • Nexus 存储库管理器 OSS/Pro:
helm show values sonatype/nexus-repository-manager > nexus-repo-values.yaml
  • Nexus IQ:
helm show values sonatype/nexus-iq-server > iq-values.yaml
  • AWS 弹性 Nexus 存储库管理器:
helm show values sonatype/nxrm-aws-resiliency  > aws-resiliency-values.yaml

将该输出捕获为您自己的values.yaml文件,并将其helm install 与-f选项一起提供给命令。

配置Nexus3

配置案例

---
statefulset:# This is not supportedenabled: false
# Nexus 不支持使用同一 pvc 运行多个实例。请参阅:https://help.sonatype.com/repomanager3/planning-your-implementation/resiliency-and-high-availability/single-data-center-on-residential-deployment-example-using-kubernetes
replicaCount: 1
deploymentStrategy: Recreate
image:# Sonatype Official Public Imagerepository: sonatype/nexus3tag: 3.64.0pullPolicy: IfNotPresent
imagePullSecrets:
# for image registries that require login, specify the name of the existing
# kubernetes secret
#   - name: <pull-secret-name>nexus:docker:enabled: false# registries:#   - host: chart.local#     port: 5000#     secretName: registry-secretenv:# minimum recommended memory settings for a small, person instance from# https://help.sonatype.com/repomanager3/product-information/system-requirements- name: INSTALL4J_ADD_VM_PARAMSvalue: "-Xms2703M -Xmx2703M -XX:MaxDirectMemorySize=2703M -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap -Djava.util.prefs.userRoot=/nexus-data/javaprefs"- name: NEXUS_SECURITY_RANDOMPASSWORDvalue: "true"properties:override: falsedata:nexus.scripts.allowCreation: true# See this article for ldap configuratioon options https://support.sonatype.com/hc/en-us/articles/216597138-Setting-Advanced-LDAP-Connection-Properties-in-Nexus-Repository-Manager# nexus.ldap.env.java.naming.security.authentication: simple# nodeSelector:#   cloud.google.com/gke-nodepool: default-poolnodeSelector:dependable: "true"env: opsresources:# minimum recommended memory settings for a small, person instance from# https://help.sonatype.com/repomanager3/product-information/system-requirements#   requests:#     cpu: 4#     memory: 8Gi#   limits:#     cpu: 4#     memory: 8Girequests:cpu: 1memory: 512Milimits:cpu: 4memory: 8Gi# The ports should only be changed if the nexus image uses a different portnexusPort: 8081# Default the pods UID and GID to match the nexus3 container.# Customize or remove these values from the securityContext as appropriate for# your deployment environment.securityContext:runAsUser: 200runAsGroup: 200fsGroup: 200podAnnotations: {}livenessProbe:initialDelaySeconds: 30periodSeconds: 30failureThreshold: 6timeoutSeconds: 10path: /readinessProbe:initialDelaySeconds: 30periodSeconds: 30failureThreshold: 6timeoutSeconds: 10path: /# hostAliases allows the modification of the hosts file inside a containerhostAliases: []# - ip: "192.168.1.10"#   hostnames:#   - "example.com"#   - "www.example.com"nameOverride: "nexus-repository"
fullnameOverride: "nexus-repository"deployment:# # Add annotations in deployment to enhance deployment configurationsannotations: {}# # Add init containers. e.g. to be used to give specific permissions for nexus-data.# # Add your own init container or uncomment and modify the given example.initContainers:## 如果因文件权限启动异常,请打开以下容器配置#- name: fmp-volume-permission#  image: busybox#  imagePullPolicy: IfNotPresent#  command: ['chown','-R', '200', '/nexus-data']#  volumeMounts:#    - name: nexus-repository-data#      mountPath: /nexus-data# Uncomment and modify this to run a command after starting the nexus container.postStart:command:    # '["/bin/sh", "-c", "ls"]'preStart:command:    # '["/bin/rm", "-f", "/path/to/lockfile"]'terminationGracePeriodSeconds: 120additionalContainers:additionalVolumes:additionalVolumeMounts:ingress:#enabled: falseenabled: trueingressClassName: nginx-ingressannotations:nginx.ingress.kubernetes.io/connection-proxy-header: ""nginx.ingress.kubernetes.io/keep-alive: "650"nginx.ingress.kubernetes.io/keep-alive-requests: "10000"nginx.ingress.kubernetes.io/proxy-buffering: "off"nginx.ingress.kubernetes.io/proxy-connect-timeout: "7200"nginx.ingress.kubernetes.io/proxy-http-version: "1.1"nginx.ingress.kubernetes.io/proxy-next-upstream: error timeout invalid_header http_500 http_502 http_503 http_504nginx.ingress.kubernetes.io/proxy-read-timeout: "7200"nginx.ingress.kubernetes.io/proxy-send-timeout: "7200"nginx.ingress.kubernetes.io/proxy-tcp-nodelay: "on"nginx.ingress.kubernetes.io/proxy-tcp-nopush: "off"nginx.ingress.kubernetes.io/proxy-request-buffering: "off"nginx.ingress.kubernetes.io/proxy-body-size: "0"hostPath: /hostRepo: nexus.qshtest.com# tls:#   - secretName: nexus-local-tls#     hosts:#       - repo.demoservice:name: nexus3enabled: truelabels: {}annotations: {}type: ClusterIProute:enabled: falsename: dockerportName: dockerlabels:annotations:# path: /dockernexusProxyRoute:enabled: falselabels:annotations:# path: /nexuspersistence:enabled: trueaccessMode: ReadWriteOnce## If defined, storageClass: <storageClass>## If set to "-", storageClass: "", which disables dynamic provisioning## If undefined (the default) or set to null, no storageClass spec is##   set, choosing the default provisioner.  (gp2 on AWS, standard on##   GKE, AWS & OpenStack)### existingClaim:# annotations:#  "helm.sh/resource-policy": keep# 如果你已经有一个现有的 PVC,可以在此处引用它。existingClaim: pvc-nexus-storage# 如果你想在 Helm 升级时保留资源,添加如下注释:annotations:"helm.sh/resource-policy": keep# storageClass: "-"storageSize: 500Gi# If PersistentDisk already exists you can create a PV for it by including the 2 following keypairs.# pdName: nexus-data-disk# fsType: ext4#tolerations: []
tolerations:
- key: "core"operator: "Equal"value: "true"effect: "NoSchedule"# Enable configmap and add data in configmap
config:enabled: falsemountPath: /sonatype-nexus-confdata: []# # To use an additional secret, set enable to true and add data
secret:enabled: falsemountPath: /etc/secret-volumereadOnly: truedata: []serviceAccount:# Specifies whether a service account should be createdcreate: true# Annotations to add to the service accountannotations: {}# The name of the service account to use.# If not set and create is true, a name is generated using the fullname templatename: ""

部署Nexus3

创建命名空间

kubectl create ns ops-nexus

部署服务

Nexus 存储库管理器 OSS/Pro:

helm install nexus-repo -f nexus-repo-values.yaml sonatype/nexus-repository-manager -n ops-nexus

更新服务

helm upgrade nexus-repo -f ./nexus-repo-values.yaml sonatype/nexus-repository-manager -n ops-nexus

迁移现有 Nexus 存储库

  • https://help.sonatype.com/en/migrating-an-existing-nexus-repository-instance-to-a-resiliency-architecture.html

相关文章:

kubernetes部署Nexus(Helm3)

参考文献&#xff1a; https://help.sonatype.com/en/single-data-center-on-premises-deployment-example-using-kubernetes.htmlhttps://github.com/sonatype/helm3-chartshttps://support.sonatype.com/hc/en-us/articles/7706583820691-How-to-install-Nexus-Pro-instance…...

PDF无法导出中文

font/SIMSUN.TTC with Identity-H is not recognized. 查看BaseFont源码发现".ttc," 改为"SIMSUN.TTC,a"提示数字转换异常 改为"SIMSUN.TTC,11"提示数字索引必须介于0和1之间 改为0或1结果正常 BaseFont baseFont BaseFont.createFont("/U…...

【docker】mysql8.0 的 docker 安装

安装 指定mysql 的安装版本8.0.18 拉取镜像 docker pull mysql:8.0。18创建目录 mkdir -p /opt/docker_volumn/mysql/conf mkdir -p /opt/docker_volumn/mysql/log mkdir -p /opt/docker_volumn/mysql/data mkdir -p /opt/docker_volumn/mysql/mysql-files此步骤是为了将容…...

vue3中父组件与子组件关系的理解 ------类比java中的启动类,类,对象等概念来解释一下

编程时的一点感受&#xff1a; 感觉子组件本身像是java的一个类&#xff0c;父组件像是启动类&#xff0c;父组件里引用子组件像是创建子组件的对象 查找资料后&#xff0c;发现确实如此&#xff0c;在很多方面&#xff0c;Vue 组件确实可以与面向对象编程中的类进行类比。…...

Java设计模式——装饰模式

目录 模式动机 模式定义 模式结构 类图 代码分析 示例&#xff1a;动态添加功能的流 组件接口 具体组件 装饰抽象类 具体装饰类 客户端 模式分析 核心思想 动态扩展功能 组合优于继承 优点 动态扩展功能 组合优于继承 代码复用性高 符合开闭原则 缺点 增加…...

【TouchSocket 和 client.GetStream 区别】

TouchSocket 和 client.GetStream() 是用于网络通信的不同工具和方法&#xff0c;但它们的功能层面和适用范围也有明显区别。下面我来详细解释 TouchSocket 和 client.GetStream() 的差异。 1. TouchSocket TouchSocket 是一个完整的 网络通信框架&#xff0c;专注于为开发者…...

怎么利用商品详情API接口实现数据获取与应用?

在当今数字化的商业时代&#xff0c;高效获取和利用商品数据对于企业和开发者来说至关重要。商品详情 API 接口为我们提供了一种便捷的方式来获取丰富的商品信息&#xff0c;从而实现各种有价值的应用。本文将深入探讨如何利用商品详情 API 接口实现数据获取与应用。 一、商品…...

【AGC005D】~K Perm Counting(计数抽象成图)

容斥原理。 求出f(m) &#xff0c;f(m)指代至少有m个位置不合法的方案数。 怎么求&#xff1f; 注意到位置为id&#xff0c;权值为v ,不合法的情况&#xff0c;当且仅当 v idk或 v id-k 因此&#xff0c;我们把每一个位置和权值抽象成点 &#xff0c;不合法的情况之间连一…...

【React】setState (useState) 是怎么记住上一个状态值的?

在 React 中&#xff0c;setState 通过 React 内部的状态管理机制来记住上一个状态值。即使每次组件重新渲染时&#xff0c;函数组件会被重新执行&#xff0c;React 仍能通过其内部的状态管理系统保持和追踪组件的状态变化。下面详细解释其工作原理&#xff1a; 1. setState 的…...

Vue3 使用CryptoJS加密

为什么要加密&#xff1f; 现在的互联网世界充满了各种各样的信息&#xff0c;有些信息非常重要&#xff0c;比如密码、个人信息等。如果我们把这些信息直接发送到服务器&#xff0c;别人可能会截取到&#xff0c;然后偷走我们的信息。为了避免这种情况发生&#xff0c;我们需…...

Feign的使用

一、Feign 介绍 Feign 是一个声明式的 HTTP 客户端&#xff0c;它使得编写 HTTP 客户端变得更加简单。在微服务架构中&#xff0c;使用 Feign 可以轻松地调用其他服务。Feign 内置了 Ribbon 实现负载均衡。 二、Feign 的使用步骤 引入依赖&#xff1a; 在项目的 pom.xml 文件…...

前端反接保护:实用方案解析与探讨

前端反接保护通常采用肖特基二极管方案或PMOS/NMOS方案&#xff0c;本文另外介绍一种理想二极管方案。 1、肖特基二极管方案 由于肖特基二极管具有正向导通电压&#xff0c;只能用于小电流场合&#xff0c;甚至于直接使用普通的整流二极管。比如1A电流&#xff0c;设D1的正向…...

【C++】第五节:内存管理

1、C/C内存分布 看下面一段代码 int globalVar 1; static int staticGlobalVar 1; void Test() {static int staticVar 1;int localVar 1;int num1[10] { 1, 2, 3, 4 };char char2[] "abcd";const char* pChar3 "abcd";int* ptr1 (int*)malloc(s…...

【Java SE】方法 和 递归 的应用

&#x1f525;博客主页&#x1f525;&#xff1a;【 坊钰_CSDN博客 】 欢迎各位点赞&#x1f44d;评论✍收藏⭐ 目录 1. 方法的含义 1.1 例子 1.2 方法的概念 2. 方法的定义 3. 实参和形参 3.1 实参和形参的关系 4. 方法的重载 5. 递归 5.1 递归练习 6. 小结 1. 方法的…...

JVS低代码轻应用是什么?是如何拼装的?这篇文章讲的非常详细

1.1JVS轻应用是什么&#xff1f; 轻应用与传统应用的开发过程区别 传统开发&#xff08;原生开发&#xff09;采用的方式&#xff1a;①需求了解 ②产品原型③UI设计④建库建表⑤前端还原⑥后端开发⑦前后端联调⑧功能测试⑨部署上线轻应用开发方式&#xff08;配置化拼装&…...

K210(openMV)与STM32 通信教程

目录 前言&#xff1a; 一、K210 串口部分教程 二、STM32部分 前言&#xff1a; 很多打比赛的同学&#xff0c;通常只是用K210 或者openMV来进行视觉部分的信息采集&#xff0c;传输数据给STM32&#xff08;或者其他主控那边&#xff09;进行对分析&#xff0c;对小车或者舵…...

【HarmonyOS】HMRouter使用详解(三)生命周期

生命周期&#xff08;Lifecycle&#xff09; 使用HMRouter的页面跳转时&#xff0c;想实现和Navigation一样的生命周期时&#xff0c;需要通过新建生命周期类来实现对页面对某一个生命周期的监控。 新建Lifecycle类 通过继承IHMLifecycle接口实现生命周期接口的方法重写。 通过…...

Docker 教程三 (Ubuntu Docker安装)

Ubuntu Docker 安装 Docker Engine-Community 支持以下的 Ubuntu 版本&#xff1a; Xenial 16.04 (LTS)Bionic 18.04 (LTS)Cosmic 18.10Disco 19.04 其他更新的版本…… Docker Engine - Community 支持上 x86_64&#xff08;或 amd64&#xff09;armhf&#xff0c;arm64&am…...

Redis:持久化

Redis&#xff1a;持久化 持久化RDBdump.rdb优缺点 AOF文件同步重写机制 混合持久化 持久化 虽然Redis是一个内存级别的数据库&#xff0c;但是Redis也是有持久化的能力的。当系统崩溃时&#xff0c;Redis就会被强制退出&#xff0c;此时内存中的数据就会丢失。为了能够在下次…...

精准监控,高效运营 —— 商品信息实时分析为商家带来新机遇

在现代商业环境中&#xff0c;精准监控和高效运营是商家成功的关键。通过实时分析商品信息&#xff0c;商家可以洞察市场趋势、优化库存管理、提升销售策略&#xff0c;从而抓住新的商业机遇。本文将介绍如何利用Python和一些流行的数据分析工具来实现商品信息的实时分析&#…...

深度学习在微纳光子学中的应用

深度学习在微纳光子学中的主要应用方向 深度学习与微纳光子学的结合主要集中在以下几个方向&#xff1a; 逆向设计 通过神经网络快速预测微纳结构的光学响应&#xff0c;替代传统耗时的数值模拟方法。例如设计超表面、光子晶体等结构。 特征提取与优化 从复杂的光学数据中自…...

地震勘探——干扰波识别、井中地震时距曲线特点

目录 干扰波识别反射波地震勘探的干扰波 井中地震时距曲线特点 干扰波识别 有效波&#xff1a;可以用来解决所提出的地质任务的波&#xff1b;干扰波&#xff1a;所有妨碍辨认、追踪有效波的其他波。 地震勘探中&#xff0c;有效波和干扰波是相对的。例如&#xff0c;在反射波…...

智慧工地云平台源码,基于微服务架构+Java+Spring Cloud +UniApp +MySql

智慧工地管理云平台系统&#xff0c;智慧工地全套源码&#xff0c;java版智慧工地源码&#xff0c;支持PC端、大屏端、移动端。 智慧工地聚焦建筑行业的市场需求&#xff0c;提供“平台网络终端”的整体解决方案&#xff0c;提供劳务管理、视频管理、智能监测、绿色施工、安全管…...

vue3 字体颜色设置的多种方式

在Vue 3中设置字体颜色可以通过多种方式实现&#xff0c;这取决于你是想在组件内部直接设置&#xff0c;还是在CSS/SCSS/LESS等样式文件中定义。以下是几种常见的方法&#xff1a; 1. 内联样式 你可以直接在模板中使用style绑定来设置字体颜色。 <template><div :s…...

Java多线程实现之Callable接口深度解析

Java多线程实现之Callable接口深度解析 一、Callable接口概述1.1 接口定义1.2 与Runnable接口的对比1.3 Future接口与FutureTask类 二、Callable接口的基本使用方法2.1 传统方式实现Callable接口2.2 使用Lambda表达式简化Callable实现2.3 使用FutureTask类执行Callable任务 三、…...

【配置 YOLOX 用于按目录分类的图片数据集】

现在的图标点选越来越多&#xff0c;如何一步解决&#xff0c;采用 YOLOX 目标检测模式则可以轻松解决 要在 YOLOX 中使用按目录分类的图片数据集&#xff08;每个目录代表一个类别&#xff0c;目录下是该类别的所有图片&#xff09;&#xff0c;你需要进行以下配置步骤&#x…...

汇编常见指令

汇编常见指令 一、数据传送指令 指令功能示例说明MOV数据传送MOV EAX, 10将立即数 10 送入 EAXMOV [EBX], EAX将 EAX 值存入 EBX 指向的内存LEA加载有效地址LEA EAX, [EBX4]将 EBX4 的地址存入 EAX&#xff08;不访问内存&#xff09;XCHG交换数据XCHG EAX, EBX交换 EAX 和 EB…...

ArcGIS Pro制作水平横向图例+多级标注

今天介绍下载ArcGIS Pro中如何设置水平横向图例。 之前我们介绍了ArcGIS的横向图例制作&#xff1a;ArcGIS横向、多列图例、顺序重排、符号居中、批量更改图例符号等等&#xff08;ArcGIS出图图例8大技巧&#xff09;&#xff0c;那这次我们看看ArcGIS Pro如何更加快捷的操作。…...

mysql已经安装,但是通过rpm -q 没有找mysql相关的已安装包

文章目录 现象&#xff1a;mysql已经安装&#xff0c;但是通过rpm -q 没有找mysql相关的已安装包遇到 rpm 命令找不到已经安装的 MySQL 包时&#xff0c;可能是因为以下几个原因&#xff1a;1.MySQL 不是通过 RPM 包安装的2.RPM 数据库损坏3.使用了不同的包名或路径4.使用其他包…...

Unity | AmplifyShaderEditor插件基础(第七集:平面波动shader)

目录 一、&#x1f44b;&#x1f3fb;前言 二、&#x1f608;sinx波动的基本原理 三、&#x1f608;波动起来 1.sinx节点介绍 2.vertexPosition 3.集成Vector3 a.节点Append b.连起来 4.波动起来 a.波动的原理 b.时间节点 c.sinx的处理 四、&#x1f30a;波动优化…...