├── LICENSE ├── README.md ├── multus ├── .helmignore ├── Chart.yaml ├── templates │ ├── NOTES.txt │ ├── _helpers.tpl │ ├── clusterRole.yaml │ ├── clusterRoleBinding.yaml │ ├── configMap.yaml │ ├── customResourceDefinition.yaml │ ├── daemonSet.yaml │ └── serviceAccount.yaml └── values.yaml ├── network-resources-injector ├── .helmignore ├── Chart.yaml ├── templates │ ├── NOTES.txt │ ├── auth.yaml │ ├── deployment.yaml │ ├── pdb.yaml │ ├── service.yaml │ └── webhook.yaml └── values.yaml ├── sriov ├── .helmignore ├── Chart.yaml ├── templates │ ├── NOTES.txt │ ├── _helpers.tpl │ ├── configMap_sriov_device_plugin.yaml │ ├── daemonSet_sriov_cni.yaml │ ├── daemonSet_sriov_device_plugin.yaml │ ├── net_attach_def_dpdk.yaml │ ├── net_attach_def_netdev.yaml │ ├── serviceAccount.yaml │ └── tests │ │ ├── test-dpdk.yaml │ │ └── test-netdevice.yaml └── values.yaml └── whereabouts ├── .helmignore ├── Chart.yaml ├── crds ├── whereabouts.cni.cncf.io_ippools.yaml └── whereabouts.cni.cncf.io_overlappingrangeipreservations.yaml ├── templates ├── NOTES.txt ├── _helpers.tpl ├── cluster_role.yaml ├── cluster_role_binding.yaml ├── cronjob.yaml ├── daemonset.yaml └── serviceaccount.yaml └── values.yaml /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # helm-charts 2 | Helm charts for deployment of NPWG implementations and ancillary tools 3 | 4 | ## Quick guide - Helm 5 | 6 | Refer Helm [Quickstart Guide](https://helm.sh/docs/intro/quickstart/) and [Installation Guide](https://helm.sh/docs/intro/install/) 7 | 8 | Helm charts are generally structured like an example below: 9 | ``` 10 | $ tree multus/ 11 | multus/ 12 | |-- charts 13 | |-- Chart.yaml 14 | |-- templates 15 | | |-- clusterRoleBinding.yaml 16 | | |-- clusterRole.yaml 17 | | |-- configMap.yaml 18 | | |-- customResourceDefinition.yaml 19 | | |-- daemonSet.yaml 20 | | |-- _helpers.tpl 21 | | |-- NOTES.txt 22 | | |-- serviceAccount.yaml 23 | |-- values.yaml 24 | ``` 25 | 26 | Here, 27 | The `templates/` directory is for template files. When Helm evaluates a chart, it will send all of the files in the templates/ directory through the template rendering engine. It then collects the results of those templates and sends them on to Kubernetes. 28 | 29 | The `values.yaml` file is important to templates and contains the default values for a chart. These values may be overridden by users during helm install or helm upgrade. 30 | 31 | The `Chart.yaml` file contains a description of the chart. You can access it from within a template. 32 | 33 | ## Multus deployment using Helm Charts 34 | 35 | ### Prerequisites for Multus Deployment 36 | 37 | * Kubelet configured to use CNI 38 | * Charts have been tested with Kubernetes version >= 1.16 39 | * Helm is deployed on the sever. Refer [installation guide](https://helm.sh/docs/intro/install/) for more details. 40 | * Helm charts have been downloaded on server from [git repository](https://github.com/k8snetworkplumbingwg/helm-charts) 41 | 42 | Your Kubelet(s) must be configured to run with the CNI network plugin. Please see [Kubernetes document for CNI](https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/#cni) for more details. 43 | 44 | ### Installing Multus using Helm 45 | 46 | To configure a helm chart, you need to configure some parameters as per your environment. To make such adjustments, please check `values.yaml`. The following configurations might need some adjustments based on your environment: 47 | * Multus image parameters 48 | ``` 49 | image: 50 | registry: docker.io 51 | repository: nfvpe/multus 52 | tag: v3.4 53 | pullPolicy: IfNotPresent 54 | ``` 55 | * Node Selector Labels 56 | ``` 57 | labels: 58 | nodeSelector: 59 | kubernetes.io/arch: amd64 60 | ``` 61 | * Multus configuration parameters 62 | ``` 63 | config: 64 | cni_conf: 65 | name: multus-cni-network 66 | type: multus 67 | kubeconfig: /etc/cni/net.d/multus.d/multus.kubeconfig 68 | cniVersion: 0.3.1 69 | confDir: /etc/cni/net.d 70 | cniDir: /var/lib/cni/multus 71 | binDir: /opt/cni/bin 72 | logFile: /var/log/multus.log 73 | logLevel: panic 74 | capabilities: 75 | portMappings: true 76 | readinessindicatorfile: "" 77 | namespaceIsolation: false 78 | clusterNetwork: k8s-pod-network 79 | defaultNetwork: [] 80 | delegates: [] 81 | systemNamespaces: ["kube-system"] 82 | ``` 83 | * Multus pod resources 84 | ``` 85 | pod: 86 | resources: 87 | enabled: false 88 | multus: 89 | requests: 90 | memory: "128Mi" 91 | cpu: "250m" 92 | limits: 93 | memory: "1024Mi" 94 | cpu: "2000m" 95 | ``` 96 | 97 | Once the parameters are configured per the environment, you can install Multus helm chart with following steps: 98 | ``` 99 | $ cd helm-charts/ 100 | $ helm install choice-unlimited ./multus 101 | ``` 102 | 103 | You can check your environment for appropriate deployment of Multus: 104 | ``` 105 | $ kubectl get all -A | grep choice-unlimited 106 | kube-system pod/choice-unlimited-multus-ds-fxsl7 1/1 Running 0 39h 107 | kube-system pod/choice-unlimited-multus-ds-qvcsj 1/1 Running 0 39h 108 | kube-system daemonset.apps/choice-unlimited-multus-ds 2 2 2 2 2 kubernetes.io/arch=amd64 39h 109 | 110 | $ kubectl get cm -A | grep choice-unlimited 111 | kube-system choice-unlimited-multus-0.1.0-config 1 39h 112 | 113 | $ kubectl get crd | grep network-attachment 114 | network-attachment-definitions.k8s.cni.cncf.io 2020-03-29T00:07:09Z 115 | ``` 116 | Ensure that these pods are in `running` state. One can additionally check forcreation of following files: 117 | * /etc/cni/net.d/00-multus.cfg 118 | * /etc/cni/net.d/multus.d/multus.kubeconfig 119 | * /opt/cni/bin/multus 120 | * files under /var/lib/cni/multus/ 121 | * log file created per path mentioned in configuration 122 | 123 | At this stage, try creating a pod and you should be able to see the networking through using the default/clusterNetwork. One can now add other CNIs and enable the pods to be connected to those using network-attachment-defintions. An example is shown below for addition of SR-IOV CNI which shall also create SR-IOV CNI related network attachment defintions. 124 | 125 | ## SR-IOV CNI deployment using Helm Charts 126 | 127 | ### Prerequisites for SR-IOV CNI Deployment 128 | 129 | * Kubelet configured to use CNI 130 | * Charts have been tested with Kubernetes version >= 1.16 131 | * Helm is deployed on the sever. Refer [installation guide](https://helm.sh/docs/intro/install/) for more details. 132 | * Helm charts have been downloaded on server from [git repository](https://github.com/k8snetworkplumbingwg/helm-charts) 133 | * Compute servers are configured for sriov configuration 134 | * Virtual functions are configured on respective NIC cards and are bind with appropriate driver 135 | 136 | Your Kubelet(s) must be configured to run with the CNI network plugin. Please see [Kubernetes document for CNI](https://kubernetes.io/docs/concepts/extend-kubernetes/compute-storage-net/network-plugins/#cni) for more details. 137 | 138 | ### Installing SR-IOV CNI using Helm 139 | 140 | To configure a helm chart, you need to configure some parameters as per your environment. To make such adjustments, please check `values.yaml`. The following configurations might need some adjustments based on your environment: 141 | * SR-IOV CNI image parameters 142 | ``` 143 | images: 144 | registry: docker.io 145 | sriovCni: 146 | repository: nfvpe/sriov-cni 147 | tag: v2.2 148 | sriovDevicePlugin: 149 | repository: nfvpe/sriov-device-plugin 150 | tag: v3.1 151 | pullPolicy: IfNotPresent 152 | ``` 153 | * Node selector labels 154 | ``` 155 | labels: 156 | nodeSelector: 157 | kubernetes.io/arch: amd64 158 | ``` 159 | * Configuration with apprrpriate resource list. The code herein assumes that the virtual functions 8-31 on interfaces enp67s0f0 and enp68s0f0 are bind with VFIO driver. 160 | ``` 161 | config: 162 | scMountPaths: 163 | cnibin: "/host/opt/cni/bin" 164 | sdpMountPaths: 165 | deviceSock: "/var/lib/kubelet/device-plugins/" 166 | log: "/var/log" 167 | configVolume: "/etc/pcidp/config.json" 168 | sriov_device_plugin: 169 | resourceList: 170 | - resourceName: intel_sriov_netdevice 171 | selectors: 172 | vendors: 173 | - '8086' 174 | devices: 175 | - 154c 176 | - 10ed 177 | drivers: 178 | - i40evf 179 | - ixgbevf 180 | - resourceName: intel_sriov_dpdk 181 | selectors: 182 | vendors: 183 | - '8086' 184 | devices: 185 | - 154c 186 | - 10ed 187 | drivers: 188 | - vfio-pci 189 | pfNames: 190 | - enp67s0f1#8-31 191 | - enp68s0f0#8-31 192 | ``` 193 | * Creation fo appropriate charts 194 | ``` 195 | manifests: 196 | serviceAccount: true 197 | configMap_sriov_device_plugin: true 198 | daemonSet_sriov_device_plugin: true 199 | daemonSet_sriov_cni: true 200 | net_attach_def_netdev: true 201 | net_attach_def_dpdk: true 202 | test_netdevice: true 203 | test_dpdk: true 204 | ``` 205 | One can disable the creation of network attachment definitions and test pods by setting value `false` in configuration above. At this stage, you can create more network-attachment-definitions and pods for SR-IOV according to your environment. 206 | 207 | Finally, we have seen how to deploy Multus and SR-IOV CNI using helm charts. Post deployment of each of these charts, the output shows the components deployed as part of helm deployment. It also states the steps to uninstall the helm charts in the environment. 208 | -------------------------------------------------------------------------------- /multus/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *~ 18 | # Various IDEs 19 | .project 20 | .idea/ 21 | *.tmproj 22 | .vscode/ 23 | -------------------------------------------------------------------------------- /multus/Chart.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2020 K8s Network Plumbing Group 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | apiVersion: v2 15 | name: multus 16 | description: Multus Helm chart for Kubernetes 17 | type: application 18 | version: 0.1.2 19 | home: https://github.com/intel/multus-cni 20 | icon: https://raw.githubusercontent.com/intel/multus-cni/master/doc/images/Multus.png 21 | sources: 22 | - https://github.com/intel/multus-cni 23 | maintainers: 24 | - name: Network Plumbing Group 25 | appVersion: 0.1.0 26 | -------------------------------------------------------------------------------- /multus/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | ====== 2 | {{- if or ( gt .Capabilities.KubeVersion.Major "1" ) ( ge .Capabilities.KubeVersion.Minor "16" ) }} 3 | 1. The following components have been deployed as part of this helm chart: 4 | {{- if .Values.manifests.clusterRole }} 5 | Cluster Role: {{ .Values.serviceAccount.name }} 6 | {{- end}} 7 | {{- if .Values.manifests.clusterRoleBinding }} 8 | Cluster Role Binding: {{ .Chart.Name }} 9 | {{- end }} 10 | {{- if .Values.manifests.configMap }} 11 | Config Map: {{ .Release.Name }}-{{ .Chart.Name }}-{{ .Chart.Version }}-config 12 | {{- end }} 13 | {{- if .Values.manifests.customResourceDefinition }} 14 | Custom Resource Definition: network-attachment-definitions.k8s.cni.cncf.io 15 | {{- end }} 16 | {{- if .Values.manifests.daemonSet }} 17 | Daemon Set: {{ .Release.Name }}-{{ .Chart.Name }}-ds 18 | {{- end }} 19 | {{- if .Values.manifests.serviceAccount }} 20 | Service Account: {{ .Values.serviceAccount.name }} 21 | {{- end }} 22 | 23 | You can now deploy any other CNI and create its Network Attachment Defintion. 24 | --------- 25 | 26 | 2. To uninstall helm chart use the command: 27 | helm delete {{ .Release.Name }} 28 | 29 | You may have to manually delete CRD - 30 | kubectl delete crd network-attachment-definitions.k8s.cni.cncf.io 31 | --------- 32 | {{- else }} 33 | To run these charts, please use K8s ver >= v1.16 34 | {{- end }} 35 | -------------------------------------------------------------------------------- /multus/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | # Copyright 2020 K8s Network Plumbing Group 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | {{/* Generate basic labels */}} 16 | {{- define "multus.labels" }} 17 | tier: node 18 | app: {{ .Chart.Name }} 19 | {{- end }} 20 | -------------------------------------------------------------------------------- /multus/templates/clusterRole.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2020 K8s Network Plumbing Group 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | {{- if or ( gt .Capabilities.KubeVersion.Major "1" ) ( ge .Capabilities.KubeVersion.Minor "16" ) }} 15 | {{- if .Values.manifests.clusterRole }} 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRole 18 | metadata: 19 | name: {{ .Values.serviceAccount.name }} 20 | rules: 21 | - apiGroups: ["k8s.cni.cncf.io"] 22 | resources: 23 | - '*' 24 | verbs: 25 | - '*' 26 | - apiGroups: 27 | - "" 28 | resources: 29 | - pods 30 | - pods/status 31 | verbs: 32 | - get 33 | - update 34 | - apiGroups: 35 | - "" 36 | resources: 37 | - events 38 | verbs: 39 | - create 40 | {{- end }} 41 | {{- end }} 42 | -------------------------------------------------------------------------------- /multus/templates/clusterRoleBinding.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2020 K8s Network Plumbing Group 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | {{- if or ( gt .Capabilities.KubeVersion.Major "1" ) ( ge .Capabilities.KubeVersion.Minor "16" ) }} 15 | {{- if .Values.manifests.clusterRoleBinding }} 16 | apiVersion: rbac.authorization.k8s.io/v1 17 | kind: ClusterRoleBinding 18 | metadata: 19 | name: {{ .Chart.Name }} 20 | roleRef: 21 | apiGroup: rbac.authorization.k8s.io 22 | kind: ClusterRole 23 | name: {{ .Chart.Name }} 24 | subjects: 25 | - kind: ServiceAccount 26 | name: {{ .Values.serviceAccount.name }} 27 | namespace: kube-system 28 | {{- end }} 29 | {{- end }} 30 | -------------------------------------------------------------------------------- /multus/templates/configMap.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2020 K8s Network Plumbing Group 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | {{- if or ( gt .Capabilities.KubeVersion.Major "1" ) ( ge .Capabilities.KubeVersion.Minor "16" ) }} 15 | {{- if .Values.manifests.configMap }} 16 | apiVersion: v1 17 | kind: ConfigMap 18 | metadata: 19 | name: {{ .Release.Name }}-{{ .Chart.Name }}-{{ .Chart.Version }}-config 20 | namespace: kube-system 21 | labels: 22 | {{- include "multus.labels" . | indent 4 }} 23 | data: 24 | cni-conf.json: |- 25 | {{ toJson .Values.config.cni_conf | indent 4 }} 26 | {{- end }} 27 | {{- end }} 28 | -------------------------------------------------------------------------------- /multus/templates/customResourceDefinition.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2020 K8s Network Plumbing Group 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | {{- if or ( gt .Capabilities.KubeVersion.Major "1" ) ( ge .Capabilities.KubeVersion.Minor "16" ) }} 15 | {{- if .Values.manifests.customResourceDefinition }} 16 | apiVersion: apiextensions.k8s.io/v1 17 | kind: CustomResourceDefinition 18 | metadata: 19 | name: network-attachment-definitions.k8s.cni.cncf.io 20 | spec: 21 | group: k8s.cni.cncf.io 22 | scope: Namespaced 23 | names: 24 | plural: network-attachment-definitions 25 | singular: network-attachment-definition 26 | kind: NetworkAttachmentDefinition 27 | shortNames: 28 | - net-attach-def 29 | versions: 30 | - name: v1 31 | served: true 32 | storage: true 33 | schema: 34 | openAPIV3Schema: 35 | type: object 36 | properties: 37 | spec: 38 | type: object 39 | properties: 40 | config: 41 | type: string 42 | {{- end }} 43 | {{- end }} 44 | -------------------------------------------------------------------------------- /multus/templates/daemonSet.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2020 K8s Network Plumbing Group 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | {{- if or ( gt .Capabilities.KubeVersion.Major "1" ) ( ge .Capabilities.KubeVersion.Minor "16" ) }} 15 | {{- if .Values.manifests.daemonSet }} 16 | apiVersion: apps/v1 17 | kind: DaemonSet 18 | metadata: 19 | name: {{ .Release.Name }}-{{ .Chart.Name }}-ds 20 | namespace: kube-system 21 | labels: 22 | {{- include "multus.labels" . | indent 4 }} 23 | spec: 24 | selector: 25 | matchLabels: 26 | app: multus 27 | updateStrategy: 28 | type: RollingUpdate 29 | rollingUpdate: 30 | maxUnavailable: 1 31 | template: 32 | metadata: 33 | labels: 34 | {{- include "multus.labels" . | indent 8 }} 35 | annotations: 36 | checksum/config: {{ include (print $.Template.BasePath "/configMap.yaml") . | sha256sum }} 37 | spec: 38 | priorityClassName: system-node-critical 39 | hostNetwork: true 40 | {{- with .Values.imagePullSecrets }} 41 | imagePullSecrets: 42 | {{- toYaml . | nindent 8 }} 43 | {{- end }} 44 | nodeSelector: {{- toYaml .Values.labels.nodeSelector | nindent 8 }} 45 | tolerations: 46 | - operator: Exists 47 | effect: NoSchedule 48 | serviceAccountName: {{ .Values.serviceAccount.name }} 49 | containers: 50 | - name: kube-{{ .Chart.Name }} 51 | image: {{ .Values.image.repository }}:{{ .Values.image.tag }} 52 | imagePullPolicy: {{ .Values.image.pullPolicy }} 53 | env: 54 | - name: KUBERNETES_NODE_NAME 55 | valueFrom: 56 | fieldRef: 57 | fieldPath: spec.nodeName 58 | command: 59 | - /bin/bash 60 | - -cex 61 | - | 62 | #!/bin/bash 63 | sed "s|__KUBERNETES_NODE_NAME__|${KUBERNETES_NODE_NAME}|g" /tmp/multus-conf/00-multus.conf.template > /tmp/multus-conf/00-multus.conf 64 | /entrypoint.sh \ 65 | --multus-conf-file=/tmp/multus-conf/00-multus.conf 66 | {{- if .Values.pod.resources.multus }} 67 | resources: {{- toYaml .Values.pod.resources.multus | nindent 10 }} 68 | {{- end }} 69 | securityContext: 70 | privileged: true 71 | volumeMounts: 72 | - name: cni 73 | mountPath: /host/etc/cni/net.d 74 | - name: cnibin 75 | mountPath: /host/opt/cni/bin 76 | {{- if .Values.manifests.configMap }} 77 | - name: multus-cfg 78 | mountPath: /tmp/multus-conf/00-multus.conf.template 79 | subPath: "cni-conf.json" 80 | {{- end }} 81 | volumes: 82 | - name: cni 83 | hostPath: 84 | path: /etc/cni/net.d 85 | - name: cnibin 86 | hostPath: 87 | path: /opt/cni/bin 88 | {{- if .Values.manifests.configMap }} 89 | - name: multus-cfg 90 | configMap: 91 | name: {{ .Release.Name }}-{{ .Chart.Name }}-{{ .Chart.Version }}-config 92 | {{- end }} 93 | {{- end }} 94 | {{- end }} 95 | -------------------------------------------------------------------------------- /multus/templates/serviceAccount.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2020 K8s Network Plumbing Group 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | {{- if or ( gt .Capabilities.KubeVersion.Major "1" ) ( ge .Capabilities.KubeVersion.Minor "16" ) }} 15 | {{- if .Values.manifests.serviceAccount }} 16 | apiVersion: v1 17 | kind: ServiceAccount 18 | metadata: 19 | name: {{ .Values.serviceAccount.name }} 20 | namespace: kube-system 21 | {{- end }} 22 | {{- end }} 23 | -------------------------------------------------------------------------------- /multus/values.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2020 K8s Network Plumbing Group 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Default values for multus. 16 | # This is a YAML-formatted file. 17 | # Declare variables to be passed into your templates. 18 | 19 | #replicaCount: 1 20 | 21 | image: 22 | repository: ghcr.io/k8snetworkplumbingwg/multus-cni 23 | tag: v3.8 24 | pullPolicy: IfNotPresent 25 | 26 | #imagePullSecrets: [] 27 | #nameOverride: "" 28 | #fullnameOverride: "" 29 | 30 | serviceAccount: 31 | # Specifies whether a service account should be created 32 | #create: true 33 | # Annotations to add to the service account 34 | #annotations: {} 35 | # The name of the service account to use. 36 | # If not set and create is true, a name is generated using the fullname template 37 | name: multus 38 | 39 | pod: 40 | resources: 41 | enabled: false 42 | multus: 43 | requests: 44 | memory: "128Mi" 45 | cpu: "250m" 46 | limits: 47 | memory: "1024Mi" 48 | cpu: "2000m" 49 | 50 | #podSecurityContext: {} 51 | # fsGroup: 2000 52 | 53 | #securityContext: {} 54 | # capabilities: 55 | # drop: 56 | # - ALL 57 | # readOnlyRootFilesystem: true 58 | # runAsNonRoot: true 59 | # runAsUser: 1000 60 | 61 | #service: 62 | #type: ClusterIP 63 | #port: 80 64 | 65 | #ingress: 66 | #enabled: false 67 | #annotations: {} 68 | # kubernetes.io/ingress.class: nginx 69 | # kubernetes.io/tls-acme: "true" 70 | #hosts: 71 | #- host: chart-example.local 72 | # paths: [] 73 | #tls: [] 74 | # - secretName: chart-example-tls 75 | # hosts: 76 | # - chart-example.local 77 | 78 | labels: 79 | nodeSelector: 80 | kubernetes.io/arch: amd64 81 | 82 | config: 83 | cni_conf: 84 | name: multus-cni-network 85 | type: multus 86 | kubeconfig: /etc/cni/net.d/multus.d/multus.kubeconfig 87 | cniVersion: 0.3.1 88 | confDir: /etc/cni/net.d 89 | cniDir: /var/lib/cni/multus 90 | binDir: /opt/cni/bin 91 | logFile: /var/log/multus.log 92 | logLevel: panic 93 | capabilities: 94 | portMappings: true 95 | readinessindicatorfile: "" 96 | namespaceIsolation: false 97 | clusterNetwork: k8s-pod-network 98 | defaultNetwork: [] 99 | delegates: [] 100 | systemNamespaces: ["kube-system"] 101 | 102 | manifests: 103 | serviceAccount: true 104 | clusterRole: true 105 | clusterRoleBinding: true 106 | configMap: true 107 | daemonSet: true 108 | customResourceDefinition: true 109 | 110 | #tolerations: [] 111 | 112 | #affinity: {} 113 | -------------------------------------------------------------------------------- /network-resources-injector/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *.orig 18 | *~ 19 | # Various IDEs 20 | .project 21 | .idea/ 22 | *.tmproj 23 | .vscode/ 24 | -------------------------------------------------------------------------------- /network-resources-injector/Chart.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 K8s Network Plumbing Group 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | apiVersion: v2 15 | name: network-resources-injector 16 | description: Network resource injector helm chart for Kubernetes 17 | type: application 18 | version: 0.1.0 19 | home: https://github.com/k8snetworkplumbingwg/network-resources-injector 20 | sources: 21 | - https://github.com/k8snetworkplumbingwg/network-resources-injector 22 | maintainers: 23 | - name: Network Plumbing Group 24 | appVersion: 1.3 25 | -------------------------------------------------------------------------------- /network-resources-injector/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | network-resources-injector is installed!! 2 | 3 | You can view the pods with the following command: 4 | 5 | kubectl get pods -n kube-system -l app=network-resources-injector 6 | -------------------------------------------------------------------------------- /network-resources-injector/templates/auth.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 K8s Network Plumbing Group 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http:#www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | --- 15 | apiVersion: v1 16 | kind: ServiceAccount 17 | metadata: 18 | namespace: kube-system 19 | name: {{ .Values.serviceAccount.name }} 20 | --- 21 | apiVersion: v1 22 | kind: Secret 23 | metadata: 24 | name: {{ .Values.secret.name }} 25 | namespace: kube-system 26 | annotations: 27 | kubernetes.io/service-account.name: {{ .Values.serviceAccount.name }} 28 | type: kubernetes.io/service-account-token 29 | --- 30 | apiVersion: rbac.authorization.k8s.io/v1 31 | kind: ClusterRole 32 | metadata: 33 | name: {{ .Chart.Name }} 34 | rules: 35 | - apiGroups: 36 | - "" 37 | - k8s.cni.cncf.io 38 | - extensions 39 | - apps 40 | resources: 41 | - replicationcontrollers 42 | - replicasets 43 | - daemonsets 44 | - statefulsets 45 | - pods 46 | - network-attachment-definitions 47 | verbs: 48 | - '*' 49 | --- 50 | apiVersion: rbac.authorization.k8s.io/v1 51 | kind: ClusterRole 52 | metadata: 53 | name: {{ .Values.role.secretsName }} 54 | rules: 55 | - apiGroups: 56 | - "" 57 | resources: 58 | - secrets 59 | verbs: 60 | - '*' 61 | --- 62 | apiVersion: rbac.authorization.k8s.io/v1 63 | kind: ClusterRole 64 | metadata: 65 | name: {{ .Values.role.webhookconfigName }} 66 | rules: 67 | - apiGroups: 68 | - admissionregistration.k8s.io 69 | resources: 70 | - mutatingwebhookconfigurations 71 | - validatingwebhookconfigurations 72 | verbs: 73 | - '*' 74 | --- 75 | apiVersion: rbac.authorization.k8s.io/v1 76 | kind: ClusterRole 77 | metadata: 78 | name: {{ .Values.role.serviceName }} 79 | rules: 80 | - apiGroups: 81 | - "" 82 | resources: 83 | - services 84 | verbs: 85 | - '*' 86 | --- 87 | apiVersion: rbac.authorization.k8s.io/v1 88 | kind: ClusterRole 89 | metadata: 90 | name: {{ .Values.role.configmapsName }} 91 | rules: 92 | - apiGroups: 93 | - "" 94 | resources: 95 | - configmaps 96 | verbs: 97 | - 'get' 98 | --- 99 | apiVersion: rbac.authorization.k8s.io/v1 100 | kind: ClusterRoleBinding 101 | metadata: 102 | name: {{ .Values.roleBinding.name }} 103 | roleRef: 104 | apiGroup: rbac.authorization.k8s.io 105 | kind: ClusterRole 106 | name: {{ .Chart.Name }} 107 | subjects: 108 | - kind: ServiceAccount 109 | name: {{ .Values.serviceAccount.name }} 110 | namespace: kube-system 111 | --- 112 | apiVersion: rbac.authorization.k8s.io/v1 113 | kind: ClusterRoleBinding 114 | metadata: 115 | name: {{ .Values.roleBinding.secretsName }} 116 | roleRef: 117 | apiGroup: rbac.authorization.k8s.io 118 | kind: ClusterRole 119 | name: {{ .Values.role.secretsName }} 120 | subjects: 121 | - kind: ServiceAccount 122 | name: {{ .Values.serviceAccount.name }} 123 | namespace: kube-system 124 | --- 125 | apiVersion: rbac.authorization.k8s.io/v1 126 | kind: ClusterRoleBinding 127 | metadata: 128 | name: {{ .Values.roleBinding.webhookconfigName }} 129 | roleRef: 130 | apiGroup: rbac.authorization.k8s.io 131 | kind: ClusterRole 132 | name: {{ .Values.role.webhookconfigName }} 133 | subjects: 134 | - kind: ServiceAccount 135 | name: {{ .Values.serviceAccount.name }} 136 | namespace: kube-system 137 | --- 138 | apiVersion: rbac.authorization.k8s.io/v1 139 | kind: ClusterRoleBinding 140 | metadata: 141 | name: {{ .Values.roleBinding.serviceName }} 142 | roleRef: 143 | apiGroup: rbac.authorization.k8s.io 144 | kind: ClusterRole 145 | name: {{ .Values.role.serviceName }} 146 | subjects: 147 | - kind: ServiceAccount 148 | name: {{ .Values.serviceAccount.name }} 149 | namespace: kube-system 150 | --- 151 | apiVersion: rbac.authorization.k8s.io/v1 152 | kind: ClusterRoleBinding 153 | metadata: 154 | name: {{ .Values.roleBinding.configmapsName }} 155 | roleRef: 156 | apiGroup: rbac.authorization.k8s.io 157 | kind: ClusterRole 158 | name: {{ .Values.role.configmapsName }} 159 | subjects: 160 | - kind: ServiceAccount 161 | name: {{ .Values.serviceAccount.name }} 162 | namespace: kube-system 163 | -------------------------------------------------------------------------------- /network-resources-injector/templates/deployment.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 K8s Network Plumbing Group 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http:#www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | --- 15 | apiVersion: apps/v1 16 | kind: Deployment 17 | metadata: 18 | labels: 19 | app: {{ .Chart.Name }} 20 | name: {{ .Chart.Name }} 21 | namespace: kube-system 22 | spec: 23 | replicas: {{ .Values.deployment.replicas }} 24 | selector: 25 | matchLabels: 26 | app: {{ .Chart.Name }} 27 | template: 28 | metadata: 29 | labels: 30 | app: {{ .Chart.Name }} 31 | spec: 32 | serviceAccount: {{ .Values.serviceAccount.name }} 33 | containers: 34 | - name: webhook-server 35 | image: {{ .Values.image.repository }}:{{ .Values.image.tag }} 36 | imagePullPolicy: {{ .Values.image.pullPolicy }} 37 | command: 38 | - webhook 39 | args: 40 | - -bind-address={{ .Values.deployment.bindAddress }} 41 | - -port={{ .Values.deployment.portNumber }} 42 | - -tls-private-key-file=/etc/tls/tls.key 43 | - -tls-cert-file=/etc/tls/tls.crt 44 | - -logtostderr 45 | env: 46 | - name: NAMESPACE 47 | valueFrom: 48 | fieldRef: 49 | fieldPath: metadata.namespace 50 | securityContext: 51 | runAsUser: 10000 52 | runAsGroup: 10000 53 | capabilities: 54 | drop: 55 | - ALL 56 | add: ["NET_BIND_SERVICE"] 57 | readOnlyRootFilesystem: true 58 | allowPrivilegeEscalation: false 59 | volumeMounts: 60 | - mountPath: /etc/tls 61 | name: tls 62 | resources: 63 | requests: 64 | memory: "50Mi" 65 | cpu: "250m" 66 | limits: 67 | memory: "200Mi" 68 | cpu: "500m" 69 | {{- if .Values.manifests.thirdpartyCertificate }} 70 | volumes: 71 | - name: tls 72 | secret: 73 | secretName: {{ .Values.manifests.certificateSecretName }} 74 | {{ else }} 75 | initContainers: 76 | - name: installer 77 | image: {{ .Values.image.repository }}:{{ .Values.image.tag }} 78 | imagePullPolicy: {{ .Values.image.pullPolicy }} 79 | command: 80 | - installer 81 | args: 82 | - -name={{ .Chart.Name }} 83 | - -namespace=kube-system 84 | - -alsologtostderr 85 | env: 86 | - name: POD_NAME 87 | valueFrom: 88 | fieldRef: 89 | fieldPath: metadata.name 90 | securityContext: 91 | runAsUser: 10000 92 | runAsGroup: 10000 93 | volumeMounts: 94 | - name: tls 95 | mountPath: /etc/tls 96 | volumes: 97 | - name: tls 98 | emptyDir: {} 99 | {{- end }} 100 | -------------------------------------------------------------------------------- /network-resources-injector/templates/pdb.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: policy/v1 2 | kind: PodDisruptionBudget 3 | metadata: 4 | name: {{ .Values.pdb.name }} 5 | namespace: kube-system 6 | spec: 7 | minAvailable: {{ .Values.pdb.minAvailable }} 8 | selector: 9 | matchLabels: 10 | app: {{ .Chart.Name }} 11 | -------------------------------------------------------------------------------- /network-resources-injector/templates/service.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 K8s Network Plumbing Group 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http:#www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | --- 15 | apiVersion: v1 16 | kind: Service 17 | metadata: 18 | name: {{ .Values.service.name }} 19 | namespace: kube-system 20 | spec: 21 | ports: 22 | - port: {{ .Values.service.port }} 23 | targetPort: {{ .Values.service.targetPort }} 24 | selector: 25 | app: {{ .Chart.Name }} 26 | -------------------------------------------------------------------------------- /network-resources-injector/templates/webhook.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022 K8s Network Plumbing Group 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http:#www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | {{- if .Values.manifests.thirdpartyCertificate }} 15 | --- 16 | apiVersion: admissionregistration.k8s.io/v1 17 | kind: MutatingWebhookConfiguration 18 | metadata: 19 | name: {{ .Values.webhookconf.name }} 20 | namespace: kube-system 21 | webhooks: 22 | - name: {{ .Values.webhookconf.webhook.name }} 23 | sideEffects: None 24 | admissionReviewVersions: ["v1"] 25 | clientConfig: 26 | service: 27 | name: {{ .Values.service.name }} 28 | namespace: kube-sytem 29 | path: "/mutate" 30 | caBundle: {{ .Values.webhookconf.webhook.caBundle }} 31 | namespaceSelector: 32 | matchExpressions: 33 | - key: "kubernetes.io/metadata.name" 34 | operator: "NotIn" 35 | values: 36 | - "kube-system" 37 | rules: 38 | - operations: [ "CREATE" ] 39 | apiGroups: ["apps", ""] 40 | apiVersions: ["v1"] 41 | resources: ["pods"] 42 | {{- end }} 43 | -------------------------------------------------------------------------------- /network-resources-injector/values.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2022 K8s Network Plumbing Group 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | deployment: 16 | replicas: 2 17 | bindAddress: localhost 18 | portNumber: 8443 19 | 20 | serviceAccount: 21 | name: network-resources-injector-sa 22 | 23 | secret: 24 | name: network-resources-injector-sa-secret 25 | 26 | role: 27 | secretsName: network-resources-injector-secrets 28 | webhookconfigName: network-resources-injector-webhook-configs 29 | serviceName: network-resources-injector-service 30 | configmapsName: network-resources-injector-configmaps 31 | 32 | roleBinding: 33 | name: network-resources-injector-role-binding 34 | secretsName: network-resources-injector-secrets-role-binding 35 | webhookconfigName: network-resources-injector-webhook-configs-role-binding 36 | serviceName: network-resources-injector-service-role-binding 37 | configmapsName: network-resources-injector-configmaps-role-binding 38 | 39 | image: 40 | repository: network-resources-injector 41 | tag: latest 42 | pullPolicy: IfNotPresent 43 | 44 | service: 45 | name: network-resources-injector-service 46 | port: 443 47 | targetPort: 8443 48 | 49 | webhookconf: 50 | name: network-resources-injector-config 51 | webhook: 52 | name: network-resources-injector-config.k8s.io 53 | caBundle: # to be filled if manifests.thirdpartyCertificate is true 54 | 55 | pdb: 56 | name: network-resources-injector-pdb 57 | minAvailable: 1 58 | 59 | manifests: 60 | thirdpartyCertificate: false 61 | certificateSecretName: network-resources-injector-secret # will be used only when thirdpartyCertificate is true 62 | -------------------------------------------------------------------------------- /sriov/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *~ 18 | # Various IDEs 19 | .project 20 | .idea/ 21 | *.tmproj 22 | .vscode/ 23 | -------------------------------------------------------------------------------- /sriov/Chart.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2020 K8s Network Plumbing Group 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | apiVersion: v2 15 | name: sriov 16 | description: SR-IOV CNI Helm chart for Kubernetes 17 | type: application 18 | version: 0.1.1 19 | home: https://github.com/intel/sriov-network-device-plugin 20 | sources: 21 | - https://github.com/intel/sriov-network-device-plugin 22 | - https://github.com/intel/sriov-cni 23 | maintainers: 24 | - name: Network Plumbing Group 25 | appVersion: 0.1.0 26 | 27 | -------------------------------------------------------------------------------- /sriov/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | ====== 2 | {{- if or ( gt .Capabilities.KubeVersion.Major "1" ) ( ge .Capabilities.KubeVersion.Minor "16" ) }} 3 | 1. The following components have been deployed as part of this helm chart: 4 | {{- if .Values.manifests.serviceAccount }} 5 | Service Account: {{ .Values.serviceAccount.name }} 6 | {{- end }} 7 | {{- if .Values.manifests.configMap_sriov_device_plugin }} 8 | Config Map: {{ .Release.Name }}-{{ .Chart.Name }}-{{ .Chart.Version }}-config 9 | {{- end }} 10 | {{- if .Values.manifests.daemonSet_sriov_device_plugin }} 11 | Daemon Set: {{ .Release.Name }}-{{ .Chart.Name }}-device-plugin-ds 12 | {{- end }} 13 | {{- if .Values.manifests.daemonSet_sriov_cni }} 14 | Daemon Set: {{ .Release.Name }}-{{ .Chart.Name }}-cni-ds 15 | {{- end }} 16 | {{- if .Values.manifests.net_attach_def_netdev }} 17 | Network Attachment Definition for NetDevice: {{ .Values.config.netAttachDef.netdeviceName }} 18 | {{- end }} 19 | {{- if .Values.manifests.net_attach_def_dpdk }} 20 | Network Attachment Definition for DPDK: {{ .Values.config.netAttachDef.dpdkName }} 21 | {{- end }} 22 | {{- if .Values.manifests.test_netdevice }} 23 | Example pod with nedevice interface: {{ .Release.Name }}-test-netdevice 24 | {{- end }} 25 | {{- if .Values.manifests.test_dpdk }} 26 | Example pod with dpdk interface: {{ .Release.Name }}-test-dpdk 27 | {{- end }} 28 | 29 | You can now create more Network Attachment Definitions or test SRIOV pods using Network Attachment Defintions as mentioned above. 30 | --------- 31 | 32 | 2. To uninstall helm chart use the command: 33 | helm delete {{ .Release.Name }} 34 | --------- 35 | {{- else }} 36 | To run these charts, please use K8s ver >= v1.16 37 | {{- end }} 38 | -------------------------------------------------------------------------------- /sriov/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | # Copyright 2020 K8s Network Plumbing Group 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | {{/* Generate basic SRIOV CNI labels */}} 15 | {{- define "sriov-cni.labels" }} 16 | tier: node 17 | app: {{ .Chart.Name }}-cni 18 | {{- end }} 19 | 20 | {{/* Generate basic SRIOV Device Plugin labels */}} 21 | {{- define "sriov-dp.labels" }} 22 | tier: node 23 | app: {{ .Chart.Name }}-dp 24 | {{- end }} 25 | 26 | {{/* Generate SRIOV Device Plugin selector labels */}} 27 | {{- define "sriov-dp.serviceAccount.Name" }} 28 | name: {{ .Values.serviceAccount.name }} 29 | {{- end }} 30 | 31 | {{/* Generate SRIOV tolerations */}} 32 | {{- define "sriov.tolerations" }} 33 | - key: node-role.kubernetes.io/master 34 | operator: Exists 35 | effect: NoSchedule 36 | {{- if index .Values "tolerations" }} 37 | {{- if gt (len .Values.tolerations) 0 }} 38 | {{ toYaml .Values.tolerations }} 39 | {{- end }} 40 | {{- end }} 41 | {{- end }} 42 | -------------------------------------------------------------------------------- /sriov/templates/configMap_sriov_device_plugin.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2020 K8s Network Plumbing Group 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | {{- if or ( gt .Capabilities.KubeVersion.Major "1" ) ( ge .Capabilities.KubeVersion.Minor "16" ) }} 15 | {{- if .Values.manifests.configMap_sriov_device_plugin }} 16 | apiVersion: v1 17 | kind: ConfigMap 18 | metadata: 19 | name: {{ .Release.Name }}-{{ .Chart.Name }}-{{ .Chart.Version }}-config 20 | namespace: kube-system 21 | data: 22 | dp-conf.json: |- 23 | {{ toJson .Values.config.sriov_device_plugin | indent 4 }} 24 | {{- end }} 25 | {{- end }} 26 | -------------------------------------------------------------------------------- /sriov/templates/daemonSet_sriov_cni.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2020 K8s Network Plumbing Group 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | {{- if or ( gt .Capabilities.KubeVersion.Major "1" ) ( ge .Capabilities.KubeVersion.Minor "16" ) }} 15 | {{- if .Values.manifests.daemonSet_sriov_cni }} 16 | apiVersion: apps/v1 17 | kind: DaemonSet 18 | metadata: 19 | name: {{ .Release.Name }}-{{ .Chart.Name }}-cni-ds 20 | namespace: kube-system 21 | labels: 22 | {{- include "sriov-cni.labels" . | indent 4 }} 23 | spec: 24 | selector: 25 | matchLabels: 26 | {{- include "sriov-cni.labels" . | indent 6 }} 27 | updateStrategy: 28 | type: RollingUpdate 29 | rollingUpdate: 30 | maxUnavailable: 1 31 | template: 32 | metadata: 33 | labels: 34 | {{- include "sriov-cni.labels" . | indent 8 }} 35 | spec: 36 | hostNetwork: true 37 | nodeSelector: {{- toYaml .Values.labels.nodeSelector | nindent 8 }} 38 | tolerations: 39 | {{- include "sriov.tolerations" . | indent 6 }} 40 | serviceAccountName: {{ .Values.serviceAccount.name }} 41 | containers: 42 | - name: kube-{{ .Chart.Name }}-cni 43 | image: {{ .Values.images.sriovCni.repository }}:{{ .Values.images.sriovCni.tag }} 44 | imagePullPolicy: {{ .Values.images.pullPolicy }} 45 | securityContext: 46 | privileged: {{ .Values.securityContext.privileged }} 47 | {{- if .Values.pod.resources.enabled }} 48 | resources: {{- toYaml .Values.pod.resources.sriov_cni | nindent 10 }} 49 | {{- end }} 50 | volumeMounts: 51 | - name: cnibin 52 | mountPath: {{ .Values.config.scMountPaths.cnibin }} 53 | volumes: 54 | - name: cnibin 55 | hostPath: 56 | path: /opt/cni/bin 57 | {{- end }} 58 | {{- end }} 59 | -------------------------------------------------------------------------------- /sriov/templates/daemonSet_sriov_device_plugin.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2020 K8s Network Plumbing Group 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | {{- if or ( gt .Capabilities.KubeVersion.Major "1" ) ( ge .Capabilities.KubeVersion.Minor "16" ) }} 15 | {{- if .Values.manifests.daemonSet_sriov_device_plugin }} 16 | apiVersion: apps/v1 17 | kind: DaemonSet 18 | metadata: 19 | name: {{ .Release.Name }}-{{ .Chart.Name }}-device-plugin-ds 20 | namespace: kube-system 21 | labels: 22 | {{- include "sriov-dp.labels" . | indent 4 }} 23 | spec: 24 | selector: 25 | matchLabels: 26 | {{- include "sriov-dp.serviceAccount.Name" . | indent 6 }} 27 | {{- include "sriov-dp.labels" . | indent 6 }} 28 | updateStrategy: 29 | type: RollingUpdate 30 | rollingUpdate: 31 | maxUnavailable: 1 32 | template: 33 | metadata: 34 | labels: 35 | {{- include "sriov-dp.serviceAccount.Name" . | indent 8 }} 36 | {{- include "sriov-dp.labels" . | indent 8 }} 37 | annotations: 38 | checksum/config: {{ include (print $.Template.BasePath "/configMap_sriov_device_plugin.yaml") . | sha256sum }} 39 | spec: 40 | priorityClassName: system-node-critical 41 | hostNetwork: true 42 | nodeSelector: {{- toYaml .Values.labels.nodeSelector | nindent 8 }} 43 | tolerations: 44 | {{- include "sriov.tolerations" . | indent 6 }} 45 | serviceAccountName: {{ .Values.serviceAccount.name }} 46 | containers: 47 | - name: kube-{{ .Chart.Name }}-dp 48 | image: {{ .Values.images.sriovDevicePlugin.repository }}:{{ .Values.images.sriovDevicePlugin.tag }} 49 | imagePullPolicy: {{ .Values.images.pullPolicy }} 50 | args: 51 | - --log-dir=sriovdp 52 | - --log-level=10 53 | securityContext: 54 | privileged: {{ .Values.securityContext.privileged }} 55 | volumeMounts: 56 | - name: devicesock 57 | mountPath: {{ .Values.config.sdpMountPaths.deviceSock }} 58 | readOnly: false 59 | - name: log 60 | mountPath: {{ .Values.config.sdpMountPaths.log }} 61 | - name: config-volume 62 | mountPath: {{ .Values.config.sdpMountPaths.configVolume }} 63 | subPath: "dp-conf.json" 64 | volumes: 65 | - name: devicesock 66 | hostPath: 67 | path: {{ .Values.config.sdpMountPaths.deviceSock }} 68 | - name: log 69 | hostPath: 70 | path: {{ .Values.config.sdpMountPaths.log }} 71 | - name: config-volume 72 | configMap: 73 | name: {{ .Release.Name }}-{{ .Chart.Name }}-{{ .Chart.Version }}-config 74 | {{- end }} 75 | {{- end }} 76 | -------------------------------------------------------------------------------- /sriov/templates/net_attach_def_dpdk.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2020 K8s Network Plumbing Group 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | {{- if or ( gt .Capabilities.KubeVersion.Major "1" ) ( ge .Capabilities.KubeVersion.Minor "16" ) }} 15 | {{- if .Values.manifests.net_attach_def_dpdk }} 16 | apiVersion: "k8s.cni.cncf.io/v1" 17 | kind: NetworkAttachmentDefinition 18 | metadata: 19 | name: {{ .Values.config.netAttachDef.dpdkName }} 20 | annotations: 21 | k8s.v1.cni.cncf.io/resourceName: {{ .Values.config.netAttachDef.dpdkResourceName }} 22 | spec: 23 | config: |- 24 | {{ toJson .Values.config.netAttachDef.dpdk | indent 4 }} 25 | {{- end }} 26 | {{- end }} 27 | -------------------------------------------------------------------------------- /sriov/templates/net_attach_def_netdev.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2020 K8s Network Plumbing Group 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | {{- if or ( gt .Capabilities.KubeVersion.Major "1" ) ( ge .Capabilities.KubeVersion.Minor "16" ) }} 15 | {{- if .Values.manifests.net_attach_def_netdev }} 16 | apiVersion: "k8s.cni.cncf.io/v1" 17 | kind: NetworkAttachmentDefinition 18 | metadata: 19 | name: {{ .Values.config.netAttachDef.netdeviceName }} 20 | annotations: 21 | k8s.v1.cni.cncf.io/resourceName: {{ .Values.config.netAttachDef.netdeviceResourceName }} 22 | spec: 23 | config: |- 24 | {{ toJson .Values.config.netAttachDef.netdevice | indent 4 }} 25 | {{- end }} 26 | {{- end }} 27 | -------------------------------------------------------------------------------- /sriov/templates/serviceAccount.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2020 K8s Network Plumbing Group 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | {{- if or ( gt .Capabilities.KubeVersion.Major "1" ) ( ge .Capabilities.KubeVersion.Minor "16" ) }} 15 | {{- if .Values.manifests.serviceAccount }} 16 | apiVersion: v1 17 | kind: ServiceAccount 18 | metadata: 19 | {{- include "sriov-dp.serviceAccount.Name" . | indent 2 }} 20 | namespace: kube-system 21 | {{- end }} 22 | {{- end }} 23 | -------------------------------------------------------------------------------- /sriov/templates/tests/test-dpdk.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2020 K8s Network Plumbing Group 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | {{- if or ( gt .Capabilities.KubeVersion.Major "1" ) ( ge .Capabilities.KubeVersion.Minor "16" ) }} 15 | {{- if .Values.manifests.test_dpdk }} 16 | apiVersion: v1 17 | kind: Pod 18 | metadata: 19 | name: {{ .Release.Name }}-test-dpdk 20 | annotations: 21 | k8s.v1.cni.cncf.io/networks: {{ .Values.config.netAttachDef.dpdkName }} 22 | spec: 23 | containers: 24 | - name: appcntr1 25 | image: centos/tools 26 | imagePullPolicy: IfNotPresent 27 | command: [ "/bin/bash", "-c", "--" ] 28 | args: [ "while true; do sleep 300000; done;" ] 29 | resources: 30 | requests: 31 | {{ .Values.config.netAttachDef.dpdkResourceName }}: '1' 32 | limits: 33 | {{ .Values.config.netAttachDef.dpdkResourceName }}: '1' 34 | {{- end }} 35 | {{- end }} 36 | -------------------------------------------------------------------------------- /sriov/templates/tests/test-netdevice.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2020 K8s Network Plumbing Group 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | {{- if or ( gt .Capabilities.KubeVersion.Major "1" ) ( ge .Capabilities.KubeVersion.Minor "16" ) }} 15 | {{- if .Values.manifests.test_netdevice }} 16 | apiVersion: v1 17 | kind: Pod 18 | metadata: 19 | name: {{ .Release.Name }}-test-netdevice 20 | annotations: 21 | k8s.v1.cni.cncf.io/networks: {{ .Values.config.netAttachDef.netdeviceName }} 22 | spec: 23 | containers: 24 | - name: appcntr1 25 | image: centos/tools 26 | imagePullPolicy: IfNotPresent 27 | command: [ "/bin/bash", "-c", "--" ] 28 | args: [ "while true; do sleep 300000; done;" ] 29 | resources: 30 | requests: 31 | {{ .Values.config.netAttachDef.netdeviceResourceName }}: '1' 32 | limits: 33 | {{ .Values.config.netAttachDef.netdeviceResourceName }}: '1' 34 | {{- end }} 35 | {{- end }} 36 | -------------------------------------------------------------------------------- /sriov/values.yaml: -------------------------------------------------------------------------------- 1 | # Copyright 2020 K8s Network Plumbing Group 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Default values for sriov. 16 | # This is a YAML-formatted file. 17 | # Declare variables to be passed into your templates. 18 | 19 | #replicaCount: 1 20 | 21 | images: 22 | registry: docker.io 23 | sriovCni: 24 | repository: nfvpe/sriov-cni 25 | tag: v2.2 26 | sriovDevicePlugin: 27 | repository: nfvpe/sriov-device-plugin 28 | tag: v3.1 29 | pullPolicy: IfNotPresent 30 | 31 | #imagePullSecrets: [] 32 | #nameOverride: "" 33 | #fullnameOverride: "" 34 | 35 | serviceAccount: 36 | # Specifies whether a service account should be created 37 | #create: true 38 | # Annotations to add to the service account 39 | #annotations: {} 40 | # The name of the service account to use. 41 | # If not set and create is true, a name is generated using the fullname template 42 | name: sriov-device-plugin-test 43 | 44 | pod: 45 | resources: 46 | enabled: true 47 | sriov_cni: 48 | requests: 49 | memory: "50Mi" 50 | cpu: "100m" 51 | limits: 52 | memory: "50Mi" 53 | cpu: "100m" 54 | 55 | #podSecurityContext: {} 56 | # fsGroup: 2000 57 | 58 | securityContext: 59 | privileged: true 60 | # capabilities: 61 | # drop: 62 | # - ALL 63 | # readOnlyRootFilesystem: true 64 | # runAsNonRoot: true 65 | # runAsUser: 1000 66 | 67 | #service: 68 | #type: ClusterIP 69 | #port: 80 70 | 71 | #ingress: 72 | #enabled: false 73 | #annotations: {} 74 | # kubernetes.io/ingress.class: nginx 75 | # kubernetes.io/tls-acme: "true" 76 | #hosts: 77 | #- host: chart-example.local 78 | # paths: [] 79 | #tls: [] 80 | # - secretName: chart-example-tls 81 | # hosts: 82 | # - chart-example.local 83 | 84 | labels: 85 | nodeSelector: 86 | kubernetes.io/arch: amd64 87 | 88 | config: 89 | scMountPaths: 90 | cnibin: "/host/opt/cni/bin" 91 | sdpMountPaths: 92 | deviceSock: "/var/lib/kubelet/device-plugins/" 93 | log: "/var/log" 94 | configVolume: "/etc/pcidp/config.json" 95 | sriov_device_plugin: 96 | resourceList: 97 | - resourceName: intel_sriov_netdevice 98 | selectors: 99 | vendors: 100 | - '8086' 101 | devices: 102 | - 154c 103 | - 10ed 104 | drivers: 105 | - i40evf 106 | - ixgbevf 107 | - resourceName: intel_sriov_dpdk 108 | selectors: 109 | vendors: 110 | - '8086' 111 | devices: 112 | - 154c 113 | - 10ed 114 | drivers: 115 | - vfio-pci 116 | pfNames: 117 | - enp67s0f1#8-31 118 | - enp68s0f0#8-31 119 | - resourceName: mlnx_sriov_rdma 120 | isRdma: true 121 | selectors: 122 | vendors: 123 | - 15b3 124 | devices: 125 | - '1018' 126 | drivers: 127 | - mlx5_ib 128 | netAttachDef: 129 | dpdkName: 30-intel-sriov-dpdk 130 | dpdkResourceName: intel.com/intel_sriov_dpdk 131 | dpdk: 132 | type: sriov 133 | cniVersion: 0.3.1 134 | name: sriov-dpdk-network 135 | vlan: 1000 136 | spoofchk: "off" 137 | trust: "on" 138 | netdeviceName: 20-intel-sriov-netdevice 139 | netdeviceResourceName: intel.com/intel_sriov_netdevice 140 | netdevice: 141 | type: sriov 142 | cniVersion: 0.3.1 143 | name: sriov-network 144 | ipam: 145 | type: host-local 146 | subnet: 10.10.10.0/24 147 | rangeStart: 10.10.10.51 148 | rangeEnd: 10.10.10.100 149 | routes: 150 | - dst: 0.0.0.0/0 151 | gateway: 10.10.10.1 152 | 153 | manifests: 154 | serviceAccount: true 155 | configMap_sriov_device_plugin: true 156 | daemonSet_sriov_device_plugin: true 157 | daemonSet_sriov_cni: true 158 | net_attach_def_netdev: true 159 | net_attach_def_dpdk: true 160 | test_netdevice: true 161 | test_dpdk: true 162 | 163 | #tolerations: [] 164 | 165 | #affinity: {} 166 | -------------------------------------------------------------------------------- /whereabouts/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *.orig 18 | *~ 19 | # Various IDEs 20 | .project 21 | .idea/ 22 | *.tmproj 23 | .vscode/ 24 | -------------------------------------------------------------------------------- /whereabouts/Chart.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v2 2 | name: whereabouts 3 | description: A Helm chart for Kubernetes 4 | 5 | # A chart can be either an 'application' or a 'library' chart. 6 | # 7 | # Application charts are a collection of templates that can be packaged into versioned archives 8 | # to be deployed. 9 | # 10 | # Library charts provide useful utilities or functions for the chart developer. They're included as 11 | # a dependency of application charts to inject those utilities and functions into the rendering 12 | # pipeline. Library charts do not define any templates and therefore cannot be deployed. 13 | type: application 14 | 15 | # This is the chart version. This version number should be incremented each time you make changes 16 | # to the chart and its templates, including the app version. 17 | # Versions are expected to follow Semantic Versioning (https://semver.org/) 18 | version: 0.1.1 19 | 20 | # This is the version number of the application being deployed. This version number should be 21 | # incremented each time you make changes to the application. Versions are not expected to 22 | # follow Semantic Versioning. They should reflect the version the application is using. 23 | appVersion: 1.16.0 24 | -------------------------------------------------------------------------------- /whereabouts/crds/whereabouts.cni.cncf.io_ippools.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apiextensions.k8s.io/v1 2 | kind: CustomResourceDefinition 3 | metadata: 4 | annotations: 5 | controller-gen.kubebuilder.io/version: v0.4.1 6 | creationTimestamp: null 7 | name: ippools.whereabouts.cni.cncf.io 8 | spec: 9 | group: whereabouts.cni.cncf.io 10 | names: 11 | kind: IPPool 12 | listKind: IPPoolList 13 | plural: ippools 14 | singular: ippool 15 | scope: Namespaced 16 | versions: 17 | - name: v1alpha1 18 | schema: 19 | openAPIV3Schema: 20 | description: IPPool is the Schema for the ippools API 21 | properties: 22 | apiVersion: 23 | description: 'APIVersion defines the versioned schema of this representation 24 | of an object. Servers should convert recognized schemas to the latest 25 | internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' 26 | type: string 27 | kind: 28 | description: 'Kind is a string value representing the REST resource this 29 | object represents. Servers may infer this from the endpoint the client 30 | submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' 31 | type: string 32 | metadata: 33 | type: object 34 | spec: 35 | description: IPPoolSpec defines the desired state of IPPool 36 | properties: 37 | allocations: 38 | additionalProperties: 39 | description: IPAllocation represents metadata about the pod/container 40 | owner of a specific IP 41 | properties: 42 | id: 43 | type: string 44 | podref: 45 | type: string 46 | required: 47 | - id 48 | type: object 49 | description: Allocations is the set of allocated IPs for the given 50 | range. Its` indices are a direct mapping to the IP with the same 51 | index/offset for the pool's range. 52 | type: object 53 | range: 54 | description: Range is a RFC 4632/4291-style string that represents 55 | an IP address and prefix length in CIDR notation 56 | type: string 57 | required: 58 | - allocations 59 | - range 60 | type: object 61 | type: object 62 | served: true 63 | storage: true 64 | status: 65 | acceptedNames: 66 | kind: "" 67 | plural: "" 68 | conditions: [] 69 | storedVersions: [] 70 | -------------------------------------------------------------------------------- /whereabouts/crds/whereabouts.cni.cncf.io_overlappingrangeipreservations.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apiextensions.k8s.io/v1 2 | kind: CustomResourceDefinition 3 | metadata: 4 | annotations: 5 | controller-gen.kubebuilder.io/version: v0.4.1 6 | creationTimestamp: null 7 | name: overlappingrangeipreservations.whereabouts.cni.cncf.io 8 | spec: 9 | group: whereabouts.cni.cncf.io 10 | names: 11 | kind: OverlappingRangeIPReservation 12 | listKind: OverlappingRangeIPReservationList 13 | plural: overlappingrangeipreservations 14 | singular: overlappingrangeipreservation 15 | scope: Namespaced 16 | versions: 17 | - name: v1alpha1 18 | schema: 19 | openAPIV3Schema: 20 | description: OverlappingRangeIPReservation is the Schema for the OverlappingRangeIPReservations 21 | API 22 | properties: 23 | apiVersion: 24 | description: 'APIVersion defines the versioned schema of this representation 25 | of an object. Servers should convert recognized schemas to the latest 26 | internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' 27 | type: string 28 | kind: 29 | description: 'Kind is a string value representing the REST resource this 30 | object represents. Servers may infer this from the endpoint the client 31 | submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' 32 | type: string 33 | metadata: 34 | type: object 35 | spec: 36 | description: OverlappingRangeIPReservationSpec defines the desired state 37 | of OverlappingRangeIPReservation 38 | properties: 39 | containerid: 40 | type: string 41 | podref: 42 | type: string 43 | required: 44 | - containerid 45 | type: object 46 | required: 47 | - spec 48 | type: object 49 | served: true 50 | storage: true 51 | status: 52 | acceptedNames: 53 | kind: "" 54 | plural: "" 55 | conditions: [] 56 | storedVersions: [] 57 | -------------------------------------------------------------------------------- /whereabouts/templates/NOTES.txt: -------------------------------------------------------------------------------- 1 | Whereabouts is installed!! 2 | 3 | You can view the pods with the following command: 4 | 5 | kubectl get pods -n {{ .Release.Namespace }} -l app=whereabouts 6 | -------------------------------------------------------------------------------- /whereabouts/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* 2 | Expand the name of the chart. 3 | */}} 4 | {{- define "whereabouts.name" -}} 5 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} 6 | {{- end }} 7 | 8 | {{/* 9 | Create a default fully qualified app name. 10 | We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). 11 | If release name contains chart name it will be used as a full name. 12 | */}} 13 | {{- define "whereabouts.fullname" -}} 14 | {{- if .Values.fullnameOverride }} 15 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} 16 | {{- else }} 17 | {{- $name := default .Chart.Name .Values.nameOverride }} 18 | {{- if contains $name .Release.Name }} 19 | {{- .Release.Name | trunc 63 | trimSuffix "-" }} 20 | {{- else }} 21 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} 22 | {{- end }} 23 | {{- end }} 24 | {{- end }} 25 | 26 | {{/* 27 | Provide a method to override namespace so parent charts can set it 28 | */}} 29 | {{- define "whereabouts.namespace" -}} 30 | {{- if hasKey .Values "namespaceOverride" -}} 31 | namespace: {{ .Values.namespaceOverride }} 32 | {{- else }} 33 | namespace: {{ .Release.Namespace }} 34 | {{- end }} 35 | {{- end }} 36 | 37 | {{/* 38 | Create chart name and version as used by the chart label. 39 | */}} 40 | {{- define "whereabouts.chart" -}} 41 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} 42 | {{- end }} 43 | 44 | {{/* 45 | Common labels 46 | */}} 47 | {{- define "whereabouts.labels" -}} 48 | app: whereabouts 49 | helm.sh/chart: {{ include "whereabouts.chart" . }} 50 | {{ include "whereabouts.selectorLabels" . }} 51 | {{- if .Chart.AppVersion }} 52 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 53 | {{- end }} 54 | app.kubernetes.io/managed-by: {{ .Release.Service }} 55 | {{- end }} 56 | 57 | {{/* 58 | Selector labels 59 | */}} 60 | {{- define "whereabouts.selectorLabels" -}} 61 | app: {{ include "whereabouts.name" . }} 62 | app.kubernetes.io/name: {{ include "whereabouts.name" . }} 63 | app.kubernetes.io/instance: {{ .Release.Name }} 64 | {{- end }} 65 | 66 | {{/* 67 | Create the name of the service account to use 68 | */}} 69 | {{- define "whereabouts.serviceAccountName" -}} 70 | {{- if .Values.serviceAccount.create }} 71 | {{- default (include "whereabouts.fullname" .) .Values.serviceAccount.name }} 72 | {{- else }} 73 | {{- default "default" .Values.serviceAccount.name }} 74 | {{- end }} 75 | {{- end }} 76 | -------------------------------------------------------------------------------- /whereabouts/templates/cluster_role.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: rbac.authorization.k8s.io/v1 2 | kind: ClusterRole 3 | metadata: 4 | name: {{ include "whereabouts.serviceAccountName" . }} 5 | rules: 6 | - apiGroups: 7 | - whereabouts.cni.cncf.io 8 | resources: 9 | - ippools 10 | - overlappingrangeipreservations 11 | verbs: 12 | - get 13 | - list 14 | - watch 15 | - create 16 | - update 17 | - patch 18 | - delete 19 | - apiGroups: 20 | - coordination.k8s.io 21 | resources: 22 | - leases 23 | verbs: 24 | - '*' 25 | - apiGroups: [""] 26 | resources: 27 | - pods 28 | verbs: 29 | - list 30 | - watch 31 | - apiGroups: ["k8s.cni.cncf.io"] 32 | resources: 33 | - network-attachment-definitions 34 | verbs: 35 | - get 36 | - list 37 | - watch 38 | - apiGroups: 39 | - "" 40 | - events.k8s.io 41 | resources: 42 | - events 43 | verbs: 44 | - create 45 | - patch 46 | - update 47 | -------------------------------------------------------------------------------- /whereabouts/templates/cluster_role_binding.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.serviceAccount.create -}} 2 | --- 3 | kind: ClusterRoleBinding 4 | apiVersion: rbac.authorization.k8s.io/v1 5 | metadata: 6 | name: {{ include "whereabouts.serviceAccountName" . }} 7 | roleRef: 8 | apiGroup: rbac.authorization.k8s.io 9 | kind: ClusterRole 10 | name: {{ include "whereabouts.serviceAccountName" . }} 11 | subjects: 12 | - kind: ServiceAccount 13 | name: {{ include "whereabouts.serviceAccountName" . }} 14 | {{- include "whereabouts.namespace" . | nindent 2 }} 15 | {{- end }} 16 | -------------------------------------------------------------------------------- /whereabouts/templates/cronjob.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: batch/v1beta1 2 | kind: CronJob 3 | metadata: 4 | name: {{ include "whereabouts.fullname" . }} 5 | {{- include "whereabouts.namespace" . | nindent 2 }} 6 | labels: 7 | {{- include "whereabouts.labels" . | nindent 4 }} 8 | spec: 9 | concurrencyPolicy: Forbid 10 | successfulJobsHistoryLimit: {{ .Values.successfulJobsHistoryLimit | default "0" }} 11 | schedule: "*/5 * * * *" 12 | jobTemplate: 13 | spec: 14 | backoffLimit: 0 15 | template: 16 | metadata: 17 | labels: 18 | name: whereabouts 19 | {{- include "whereabouts.selectorLabels" . | nindent 12 }} 20 | spec: 21 | priorityClassName: "system-node-critical" 22 | serviceAccountName: {{ include "whereabouts.serviceAccountName" . }} 23 | {{- with .Values.imagePullSecrets }} 24 | imagePullSecrets: 25 | {{- toYaml . | nindent 12 }} 26 | {{- end }} 27 | containers: 28 | - name: {{ .Chart.Name }} 29 | securityContext: 30 | {{- toYaml .Values.securityContext | nindent 16 }} 31 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" 32 | imagePullPolicy: {{ .Values.image.pullPolicy }} 33 | resources: 34 | {{- toYaml .Values.resources | nindent 16 }} 35 | command: 36 | - /ip-reconciler 37 | - -log-level=verbose 38 | volumeMounts: 39 | - name: cni-net-dir 40 | mountPath: /host/etc/cni/net.d 41 | volumes: 42 | - name: cni-net-dir 43 | hostPath: 44 | path: /etc/cni/net.d 45 | restartPolicy: OnFailure 46 | {{- with .Values.nodeSelector }} 47 | nodeSelector: 48 | {{- toYaml . | nindent 12 }} 49 | {{- end }} 50 | {{- with .Values.affinity }} 51 | affinity: 52 | {{- toYaml . | nindent 12 }} 53 | {{- end }} 54 | {{- with .Values.tolerations }} 55 | tolerations: 56 | {{- toYaml . | nindent 12 }} 57 | {{- end }} 58 | -------------------------------------------------------------------------------- /whereabouts/templates/daemonset.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: DaemonSet 3 | metadata: 4 | name: {{ include "whereabouts.fullname" . }} 5 | {{- include "whereabouts.namespace" . | nindent 2 }} 6 | labels: 7 | {{- include "whereabouts.labels" . | nindent 4 }} 8 | spec: 9 | selector: 10 | matchLabels: 11 | name: whereabouts 12 | {{- include "whereabouts.selectorLabels" . | nindent 6 }} 13 | updateStrategy: 14 | type: {{ .Values.updateStrategy }} 15 | template: 16 | metadata: 17 | {{- with .Values.podAnnotations }} 18 | annotations: 19 | {{- toYaml . | nindent 8 }} 20 | {{- end }} 21 | labels: 22 | name: whereabouts 23 | {{- include "whereabouts.selectorLabels" . | nindent 8 }} 24 | spec: 25 | hostNetwork: true 26 | serviceAccountName: {{ include "whereabouts.serviceAccountName" . }} 27 | {{- with .Values.imagePullSecrets }} 28 | imagePullSecrets: 29 | {{- toYaml . | nindent 8 }} 30 | {{- end }} 31 | securityContext: 32 | {{- toYaml .Values.podSecurityContext | nindent 8 }} 33 | containers: 34 | - name: {{ .Chart.Name }} 35 | securityContext: 36 | {{- toYaml .Values.securityContext | nindent 12 }} 37 | image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" 38 | imagePullPolicy: {{ .Values.image.pullPolicy }} 39 | env: 40 | - name: WHEREABOUTS_NAMESPACE 41 | valueFrom: 42 | fieldRef: 43 | fieldPath: metadata.namespace 44 | resources: 45 | {{- toYaml .Values.resources | nindent 12 }} 46 | volumeMounts: 47 | - name: cnibin 48 | mountPath: /host/opt/cni/bin 49 | - name: cni-net-dir 50 | mountPath: /host/etc/cni/net.d 51 | volumes: 52 | - name: cnibin 53 | hostPath: 54 | path: /opt/cni/bin 55 | - name: cni-net-dir 56 | hostPath: 57 | path: /etc/cni/net.d 58 | {{- with .Values.nodeSelector }} 59 | nodeSelector: 60 | {{- toYaml . | nindent 8 }} 61 | {{- end }} 62 | {{- with .Values.affinity }} 63 | affinity: 64 | {{- toYaml . | nindent 8 }} 65 | {{- end }} 66 | {{- with .Values.tolerations }} 67 | tolerations: 68 | {{- toYaml . | nindent 8 }} 69 | {{- end }} 70 | -------------------------------------------------------------------------------- /whereabouts/templates/serviceaccount.yaml: -------------------------------------------------------------------------------- 1 | {{- if .Values.serviceAccount.create -}} 2 | apiVersion: v1 3 | kind: ServiceAccount 4 | metadata: 5 | name: {{ include "whereabouts.serviceAccountName" . }} 6 | {{- include "whereabouts.namespace" . | nindent 2 }} 7 | labels: 8 | {{- include "whereabouts.labels" . | nindent 4 }} 9 | {{- with .Values.serviceAccount.annotations }} 10 | annotations: 11 | {{- toYaml . | nindent 4 }} 12 | {{- end }} 13 | {{- end }} 14 | -------------------------------------------------------------------------------- /whereabouts/values.yaml: -------------------------------------------------------------------------------- 1 | # Default values for whereabouts. 2 | # This is a YAML-formatted file. 3 | # Declare variables to be passed into your templates. 4 | 5 | image: 6 | repository: ghcr.io/k8snetworkplumbingwg/whereabouts 7 | pullPolicy: IfNotPresent 8 | # Overrides the image tag whose default is the chart appVersion. 9 | tag: "latest" 10 | 11 | updateStrategy: RollingUpdate 12 | imagePullSecrets: [] 13 | nameOverride: "" 14 | fullnameOverride: "" 15 | namespaceOverride: "kube-system" 16 | successfulJobsHistoryLimit: 0 17 | 18 | serviceAccount: 19 | # Specifies whether a service account should be created 20 | create: true 21 | # Annotations to add to the service account 22 | annotations: {} 23 | # The name of the service account to use. 24 | # If not set and create is true, a name is generated using the fullname template 25 | #name: "" 26 | 27 | podAnnotations: {} 28 | 29 | podSecurityContext: {} 30 | # fsGroup: 2000 31 | 32 | securityContext: 33 | privileged: true 34 | 35 | resources: 36 | requests: 37 | cpu: "100m" 38 | memory: "50Mi" 39 | limits: 40 | cpu: "100m" 41 | memory: "50Mi" 42 | 43 | nodeSelector: 44 | kubernetes.io/os: linux 45 | 46 | tolerations: 47 | - operator: Exists 48 | effect: NoSchedule 49 | 50 | affinity: {} 51 | --------------------------------------------------------------------------------