From 4a6b6037c0ed316062534bb5050abf4ad32bb62b Mon Sep 17 00:00:00 2001 From: Alexander Mattoni <5110855+mattoni@users.noreply.github.com> Date: Tue, 23 Jun 2026 17:10:12 +0000 Subject: [PATCH 1/2] add additional fields to network route config - add to stack spec --- .../containers/config/ContainerNetwork.yml | 2 +- .../config/network/NetworkRoute.yml | 18 ------- .../config/network/NetworkRouteConfig.yml | 44 ++++++++++++++++ .../network/NetworkRouteConfigNextHop.yml | 17 +++++++ .../StackSpecContainerConfigNetwork.yml | 50 +++++++++++++++++++ 5 files changed, 112 insertions(+), 19 deletions(-) delete mode 100644 components/schemas/containers/config/network/NetworkRoute.yml create mode 100644 components/schemas/containers/config/network/NetworkRouteConfig.yml create mode 100644 components/schemas/containers/config/network/NetworkRouteConfigNextHop.yml diff --git a/components/schemas/containers/config/ContainerNetwork.yml b/components/schemas/containers/config/ContainerNetwork.yml index 51b85429..f40bdc31 100644 --- a/components/schemas/containers/config/ContainerNetwork.yml +++ b/components/schemas/containers/config/ContainerNetwork.yml @@ -24,7 +24,7 @@ properties: - "null" description: Custom network routes applied to the container's instances. items: - $ref: ./network/NetworkRoute.yml + $ref: ./network/NetworkRouteConfig.yml hostname: type: string description: The hostname for the given container. diff --git a/components/schemas/containers/config/network/NetworkRoute.yml b/components/schemas/containers/config/network/NetworkRoute.yml deleted file mode 100644 index 38d3ebcd..00000000 --- a/components/schemas/containers/config/network/NetworkRoute.yml +++ /dev/null @@ -1,18 +0,0 @@ -title: NetworkRoute -type: object -description: A single network route directing traffic for a destination network. -required: - - destination - - gateway -properties: - destination: - description: The destination network, in CIDR notation, that this route matches. - oneOf: - - $ref: ../../../Cidr.yml - - type: "null" - gateway: - description: The IP address that traffic matching the destination is forwarded to. - $ref: ../../../IpAddress.yml - interface: - type: string - description: The name of the network interface this route is bound to. diff --git a/components/schemas/containers/config/network/NetworkRouteConfig.yml b/components/schemas/containers/config/network/NetworkRouteConfig.yml new file mode 100644 index 00000000..af41916f --- /dev/null +++ b/components/schemas/containers/config/network/NetworkRouteConfig.yml @@ -0,0 +1,44 @@ +title: NetworkRouteConfig +type: object +description: A single network route directing traffic for a destination network. +required: + - destination + - source + - ensure_source_exists + - gateway +properties: + destination: + description: The destination network, in CIDR notation, that this route matches. + oneOf: + - $ref: ../../../Cidr.yml + - type: "null" + source: + description: >- + The source network, in CIDR notation, that this route applies to. + oneOf: + - $ref: ../../../Cidr.yml + - type: "null" + ensure_source_exists: + type: boolean + description: >- + When true, the source address is verified to exist on the host before + this route is applied. + family: + description: The IP protocol family this route applies to. + oneOf: + - type: string + enum: + - ipv4 + - ipv6 + - type: "null" + gateway: + description: The IP address that traffic matching the destination is forwarded to. + $ref: ../../../IpAddress.yml + nexthops: + type: array + description: Additional next hops for this route, used for multipath (ECMP) routing. + items: + $ref: ./NetworkRouteNexthop.yml + interface: + type: string + description: The name of the network interface this route is bound to. diff --git a/components/schemas/containers/config/network/NetworkRouteConfigNextHop.yml b/components/schemas/containers/config/network/NetworkRouteConfigNextHop.yml new file mode 100644 index 00000000..94b80890 --- /dev/null +++ b/components/schemas/containers/config/network/NetworkRouteConfigNextHop.yml @@ -0,0 +1,17 @@ +title: NetworkRouteConfigNexthop +type: object +description: A single next hop for a multipath network route. +required: + - gateway +properties: + gateway: + description: The IP address of this next hop's gateway. + $ref: ../../../IpAddress.yml + hop_weight: + description: >- + The relative weight of this next hop when distributing traffic across + multiple next hops. + oneOf: + - type: integer + format: int64 + - type: "null" diff --git a/stackspec/schema/StackSpecContainerConfigNetwork.yml b/stackspec/schema/StackSpecContainerConfigNetwork.yml index 271ff39c..2300505b 100644 --- a/stackspec/schema/StackSpecContainerConfigNetwork.yml +++ b/stackspec/schema/StackSpecContainerConfigNetwork.yml @@ -38,11 +38,61 @@ properties: - $ref: ../../components/schemas/Cidr.yml - type: "null" - $ref: StackVariable.yml + source: + description: >- + The source network, in CIDR notation, that this route applies to. + Used for source-based (policy) routing. + oneOf: + - $ref: ../../components/schemas/Cidr.yml + - type: "null" + - $ref: StackVariable.yml + ensure_source_exists: + description: >- + When true, the source address is verified to exist on the host + before this route is applied. + oneOf: + - type: boolean + - $ref: StackVariable.yml + family: + description: The IP protocol family this route applies to. + oneOf: + - type: string + enum: + - ipv4 + - ipv6 + - type: "null" + - $ref: StackVariable.yml gateway: description: The IP address that traffic matching the destination is forwarded to. oneOf: - $ref: ../../components/schemas/IpAddress.yml - $ref: StackVariable.yml + nexthops: + description: Additional next hops for this route, used for multipath routing. + oneOf: + - type: array + items: + title: NetworkRouteNexthop + type: object + description: A single next hop for a multipath network route. + required: + - gateway + properties: + gateway: + description: The IP address of this next hop's gateway. + oneOf: + - $ref: ../../components/schemas/IpAddress.yml + - $ref: StackVariable.yml + hop_weight: + description: >- + The relative weight of this next hop when distributing + traffic across multiple next hops. + oneOf: + - type: integer + format: int64 + - type: "null" + - $ref: StackVariable.yml + - $ref: StackVariable.yml interface: description: The name of the network interface this route is bound to. oneOf: From a5f2fa66b8a147369bf27317ab765bdddc52492c Mon Sep 17 00:00:00 2001 From: Alexander Mattoni <5110855+mattoni@users.noreply.github.com> Date: Tue, 23 Jun 2026 17:11:35 +0000 Subject: [PATCH 2/2] fix route --- .../schemas/containers/config/network/NetworkRouteConfig.yml | 2 +- ...workRouteConfigNextHop.yml => NetworkRouteConfigNexthop.yml} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename components/schemas/containers/config/network/{NetworkRouteConfigNextHop.yml => NetworkRouteConfigNexthop.yml} (100%) diff --git a/components/schemas/containers/config/network/NetworkRouteConfig.yml b/components/schemas/containers/config/network/NetworkRouteConfig.yml index af41916f..680b08d4 100644 --- a/components/schemas/containers/config/network/NetworkRouteConfig.yml +++ b/components/schemas/containers/config/network/NetworkRouteConfig.yml @@ -38,7 +38,7 @@ properties: type: array description: Additional next hops for this route, used for multipath (ECMP) routing. items: - $ref: ./NetworkRouteNexthop.yml + $ref: ./NetworkRouteConfigNexthop.yml interface: type: string description: The name of the network interface this route is bound to. diff --git a/components/schemas/containers/config/network/NetworkRouteConfigNextHop.yml b/components/schemas/containers/config/network/NetworkRouteConfigNexthop.yml similarity index 100% rename from components/schemas/containers/config/network/NetworkRouteConfigNextHop.yml rename to components/schemas/containers/config/network/NetworkRouteConfigNexthop.yml