Ratnopam Chakrabarti 6c919164b2 Create network policy for subcluster
Added sample calico v3 global network policy and hostendpoint for controlling
traffic flow between sub-clusters.

Also, adds Calico hostendpoints with labels for oam, ksn and vm-infra-bridge.

Relates-To: #131
Closes: #131

Change-Id: I1bb0b1e450b9f78fe1ee77abb0ff12eea72873a5
2021-05-28 14:46:35 +00:00

42 lines
1.2 KiB
YAML

# These rules inject host information from the `host-generation-catalogue`
# into the hostendpoint-generator function's Template plugin config.
apiVersion: airshipit.org/v1alpha1
kind: ReplacementTransformer
metadata:
name: host-endpoints
annotations:
config.kubernetes.io/function: |-
container:
image: quay.io/airshipit/replacement-transformer:v2
replacements:
- source:
objref:
kind: VariableCatalogue
name: host-generation-catalogue
fieldref: "{.hosts.m3}"
target:
objref:
kind: Templater
name: host-endpoint-worker-template
fieldrefs: ["{.values.hep}"]
- source:
objref:
kind: NetworkCatalogue
name: networking
fieldref: "{.spec.commonHostNetworking.networks[?(.id == 'oam-ipv4')].link}"
target:
objref:
kind: Templater
name: host-endpoint-worker-template
fieldrefs: ["{.values.interfaces[?(.name == 'oam')].link}"]
- source:
objref:
kind: NetworkCatalogue
name: networking
fieldref: "{.spec.commonHostNetworking.networks[?(.id == 'calico-ipv4')].link}"
target:
objref:
kind: Templater
name: host-endpoint-worker-template
fieldrefs: ["{.values.interfaces[?(.name == 'ksn')].link}"]