Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions charts/grid-operator/crds/gridnetwork.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,24 @@ spec:
items:
type: string
type: array
selectionPolicy:
description: |-
Local request distribution policy for the active selection group.

This is independent of scoring. When absent, the overlay carries no
selection override and Praxis uses deterministic selection.
nullable: true
properties:
mode:
description: Local selection mode used by the data-plane gateway.
enum:
- deterministic
- roundRobin
- random
type: string
required:
- mode
type: object
staleCandidateTtlSeconds:
description: |-
Maximum age in seconds before a stale (`fresh=false`) remote routing
Expand Down
17 changes: 17 additions & 0 deletions charts/grid-site/templates/gridnetwork.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
{{- if .Values.gridNetwork.name }}
{{- $existing := lookup "grid.praxis-proxy.io/v1alpha1" "GridNetwork" .Release.Namespace .Values.gridNetwork.name }}
{{- $configuredSelectionPolicy := .Values.gridNetwork.selectionPolicy }}
{{- $existingSelectionPolicy := dig "spec" "selectionPolicy" nil $existing }}
{{- $selectionPolicy := $configuredSelectionPolicy }}
{{- if not $selectionPolicy }}
{{- if $existingSelectionPolicy }}
{{- $selectionPolicy = $existingSelectionPolicy }}
{{- else if not $existing }}
{{- $selectionPolicy = dict "mode" "roundRobin" }}
Comment thread
nerdalert marked this conversation as resolved.
{{- end }}
{{- end }}
apiVersion: grid.praxis-proxy.io/v1alpha1
kind: GridNetwork
metadata:
Expand Down Expand Up @@ -33,6 +44,12 @@ spec:
admissionPolicy:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with $selectionPolicy }}
{{- if .mode }}
selectionPolicy:
mode: {{ .mode | quote }}
{{- end }}
{{- end }}
{{- with .Values.gridNetwork.metricsRefreshInterval }}
{{- if . }}
metricsRefreshInterval: {{ . | quote }}
Expand Down
9 changes: 9 additions & 0 deletions charts/grid-site/tests/gridnetwork_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,15 @@ tests:
path: spec.gridId
value: ""

- it: defaults a new GridNetwork to roundRobin selection
set:
gridNetwork.name: prod-grid
gridSite.name: prod-site
asserts:
- equal:
path: spec.selectionPolicy.mode
value: roundRobin

- it: renders budgetPolicy.tenants verbatim when set
set:
gridNetwork.name: prod-grid
Expand Down
11 changes: 11 additions & 0 deletions charts/grid-site/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@
}
}
},
"selectionPolicy": {
"type": "object",
"additionalProperties": false,
"required": ["mode"],
"properties": {
"mode": {
"type": "string",
"enum": ["deterministic", "roundRobin", "random"]
}
}
},
"metricsRefreshInterval": {
"type": "string",
"pattern": "^([1-9][0-9]*s|[1-9][0-9]{3,}ms)$"
Expand Down
18 changes: 18 additions & 0 deletions deploy/crds/gridnetwork.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,24 @@ spec:
items:
type: string
type: array
selectionPolicy:
description: |-
Local request distribution policy for the active selection group.

This is independent of scoring. When absent, the overlay carries no
selection override and Praxis uses deterministic selection.
nullable: true
properties:
mode:
description: Local selection mode used by the data-plane gateway.
enum:
- deterministic
- roundRobin
- random
type: string
required:
- mode
type: object
staleCandidateTtlSeconds:
description: |-
Maximum age in seconds before a stale (`fresh=false`) remote routing
Expand Down
3 changes: 3 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
- [Routing](architecture/routing.md) — versioned overlay contract, revision
lifecycle, candidate ordering, `intelligent_route`, `peer_identity_trust`, and
provider-side request forwarding.
- [Provider Selection and Load Balancing](architecture/provider-selection-and-load-balancing.md) —
eligibility, routing groups, scoring, selection modes, affinity, and
overlay lifecycle.
- [Scoring](architecture/scoring.md) — operator-side candidate scoring,
metrics input, and request-time scoring boundaries.
- [Auth and Policy](architecture/auth.md) — provider authentication strategies,
Expand Down
Loading