blob: 0cecc3a80b3446e524170366a9f5019af9e0c72d [file] [log] [blame]
Wei-Yu Chen0f12b9c2019-04-18 11:12:59 -07001---
2# Copyright 2018-present Open Networking Foundation
3# Copyright 2018 Intel Corporation
4#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
Hyunsun Moona24d3f92019-06-19 03:04:58 -050017{{- range .Values.network.networks }}
Wei-Yu Chen0f12b9c2019-04-18 11:12:59 -070018---
19apiVersion: "k8s.cni.cncf.io/v1"
20kind: NetworkAttachmentDefinition
21metadata:
22 name: {{ .name }}
Hyunsun Moona24d3f92019-06-19 03:04:58 -050023{{- if $.Values.network.sriov.enabled }}
Wei-Yu Chen0f12b9c2019-04-18 11:12:59 -070024 annotations:
25 k8s.v1.cni.cncf.io/resourceName: intel.com/sriov
Hyunsun Moona24d3f92019-06-19 03:04:58 -050026{{- end }}
Wei-Yu Chen0f12b9c2019-04-18 11:12:59 -070027spec:
28 config: '{
Hyunsun Moona24d3f92019-06-19 03:04:58 -050029 "type": {{ .type | quote }},
Wei-Yu Chen0f12b9c2019-04-18 11:12:59 -070030 "ipam": {
Hyunsun Moona24d3f92019-06-19 03:04:58 -050031 "type": {{ .ipam | quote }},
32 {{- if eq .ipam "host-local" }}
Wei-Yu Chen0f12b9c2019-04-18 11:12:59 -070033 "subnet": {{ .subnet | quote }},
34 "gateway": {{ .gateway | quote }}
Hyunsun Moona24d3f92019-06-19 03:04:58 -050035 {{- else if eq .ipam "centralip" }}
Wei-Yu Chen0f12b9c2019-04-18 11:12:59 -070036 "ipType": "cluster",
37 "network": {{ .subnet | quote }},
38 "etcdURL": {{ $.Values.global.etcdurl | quote }}
39 {{- end }}
40 }
Hyunsun Moona24d3f92019-06-19 03:04:58 -050041 }'
Wei-Yu Chen0f12b9c2019-04-18 11:12:59 -070042{{- end }}