示例配置文件
阅读本节以查找用于部署 JCNR 的示例 YAML 配置文件。这些 YAML 文件通过影响部署说明来控制 JCNR 可用的特性和功能。还包括用于工作负载配置的 YAML 文件。工作负载配置文件控制工作负载功能。我们提供了以下示例配置文件:
- 瞻博网络云原生路由器配置五
- 工作负载配置文件
使用这些文件了解可用于部署瞻博网络云原生路由器的配置选项。工作负载配置文件显示如何配置中继接口和接入接口,以及如何为每种类型配置各种 VLAN。每个文件都包含以哈希标记 (#) 开头的注释,并在这些示例中以 粗体 突出显示。
-
values.yaml
#################################################################### # Common Configuration (global vars) # #################################################################### global: registry: svl-artifactory.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: path/to/allimages/ common: vrouter: repository: atom-docker/cn2/bazel-build/dev/ tag: JCNR-22.2-20 crpd: repository: junos-docker-local/warthog/ tag: 22.2R1-S1.5 jcnrcni: repository: junos-docker-local/warthog/ tag: 20220810-f753972 # 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" # fabricInterface: NGDU or tor side interface, expected all types # of traffic; interface_mode is always trunk for this mode fabricInterface: - bond0: interface_mode: trunk vlan-id-list: [100, 200, 300, 700-705] # fabricWorkloadInterface: RU side interfaces, expected traffic is only # management/control traffic; interface mode is always access for this mode fabricWorkloadInterface: - enp59s0f1v0: interface_mode: access vlan-id-list: [700] 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 # bond interface configurations bondInterfaceConfigs: - name: "bond0" mode: 1 # ACTIVE_BACKUP MODE slaveInterfaces: - "enp59s0f0v0" - "enp59s0f0v1" # MTU for all physical interfaces( all VF’s and PF’s) mtu: "9000" # vrouter fwd core mask cpu_core_mask: "2,3" # rate limit for broadcast/multicast traffic on fabric interfaces in bytes per second fabricBMCastRateLimit: 0
-
nad-dpdk_trunk_vlan_3002.yaml
apiVersion: "k8s.cni.cncf.io/v1" kind: NetworkAttachmentDefinition metadata: name: nad-vswitch-bd3002 spec: config: '{ "cniVersion":"0.4.0", "name": "nad-vswitch-bd3002", "capabilities":{"ips":true}, "plugins": [ { "type": "jcnr", "args": { "instanceName": "vswitch", "instanceType": "virtual-switch", "bridgeDomain": "bd3002", "bridgeVlanId": "3002", "dataplane":"dpdk", "mtu": "9000" }, "ipam": { "type": "static", "capabilities":{"ips":true}, "addresses":[ { "address":"2001:db8:3002::10.2.0.1/64", "gateway":"2001:db83002::10.2.0.254" }, { "address":"10.2.0.1/24", "gateway":"10.2.0.254" } ] }, "kubeConfig":"/etc/kubernetes/kubelet.conf" } ] }'
-
nad-kernel_access_vlan_3001.yaml
apiVersion: "k8s.cni.cncf.io/v1" kind: NetworkAttachmentDefinition metadata: name: pod1-vswitch-bd3001-1 spec: config: '{ "cniVersion":"0.4.0", "name": "pod1-vswitch-bd3001-1", "capabilities":{"ips":true}, "plugins": [ { "type": "jcnr", "args": { "instanceName": "vswitch", "instanceType": "virtual-switch", "bridgeDomain": "bd3001", "bridgeVlanId": "3001", "dataplane":"dpdk", "mtu": "9000", "interfaceType":"veth" }, "ipam": { "type": "static", "capabilities":{"ips":true}, "addresses":[ { "address":"2001:db8:3001::10.1.0.1/64", "gateway":"2001:db8:3001::10.1.0.254" }, { "address":"10.1.0.1/24", "gateway":"10.1.0.254" } ] }, "kubeConfig":"/etc/kubernetes/kubelet.conf" } ] }'
-
nad-odu-bd3003-sub.yaml
apiVersion: "k8s.cni.cncf.io/v1" kind: NetworkAttachmentDefinition metadata: name: vswitch-bd3003-sub spec: config: '{ "cniVersion":"0.4.0", "name": "vswitch-bd3003-sub", "capabilities":{"ips":true}, "plugins": [ { "type": "jcnr", "args": { "instanceName": "vswitch", "instanceType": "virtual-switch", "bridgeDomain": "bd3003", "bridgeVlanId": "3003", "parentInterface":"net1", "interface":"net1.3003", "dataplane":"dpdk" }, "ipam": { "type": "static", "capabilities":{"ips":true}, "addresses":[ { "address":"10.3.0.1/24", "gateway":"10.3.0.254" }, { "address":"2001:db8:3003::10.3.0.1/120", "gateway":"2001:db8:3003::10.3.0.1" } ] }, "kubeConfig":"/etc/kubernetes/kubelet.conf" } ] }'
-
nad-odu-bd3004-sub.yaml
apiVersion: "k8s.cni.cncf.io/v1" kind: NetworkAttachmentDefinition metadata: name: vswitch-bd3004-sub spec: config: '{ "cniVersion":"0.4.0", "name": "vswitch-bd3004-sub", "capabilities":{"ips":true}, "plugins": [ { "type": "jcnr", "args": { "instanceName": "vswitch", "instanceType": "virtual-switch", "bridgeDomain": "bd3004", "bridgeVlanId": "3004", "parentInterface":"net1", "interface":"net1.3004", "dataplane":"dpdk" }, "ipam": { "type": "static", "capabilities":{"ips":true}, "addresses":[ { "address":"30.4.0.1/24", "gateway":"30.4.0.254" }, { "address":"2001:db8:3004::10.4.0.1/120", "gateway":"2001:db8:3004::10.4.0.1" } ] }, "kubeConfig":"/etc/kubernetes/kubelet.conf" } ] }'
-
odu-virtio-subinterface.yaml
apiVersion: v1 kind: Pod metadata: name: odu-subinterface-1 annotations: k8s.v1.cni.cncf.io/networks: | [ { "name": "vswitch-bd3003-sub" }, { "name": "vswitch-bd3004-sub" } ] spec: affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: kubernetes.io/hostname operator: In values: - 5d7s39.englab.juniper.net containers: - name: odu-subinterface image: svl-artifactory.juniper.net/junos-docker-local/warthog/pktgen19116:subint imagePullPolicy: IfNotPresent securityContext: privileged: false resources: requests: memory: 2Gi limits: hugepages-1Gi: 2Gi env: - name: KUBERNETES_POD_UID valueFrom: fieldRef: fieldPath: metadata.uid volumeMounts: - name: dpdk mountPath: /dpdk subPathExpr: $(KUBERNETES_POD_UID) - mountPath: /dev/hugepages name: hugepage volumes: - name: dpdk hostPath: path: /var/run/jcnr/containers - name: hugepage emptyDir: medium: HugePages
-
pod-dpdk-trunk-vlan3002.yaml
apiVersion: v1 kind: Pod metadata: name: odu-trunk-1 annotations: k8s.v1.cni.cncf.io/networks: nad-vswitch-bd3002 spec: containers: - name: odu-trunk image: svl-artifactory.juniper.net/junos-docker-local/warthog/pktgen19116:trunk imagePullPolicy: IfNotPresent securityContext: privileged: true resources: requests: memory: 2Gi limits: hugepages-1Gi: 2Gi env: - name: KUBERNETES_POD_UID valueFrom: fieldRef: fieldPath: metadata.uid volumeMounts: - name: dpdk mountPath: /dpdk subPathExpr: $(KUBERNETES_POD_UID) - mountPath: /dev/hugepages name: hugepage volumes: - name: dpdk hostPath: path: /var/run/jcnr/containers - name: hugepage emptyDir: medium: HugePages
-
pod-kernel-access-vlan-3001.yaml
apiVersion: v1 kind: Pod metadata: name: odu-kenel-pod-bd3001-1 annotations: k8s.v1.cni.cncf.io/networks: pod1-vswitch-bd3001-1 spec: affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: kubernetes.io/hostname operator: In values: - 5d8s7.englab.juniper.net containers: - name: odu-kenel-pod-bd3001-1 image: vinod-iperf3:latest imagePullPolicy: IfNotPresent command: ["/bin/bash","-c","sleep infinity"] securityContext: privileged: false env: - name: KUBERNETES_POD_UID valueFrom: fieldRef: fieldPath: metadata.uid volumeMounts: - name: dpdk mountPath: /dpdk subPathExpr: $(KUBERNETES_POD_UID) volumes: - name: dpdk hostPath: path: /var/run/jcnr/containers