enable calico mesh if no peers in input
[yaml_builds.git] / templates / software / charts / kubernetes / container-networking / calico.j2
1 ##############################################################################
2 # Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.        #
3 #                                                                            #
4 # Licensed under the Apache License, Version 2.0 (the "License"); you may    #
5 # not use this file except in compliance with the License.                   #
6 #                                                                            #
7 # You may obtain a copy of the License at                                    #
8 #       http://www.apache.org/licenses/LICENSE-2.0                           #
9 #                                                                            #
10 # Unless required by applicable law or agreed to in writing, software        #
11 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT  #
12 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.           #
13 # See the License for the specific language governing permissions and        #
14 # limitations under the License.                                             #
15 ##############################################################################
16
17 schema: armada/Chart/v1
18 metadata:
19   schema: metadata/Document/v1
20   replacement: true
21   name: kubernetes-calico
22   layeringDefinition:
23     abstract: false
24     layer: site
25     parentSelector:
26       name: kubernetes-calico-global
27     actions:
28       - method: merge
29         path: .
30   storagePolicy: cleartext
31 data:
32   values:
33     networking:
34       settings:
35 {% if ('peers' in yaml.networks.ksn and yaml.networks.ksn.peers is not none and yaml.networks.ksn.peers is iterable ) %}
36         mesh: "off"
37 {% else %}
38         mesh: "on"
39 {% endif %}
40         ippool:
41           ipip:
42             enabled: "false"
43             mode: "cross-subnet"
44       bgp:
45         asnumber: {{yaml.networks.ksn.local_asnumber}}
46         ipv4:
47           additional_cidrs:
48 {% for add_cidr in yaml.networks.ksn.additional_cidrs %}
49             - {{add_cidr}}
50 {% endfor %}
51 {% if ('peers' in yaml.networks.ksn and yaml.networks.ksn.peers is not none and yaml.networks.ksn.peers is iterable ) %}
52           peers:
53 {% for peer in yaml.networks.ksn.peers %}
54             - apiVersion: v1
55               kind: bgpPeer
56               metadata:
57                 peerIP: {{peer.ip}}
58                 scope: {{peer.scope}}
59               spec:
60                 asnumber: {{peer.asnumber}}
61 {% endfor %}
62 {% endif %}
63 ...
64