252 lines
12 KiB
YAML
252 lines
12 KiB
YAML
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: {{ .Chart.Name }}-config-{{ .Release.Name }}
|
|
data:
|
|
config: |-
|
|
{{- $defaultInterfaceOptions := dict }}
|
|
{{- $defaultPrefixOptions := dict }}
|
|
{{- $defaultRouteOptions := dict }}
|
|
{{- $defaultRdnssOptions := dict }}
|
|
{{- $defaultDnsslOptions := dict }}
|
|
{{- $defaultAbroOptions := dict }}
|
|
{{- if $.Values.defaults }}
|
|
{{- range $name, $value := $.Values.defaults.interfaces }}
|
|
{{- $_ := set $defaultInterfaceOptions $name $value }}
|
|
{{- end }}
|
|
{{- range $name, $value := $.Values.defaults.prefixes }}
|
|
{{- $_ := set $defaultPrefixOptions $name $value }}
|
|
{{- end }}
|
|
{{- range $name, $value := $.Values.defaults.routes }}
|
|
{{- $_ := set $defaultRouteOptions $name $value }}
|
|
{{- end }}
|
|
{{- range $name, $value := $.Values.defaults.rdnss }}
|
|
{{- $_ := set $defaultRdnssOptions $name $value }}
|
|
{{- end }}
|
|
{{- range $name, $value := $.Values.defaults.dnssl }}
|
|
{{- $_ := set $defaultDnsslOptions $name $value }}
|
|
{{- end }}
|
|
{{- range $name, $value := $.Values.defaults.abro }}
|
|
{{- $_ := set $defaultAbroOptions $name $value }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- range $interface := .Values.interfaces }}
|
|
interface {{ $interface.name }} {
|
|
{{- $interfaceOptions := dict }}
|
|
{{- range $name, $value := $interface.options }}
|
|
{{- $_ := set $interfaceOptions $name $value }}
|
|
{{- end }}
|
|
{{- $_ := merge $interfaceOptions $defaultInterfaceOptions $interfaceOptions }}
|
|
{{- if hasKey $interfaceOptions "IgnoreIfMissing" }}
|
|
IgnoreIfMissing {{get $interfaceOptions "IgnoreIfMissing" | ternary "on" "off" }};
|
|
{{- end }}
|
|
{{- if hasKey $interfaceOptions "AdvSendAdvert" }}
|
|
AdvSendAdvert {{get $interfaceOptions "AdvSendAdvert" | ternary "on" "off" }};
|
|
{{- end }}
|
|
{{- if hasKey $interfaceOptions "UnicastOnly" }}
|
|
UnicastOnly {{get $interfaceOptions "UnicastOnly" | ternary "on" "off" }};
|
|
{{- end }}
|
|
{{- if hasKey $interfaceOptions "AdvRASolicitedUnicast" }}
|
|
AdvRASolicitedUnicast {{get $interfaceOptions "AdvRASolicitedUnicast" | ternary "on" "off" }};
|
|
{{- end }}
|
|
{{- if hasKey $interfaceOptions "MaxRtrAdvInterval" }}
|
|
MaxRtrAdvInterval {{get $interfaceOptions "MaxRtrAdvInterval" | float64 }}; # seconds
|
|
{{- end }}
|
|
{{- if hasKey $interfaceOptions "MinRtrAdvInterval" }}
|
|
MinRtrAdvInterval {{get $interfaceOptions "MinRtrAdvInterval" | float64 }}; # seconds
|
|
{{- end }}
|
|
{{- if hasKey $interfaceOptions "MinDelayBetweenRAs" }}
|
|
MinDelayBetweenRAs {{get $interfaceOptions "MinDelayBetweenRAs" | float64 }}; # seconds
|
|
{{- end }}
|
|
{{- if hasKey $interfaceOptions "AdvManagedFlag" }}
|
|
AdvManagedFlag {{get $interfaceOptions "AdvManagedFlag" | ternary "on" "off" }};
|
|
{{- end }}
|
|
{{- if hasKey $interfaceOptions "AdvOtherConfigFlag" }}
|
|
AdvOtherConfigFlag {{get $interfaceOptions "AdvOtherConfigFlag" | ternary "on" "off" }};
|
|
{{- end }}
|
|
{{- if hasKey $interfaceOptions "AdvLinkMTU" }}
|
|
AdvLinkMTU {{get $interfaceOptions "AdvLinkMTU" | int}}; # integer
|
|
{{- end }}
|
|
{{- if hasKey $interfaceOptions "AdvReachableTime" }}
|
|
AdvReachableTime {{get $interfaceOptions "AdvReachableTime" | int }}; # milliseconds
|
|
{{- end }}
|
|
{{- if hasKey $interfaceOptions "AdvRetransTimer" }}
|
|
AdvRetransTimer {{get $interfaceOptions "AdvRetransTimer" | int }}; # milliseconds
|
|
{{- end }}
|
|
{{- if hasKey $interfaceOptions "AdvCurHopLimit" }}
|
|
AdvCurHopLimit {{get $interfaceOptions "AdvCurHopLimit" | int }}; # integer
|
|
{{- end }}
|
|
{{- if hasKey $interfaceOptions "AdvDefaultLifetime" }}
|
|
AdvDefaultLifetime {{get $interfaceOptions "AdvDefaultLifetime" | int }}; # seconds
|
|
{{- end }}
|
|
{{- if hasKey $interfaceOptions "AdvDefaultPreference" }}
|
|
AdvDefaultPreference {{get $interfaceOptions "AdvDefaultPreference" }}; # low|medium|high
|
|
{{- end }}
|
|
{{- if hasKey $interfaceOptions "AdvSourceLLAddress" }}
|
|
AdvSourceLLAddress {{get $interfaceOptions "AdvSourceLLAddress" | ternary "on" "off" }};
|
|
{{- end }}
|
|
{{- if hasKey $interfaceOptions "AdvHomeAgentFlag" }}
|
|
AdvHomeAgentFlag {{get $interfaceOptions "AdvHomeAgentFlag" | ternary "on" "off" }};
|
|
{{- end }}
|
|
{{- if hasKey $interfaceOptions "AdvHomeAgentInfo" }}
|
|
AdvHomeAgentInfo {{get $interfaceOptions "AdvHomeAgentInfo" | ternary "on" "off" }};
|
|
{{- end }}
|
|
{{- if hasKey $interfaceOptions "HomeAgentLifetime" }}
|
|
HomeAgentLifetime {{get $interfaceOptions "HomeAgentLifetime" | int}}; # seconds
|
|
{{- end }}
|
|
{{- if hasKey $interfaceOptions "HomeAgentPreference" }}
|
|
HomeAgentPreference {{get $interfaceOptions "HomeAgentPreference" | int}}; # integer
|
|
{{- end }}
|
|
{{- if hasKey $interfaceOptions "AdvMobRtrSupportFlag" }}
|
|
AdvMobRtrSupportFlag {{get $interfaceOptions "AdvMobRtrSupportFlag" | ternary "on" "off" }};
|
|
{{- end }}
|
|
{{- if hasKey $interfaceOptions "AdvIntervalOpt" }}
|
|
AdvIntervalOpt {{get $interfaceOptions "AdvIntervalOpt" | ternary "on" "off" }};
|
|
{{- end }}
|
|
|
|
{{- range $prefix := $interface.prefixes }}
|
|
prefix {{ $prefix.prefix }} {
|
|
{{- $prefixOptions := dict }}
|
|
{{- range $name, $value := $prefix.options }}
|
|
{{- $_ := set $prefixOptions $name $value }}
|
|
{{- end }}
|
|
{{- $_ := merge $prefixOptions $defaultPrefixOptions $prefixOptions }}
|
|
{{- if hasKey $prefixOptions "AdvOnLink" }}
|
|
AdvOnLink {{get $prefixOptions "AdvOnLink" | ternary "on" "off" }};
|
|
{{- end }}
|
|
{{- if hasKey $prefixOptions "AdvAutonomous" }}
|
|
AdvAutonomous {{get $prefixOptions "AdvAutonomous" | ternary "on" "off" }};
|
|
{{- end }}
|
|
{{- if hasKey $prefixOptions "AdvRouterAddr" }}
|
|
AdvRouterAddr {{get $prefixOptions "AdvRouterAddr" | ternary "on" "off" }};
|
|
{{- end }}
|
|
{{- if hasKey $prefixOptions "AdvValidLifetime" }}
|
|
{{- if kindIs "string" (get $prefixOptions "AdvValidLifetime") }}
|
|
AdvValidLifetime {{get $prefixOptions "AdvValidLifetime" }}; # seconds|infinity
|
|
{{- else }}
|
|
AdvValidLifetime {{get $prefixOptions "AdvValidLifetime" | int}}; # seconds|infinity
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if hasKey $prefixOptions "AdvPreferredLifetime" }}
|
|
{{- if kindIs "string" (get $prefixOptions "AdvValidLifetime") }}
|
|
AdvPreferredLifetime {{get $prefixOptions "AdvPreferredLifetime" }}; # seconds|infinity
|
|
{{- else }}
|
|
AdvPreferredLifetime {{get $prefixOptions "AdvPreferredLifetime" | int}}; # seconds|infinity
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if hasKey $prefixOptions "DeprecatePrefix" }}
|
|
DeprecatePrefix {{get $prefixOptions "DeprecatePrefix" | ternary "on" "off" }};
|
|
{{- end }}
|
|
{{- if hasKey $prefixOptions "DecrementLifetimes" }}
|
|
DecrementLifetimes {{get $prefixOptions "DecrementLifetimes" | ternary "on" "off" }};
|
|
{{- end }}
|
|
{{- if hasKey $prefixOptions "Base6Interface" }}
|
|
Base6Interface {{get $prefixOptions "Base6Interface" }}; # name
|
|
{{- end }}
|
|
{{- if hasKey $prefixOptions "Base6to4Interface" }}
|
|
Base6to4Interface {{get $prefixOptions "Base6to4Interface" }}; # name
|
|
{{- end }}
|
|
};
|
|
{{- end }}
|
|
|
|
{{- range $route := $interface.routes }}
|
|
route {{ $route.route }} {
|
|
{{- $routeOptions := dict }}
|
|
{{- range $name, $value := $route.options }}
|
|
{{- $_ := set $routeOptions $name $value }}
|
|
{{- end }}
|
|
{{- $_ := merge $routeOptions $defaultRouteOptions $routeOptions }}
|
|
{{- if hasKey $routeOptions "AdvRouteLifetime" }}
|
|
{{- if kindIs "string" (get $routeOptions "AdvRouteLifetime") }}
|
|
AdvRouteLifetime {{get $routeOptions "AdvRouteLifetime" }}; # seconds|infinity
|
|
{{- else }}
|
|
AdvRouteLifetime {{get $routeOptions "AdvRouteLifetime" | int}}; # seconds|infinity
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if hasKey $routeOptions "AdvRoutePreference" }}
|
|
AdvRoutePreference {{get $routeOptions "AdvRoutePreference" }}; # low|medium|high
|
|
{{- end }}
|
|
{{- if hasKey $routeOptions "RemoveRoute" }}
|
|
RemoveRoute {{get $routeOptions "RemoveRoute" | ternary "on" "off" }};
|
|
{{- end }}
|
|
};
|
|
{{- end }}
|
|
|
|
{{- range $rdnss := $interface.rdnss }}
|
|
RDNSS {{ join " " $rdnss.addresses }} {
|
|
{{- $rdnssOptions := dict }}
|
|
{{- range $name, $value := $rdnss.options }}
|
|
{{- $_ := set $rdnssOptions $name $value }}
|
|
{{- end }}
|
|
{{- $_ := merge $rdnssOptions $defaultRdnssOptions $rdnssOptions }}
|
|
{{- if hasKey $rdnssOptions "AdvRDNSSLifetime" }}
|
|
{{- if kindIs "string" (get $rdnssOptions "AdvRDNSSLifetime") }}
|
|
AdvRDNSSLifetime {{get $rdnssOptions "AdvRDNSSLifetime" }}; # seconds|infinity
|
|
{{- else }}
|
|
AdvRDNSSLifetime {{get $rdnssOptions "AdvRDNSSLifetime" | int }}; # seconds|infinity
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if hasKey $rdnssOptions "FlushRDNSS" }}
|
|
FlushRDNSS {{get $rdnssOptions "FlushRDNSS" | ternary "on" "off" }};
|
|
{{- end }}
|
|
};
|
|
{{- end }}
|
|
|
|
{{- range $dnssl := .dnssl }}
|
|
DNSSL {{ join " " $dnssl.suffixes }} {
|
|
{{- $dnsslOptions := dict }}
|
|
{{- range $name, $value := $dnssl.options }}
|
|
{{- $_ := set $dnsslOptions $name $value }}
|
|
{{- end }}
|
|
{{- $_ := merge $dnsslOptions $defaultDnsslOptions $dnsslOptions }}
|
|
{{- if hasKey $dnsslOptions "AdvDNSSLLifetime" }}
|
|
{{ $val := get $dnsslOptions "AdvDNSSLifetime" }}
|
|
{{- if kindIs "string" $val }}
|
|
AdvDNSSLLifetime {{ $val }}; # seconds|infinity;
|
|
{{- else }}
|
|
AdvDNSSLLifetime {{ $val | int }}; # seconds|infinity;
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- if hasKey $dnsslOptions "FlushDNSSL" }}
|
|
FlushDNSSL {{get $dnsslOptions "FlushDNSSL" | ternary "on" "off" }};
|
|
{{- end }}
|
|
};
|
|
{{- end }}
|
|
|
|
{{- range $abro := .abro }}
|
|
{{- $abroOptions := dict }}
|
|
{{- range $name, $value := $abro.options }}
|
|
{{- $_ := set $abroOptions $name $value }}
|
|
{{- end }}
|
|
{{- $_ := merge $abroOptions $defaultAbroOptions $abroOptions }}
|
|
abro {{ $abro.address }} {
|
|
{{- if hasKey $abroOptions "AdvValidLifeTime" }}
|
|
AdvValidLifeTime {{get $abroOptions "AdvValidLifeTime" | int }}; # seconds
|
|
{{- end }}
|
|
{{- if hasKey $abroOptions "AdvVersionLow" }}
|
|
AdvVersionLow {{get $abroOptions "AdvVersionLow" | int }}; # unsignedinteger
|
|
{{- end }}
|
|
{{- if hasKey $abroOptions "AdvVersionHigh" }}
|
|
AdvVersionHigh {{get $abroOptions "AdvVersionHigh" | int }}; # unsignedinteger
|
|
{{- end }}
|
|
};
|
|
{{- end }}
|
|
|
|
{{- if $interface.clients }}
|
|
clients {
|
|
{{- range $client := $interface.clients }}
|
|
{{- $client }};
|
|
{{- end }}
|
|
};
|
|
{{- end }}
|
|
|
|
{{- if $interface.AdvRASrcAddresses }}
|
|
AdvRASrcAddress {
|
|
{{- range $address := $interface.AdvRASrcAddresses }}
|
|
{{- $address }};
|
|
{{- end }}
|
|
};
|
|
{{- end }}
|
|
};
|
|
{{- end }}
|