Skip to content

Deployment Profiles

arielgoes edited this page May 11, 2026 · 1 revision

Deployment Profiles

A deployment profile is the single source of truth for everything that varies between workloads under test: namespace, NF names, the LLM context prompt, fault recipes, health-check expectations, and custom tools. Profiles live in deployments/*.json and are loaded by engine/profile.py.

A profile can be selected by:

  • Bare name: --profile open5gs (resolved to deployments/open5gs.json)
  • Relative path: --profile deployments/open5gs.json
  • Absolute path: --profile /abs/path/to/profile.json

Full Schema (Open5GS reference)

{
  "name": "open5gs",
  "description": "Open5GS 5G Core network deployed on Kubernetes via openverso-charts",
  "namespace": "open5gs",
  "deployment": {
    "release_name": "open5gs",
    "releases": ["open5gs"],
    "ueransim": true
  },
  "components": {
    "amf": { "deployment": "open5gs-amf" },
    "smf": { "deployment": "open5gs-smf" },
    "upf": { "deployment": "open5gs-upf" }
    // ... ausf, bsf, nrf, nssf, pcf, udm, udr, webui
  },
  "context_prompt": "Open5GS is a 5G Core network running on Kubernetes with the following NFs:\nAMF, AUSF, BSF, NRF, NSSF, PCF, SMF, UDM, UDR, UPF, WebUI.\nUERANSIM provides the gNB and UE simulators.\nAll NFs communicate via SBI (Service-Based Interface) on port 7777.",
  "name_prefixes": { "default": "open5gs-" },
  "scenario_targets": {
    "1": { "description": "A fault has been injected into the Open5GS 5G Core deployment in the '{namespace}' namespace. UEs can register but PDU session establishment is failing. Diagnose the root cause and provide remediation steps." }
    // ... 2, 3
  },
  "fault_injection": {
    "1": { "method": "kubectl_apply", "file": "scenarios/scenario_1_netpol.yaml" },
    "2": { "method": "kubectl_patch", "target_deployment": "open5gs-smf",
           "patch": "[{\"op\":\"add\",\"path\":\"/spec/template/spec/containers/0/envFrom\",\"value\":[{\"configMapRef\":{\"name\":\"smf-extra-config-missing\"}}]}]" },
    "3": { "method": "kubectl_scale", "target_deployment": "open5gs-upf", "replicas": 0 }
  },
  "health_check": {
    "check_type": "deployments",
    "expected_deployments": [
      "open5gs-amf", "open5gs-ausf", "open5gs-bsf", "open5gs-nrf",
      "open5gs-nssf", "open5gs-pcf", "open5gs-smf", "open5gs-udm",
      "open5gs-udr", "open5gs-upf", "open5gs-webui"
    ]
  },
  "custom_tools": []
}

Field Reference

Field Purpose
name Profile identifier; also rendered into the LLM system prompt as the deployment-context name.
namespace Kubernetes namespace used by all tools and remediation. Remediation is pinned to this namespace — commands targeting another namespace are blocked.
deployment Helm release metadata used by nuke-deployment.sh / reset-deployment.sh.
components Logical NF name → real deployment name. Enables short-name resolution (e.g. smf → open5gs-smf).
context_prompt Free-text block injected into the LLM system prompt to describe the deployment.
name_prefixes Fallback prefix table used by _resolve_name if a tool argument is a short name.
scenario_targets.<id> User-message description for scenario <id>. {namespace} is interpolated.
fault_injection.<id> How to inject scenario <id> — see methods below.
health_check.check_type Currently deployments (others can be added in health/health_check.py).
health_check.expected_deployments Names that must be Available for the run to count as recovered.
custom_tools Optional list of extra LLM tools (see Diagnostic Tools).

Fault Injection Methods

Method Required fields Effect
kubectl_apply file (path relative to project root) kubectl apply -f <file> -n <namespace>
kubectl_patch target_deployment, patch (JSON Patch string) kubectl patch deployment <target> --type=json -p <patch>
kubectl_scale target_deployment, replicas kubectl scale deployment <target> --replicas=<n>

Name Resolution

When the LLM calls a tool with pod_name="smf", engine/profile.resolve_name() walks the profile:

  1. If the profile's components map contains a key matching the short name, return its deployment value.
  2. Otherwise prepend name_prefixes.default (e.g. open5gs-smf).
  3. Fallback: query the cluster and look for any resource ending in -<short_name>.

This is what allows the same prompt templates and tools to work across Open5GS, free5GC, or any custom workload.

Adding a New Profile

Drop deployments/<name>.json matching the schema above and set:

export DEPLOYMENT_PROFILE=<name>
# or
./run_experiment.sh --profile <name> ...

No code changes required. The deployment-specific Helm/kubectl plumbing in nuke-deployment.sh is the only piece that may still need attention for non-Open5GS workloads.

Clone this wiki locally