treasuremap/manifests/function/hostendpoint-generator/host-endpoint-template.yaml
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

35 lines
765 B
YAML

apiVersion: airshipit.org/v1alpha1
kind: Templater
metadata:
name: host-endpoint-worker-template
annotations:
config.kubernetes.io/function: |
container:
image: quay.io/airshipit/templater:v2
values:
hep:
interfaces:
- name: vib
link: vm-infra-bridge
- name: oam
link: bond0.61
- name: ksn
link: bond0.64
template: |
{{ range $host:= .hep }}
{{- $hostname := $host.name }}
{{ range $interface := $.interfaces }}
---
apiVersion: projectcalico.org/v3
kind: HostEndpoint
metadata:
name: {{ $hostname }}-{{ $interface.name }}
labels:
host: {{ $host.type }}
intf-alias: {{ $interface.name }}
spec:
interfaceName: {{ $interface.link }}
node: {{ $hostname }}
{{ end }}
{{ end }}