为 GCP 部署自定义云原生路由器 Helm Chart
您可以在 GCP 上以 L3 模式部署和作瞻博网络云原生路由器。您可以通过在部署之前编辑文件中的 values.yaml
相应属性来配置部署模式。
Helm 图表属性和说明
使用 Juniper_Cloud_Native_Router_release-number/helmchart/values.yaml
文件自定义 helm 图表。heml 图的配置键如下表所示。
密钥 | 附加密钥配置 | 说明 |
---|---|---|
注册表 | 定义托管 vRouter、cRPD 和 jcnr-cni 容器映像的 docker 注册表。默认值设置为 Juniper Enterprise Hub。 | |
存储 库 | 定义 vRouter、cRPD 和 jcnr-cni 容器映像的存储库路径。这是一个全局键,优先于“通用”部分下的“存储库”路径。默认值为 jcnr-container-prod/ |
|
图像PullSecret | (选答)定义注册表身份验证凭据。您可以将凭据配置到瞻博网络存储库或私有注册表。有关更多信息,请查看 配置存储库凭据 主题。 | |
registryCredentials | Docker 注册表凭据的 Base64 表示形式。 | |
secretName | 将要创建的 Secret 对象的名称。 | |
常见 | 定义 vRouter、cRPD 和 jcnr-cni 容器映像的存储库路径和标记。 | |
存储 库 | 定义存储库路径。如果已定义,则全局存储库密钥优先。 默认值设置为 |
|
标记 | 定义图像标记。默认值配置为云原生路由器发行版的相应标记号。 | |
副本 | (选答)指示 cRPD 的副本数。如果未指定该值,则考虑默认值 1。 必须为多节点群集指定此密钥的值,并且必须与必须部署云原生路由器的节点数匹配。 |
|
storageClass | 不适用于 GCP 部署。 |
|
awsregion | 不适用于 GCP 部署。 | |
无本地交换 | 不适用于 GCP 部署。 | |
fabricInterface | 提供要绑定到 DPDK 的接口列表。您还可以提供子网而不是接口名称。如果同时指定了接口名称和子网,则接口名称优先于子网/网关组合。当多节点群集中的接口名称不同时,子网/网关组合非常有用。
注意:
使用“仅 L3”部分为 GCP 配置交换矩阵接口。“仅限 L2”部分和 L2-L3 部分不适用于 GCP 部署。 例如: # L3 only - eth1: ddp: "off" - eth2: ddp: "off" |
|
子 | 接口名称的另一种输入模式。例如: - subnet: 10.40.1.0/24 gateway: 10.40.1.1 ddp: "off" 此 |
|
DDP | 不适用于 GCP 部署。 |
|
interface_mode | 不适用于 GCP 部署。 | |
VLAN ID-列表 | 不适用于 GCP 部署。 |
|
风暴控制配置文件 | 不适用于 GCP 部署。 |
|
本机 VLAN ID | 不适用于 GCP 部署。 | |
无本地交换 | 不适用于 GCP 部署。 | |
fabricWorkloadInterface | 不适用于 GCP 部署。 | |
log_level | 定义日志严重性。可用的值选项包括:DEBUG、INFO、WARN 和 ERR。
注意:
将 log_level 集保留为 INFO,除非瞻博网络支持人员指示进行更改。 |
|
log_path | 定义的目录存储各种与云原生路由器相关的描述性日志,如contrail-vrouter-agent.log、contrail-vrouter-dpdk.log等。 |
|
syslog_notifications | 指示以 JSON 格式存储 syslog-ng 生成的通知的文件的绝对路径。 |
|
corePattern | 指示核心模式,表示如何生成核心文件。如果此配置留空,则云原生路由器 Pod 不会覆盖默认模式。
注意:
在部署 JCNR 之前,在主机上设置 corePattern 值。您可以更改 中的值 |
|
coreFilePath | 指示核心文件的路径。如果该值留空,则 vRouter 会将 /var/crashes 视为默认值。 | |
节点关联 | (选答)在节点上定义标签以确定放置 vRouter 容器的位置。默认情况下,vRouter Pod 部署到集群的所有节点。 在下面的示例中,节点关联标签定义为“key1=jcnr”。您必须将此标签应用于必须部署云原生路由器的每个节点: nodeAffinity: - key: key1 operator: In values: - jcnr
注意:
此密钥是全局设置。 |
|
钥匙 | 键值对,表示必须匹配才能应用节点关联的节点标签。 | |
算子 | 定义节点标签与 pod 规范中 matchExpression 参数中的值集之间的关系。此值可以是 In、NotIn、Exists、DoesNotExist、Lt 或 Gt。 | |
cni_bin_dir | (选答)默认路径为 /opt/cni/bin。您可以使用分配使用的路径覆盖默认的 cni 路径,例如 /var/opt/cni/bin。 | |
grpcTelemetryPort | (选答)输入此参数的值以替代 cRPD 遥测 gRPC 服务器默认端口 50051。 |
|
grpcVrouter端口 | (选答)为此参数输入一个值以覆盖 vRouter gRPC 服务器默认端口 50052。 | |
restoreInterfaces | 将此项的值设置为 true,以便在 vRouter Pod 崩溃或重新启动时将接口还原到其原始状态。 | |
vRouterDeployerPort | (选答)默认值为 8081。配置为在默认端口不可用时覆盖。 | |
bondInterfaceConfigs | 不适用于 GCP 部署。 | |
MTU | 所有物理接口(VF 和 PF)的最大传输单元 (MTU) 值。默认值为 9000。 | |
cpu_core_mask | 指示 vRouter 前向核心掩码。如果启用了 qos,则需要分配 4 个 CPU 核心(主核心和同级核心)。 |
|
stormControlProfiles | 不适用于 GCP 部署。 | |
dpdkCommandAdditionalArgs |
|
传递任何其他 dpdk cmd 行参数。--yield_option 0 默认设置,这意味着 dpdk 转发内核不会产生分配给它的 cpu 内核。可以添加的其他常见参数包括 tx 和 rx 描述符以及内存池。例如: dpdkCommandAdditionalArgs: "--yield_option 0 --dpdk_txd_sz 2048 --dpdk_rxd_sz 2048 --vr_mempool_sz 131072" |
DDP | 不适用于 GCP 部署。 | |
QoS 启用 | 将 GCP 部署设置为 false。 |
|
vrouter_dpdk_uio_driver | uio 驱动程序是 vfio-pci 。 |
|
agentModeType |
|
可以是 dpdk 或 xdp。将 agentModeType 设置为 dpdk 将带来 dpdk 数据路径。将 agentModeType 设置为 xdp 使用 ebpf。默认值为 dpdk。 |
fabricRpfCheckDisable |
|
将此标志设置为 false 可在 JNCR 的所有交换矩阵接口上启用 RPF 检查。默认情况下,RPF 检查处于禁用状态。 |
persistConfig |
|
如果您希望 jcnr-cni 生成的 pod 配置即使在卸载后也能保留,请将此标志设置为 true。该选项只能设置为 L2 模式。默认值为 false。 |
如果要在 GCP 上安装云原生路由器,请将密钥和设置tx
描述rx
符更新dpdkCommandAdditionalArgs
为 256。例如:
dpdkCommandAdditionalArgs: "--yield_option 0 --dpdk_txd_sz 256 --dpdk_rxd_sz 256"
Helm 图表示例
下面提供了 GCP 云原生路由器 helm chart 示例:
用于 GCP 部署的 Helm 图表
工作中的 GCP L3 掌舵图示例如下所示。配置的部分以 粗体突出显示:
#################################################################### # Common Configuration (global vars) # #################################################################### global: registry: enterprise-hub.juniper.net/ # uncomment below if all images are available in the same path; it will # take precedence over "repository" paths under "common" section below repository: jcnr/ # uncomment below if you are using a private registry that needs authentication # registryCredentials - Base64 representation of your Docker registry credentials # secretName - Name of the Secret object that will be created #imagePullSecret: #registryCredentials: <base64-encoded-credential> #secretName: regcred common: vrouter: repository: atom-docker/cn2/bazel-build/dev/x86_64/ tag: R23.4-85 crpd: repository: junos-docker-local/warthog/amd64/ tag: 23.4R1.8 jcnrcni: repository: junos-docker-local/warthog/amd64/ tag: 23.4-20231215-50817e3 telemetryExporter: repository: atom-docker/cn2/bazel-build/dev/x86_64/ tag: R23.4-85 # Number of replicas for cRPD; this option must be used for multinode clusters # JCNR will take 1 as default if replicas is not specified replicas: “2” # storageClass: Name of the storage class for cRPD. This option is must for # cloud deployments such as AWS where gp2 can be used # storageClass: gp2 # Set AWS Region for AWS deployments # awsregion: us-east-1 #noLocalSwitching: [700] # fabricInterface: provide a list of interfaces to be bound to dpdk # You can also provide subnets instead of interface names. Interfaces name take precedence over # Subnet/Gateway combination if both specified (although there is no reason to specify both) # Subnet/Gateway combination comes handy when the interface names vary in a multi-node cluster fabricInterface: ######################### # L2 only #- eth1: # ddp: "auto" # ddp parameter is optional; options include auto or on or off; default: off # interface_mode: trunk # vlan-id-list: [100, 200, 300, 700-705] # storm-control-profile: rate_limit_pf1 # native-vlan-id: 100 # no-local-switching: true #- eth2: # ddp: "auto" # ddp parameter is optional; options include auto or on or off; default: off # interface_mode: trunk # vlan-id-list: [700] # storm-control-profile: rate_limit_pf1 # native-vlan-id: 100 # no-local-switching: true #- bond0: # ddp: "auto" # auto/on/off # ddp parameter is optional; options include auto or on or off; default: off # interface_mode: trunk # vlan-id-list: [100, 200, 300, 700-705] # storm-control-profile: rate_limit_pf1 # #native-vlan-id: 100 # #no-local-switching: true ######################### # L3 only #- eth11: # ddp: "off" # ddp parameter is optional; options include auto or on or off; default: off #- eth2: # ddp: "off" # ddp parameter is optional; options include auto or on or off; default: off ######################## # L2L3 #- eth1: # ddp: "auto" # ddp parameter is optional; options include auto or on or off; default: off #- eth2: # ddp: "auto" # ddp parameter is optional; options include auto or on or off; default: off # interface_mode: trunk # vlan-id-list: [100, 200, 300, 700-705] # storm-control-profile: rate_limit_pf1 # native-vlan-id: 100 # no-local-switching: true ################################## # Provide subnets instead of interface names # Interfaces will be auto-detected in each subnet # Only one of the interfaces or subnet range must # be configured. This form of input is particularly # helpful when the interface names vary in a multi-node # K8s cluster # - subnet: 10.0.3.0/24 # gateway: 10.0.3.1 # ddp: "off" # - subnet: 10.0.5.0/24 # gateway: 10.0.5.1 # ddp: "off" ################################## # fabricWorkloadInterface is applicable only for Pure L2 deployments # #fabricWorkloadInterface: #- enp59s0f1v0: # interface_mode: access # vlan-id-list: [700] #- enp59s0f1v1: # interface_mode: trunk # vlan-id-list: [800, 900] ######################### # defines the log severity. Possible options: DEBUG, INFO, WARN, ERR log_level: "INFO" # "log_path": this directory will contain various jcnr related descriptive logs # such as contrail-vrouter-agent.log, contrail-vrouter-dpdk.log etc. log_path: "/var/log/jcnr/" # "syslog_notifications": absolute path to the file that will contain syslog-ng # generated notifications in json format syslog_notifications: "/var/log/jcnr/jcnr_notifications.json" # core pattern to denote how the core file will be generated # if left empty, JCNR pods will not overwrite the default pattern corePattern: "" # path for the core file; vrouter considers /var/crashes as default value if not specified coreFilePath: /var/crash # nodeAffinity: Can be used to inject nodeAffinity for vRouter, cRPD and syslog-ng pods # You may label the nodes where we wish to deploy JCNR and inject affinity accodingly #nodeAffinity: #- key: key1 # operator: In # values: # - jcnr # cni_bin_dir: Path where the CNI binary will be put; default: /opt/cni/bin # this may be overriden in distributions other than vanilla K8s # e.g. OpenShift - you may use /var/lib/cni/bin or /etc/kubernetes/cni/net.d #cni_bin_dir: /var/lib/cni/bin # grpcTelemetryPort: use this parameter to override cRPD telemetry gRPC server default port of 50051 #grpcTelemetryPort: 50055 # grpcVrouterPort: use this parameter to override vRouter gRPC server default port of 50052 #grpcVrouterPort: 50060 # vRouterDeployerPort: use this parameter to override vRouter deployer port default port of 8081 #vRouterDeployerPort: 8082 jcnr-vrouter: # restoreInterfaces: setting this to true will restore the interfaces # back to their original state in case vrouter pod crashes or restarts restoreInterfaces: false # Enable bond interface configurations L2 only or L2 L3 deployment #bondInterfaceConfigs: # - name: "bond0" # mode: 1 # ACTIVE_BACKUP MODE # slaveInterfaces: # - "enp59s0f0v0" # - "enp59s0f0v1" # primaryInterface: "enp59s0f0v0" # MTU for all physical interfaces( all VF’s and PF’s) mtu: "9000" # vrouter fwd core mask # if qos is enabled, you will need to allocate 4 CPU cores (primary and siblings) cpu_core_mask: "2,3,22,23" # rate limit profiles for bum traffic on fabric interfaces in bytes per second stormControlProfiles: rate_limit_pf1: bandwidth: level: 0 #rate_limit_pf2: # bandwidth: # level: 0 dpdkCommandAdditionalArgs: "--yield_option 0" # Set ddp to enable Dynamic Device Personalization (DDP) # Provides datapath optimization at NIC for traffic like GTPU, SCTP etc. # Options include auto or on or off; default: off ddp: "auto" # Set true/false to Enable or Disable QOS, note: QOS is not supported on X710 NIC. qosEnable: false # uio driver will be vfio-pci or uio_pci_generic vrouter_dpdk_uio_driver: "vfio-pci" # agentModeType will be dpdk or xdp. set agentModeType dpdk will bringup dpdk datapath. set agentModeType to xdp to use ebpf. agentModeType: dpdk # fabricRpfCheckDisable: Set this flag to false to enable the RPF check on all the fabric interfaces of the JNCR, by default RPF check is disabled #fabricRpfCheckDisable: false #jcnr-cni: # persistConfig: set this flag to true if you wish jcnr-cni generated pod configuration to persist even after uninstallation # use this option only in case of l2 mode # default value is false if not specfied #persistConfig: true