Skip to content

Plugin: Cluster Context Injection #165

Description

@bobbyjohnstx

Summary

On session start, query the current OpenShift context and inject cluster metadata into the system prompt. ~50 lines of code, high leverage.

Plugin Details

  • Red Hat products: OpenShift 4.22, RHACS, ACM
  • Plugin hooks: experimental.chat.system.transform, session.start
  • Complexity: Low (quick win)
  • Priority: 5 (Medium value, very low effort)

System prompt injection

<cluster-context>
cluster: mycluster.example.com
version: 4.22.3
nodes: 6 (3 control-plane, 3 worker)
namespace: my-app
operators: [openshift-virtualization, rhacs-operator, openshift-gitops, openshift-pipelines]
rhacs-status: central healthy, 0 critical violations
acm-managed: true (hub: central-hub.example.com)
</cluster-context>

What it queries (on session start)

  • oc version — cluster version
  • oc get nodes — node count and roles
  • oc config current-context — active namespace
  • oc get csv -A — installed operators
  • oc get clusterversion — update channel
  • Optional: RHACS Central health, ACM compliance summary

Implementation notes

  • All queries run in parallel on session start
  • Results cached for session duration
  • If oc not available or not logged in: <cluster-context>not connected</cluster-context>
  • Eliminates "what cluster am I on?" back-and-forth at session start

From: Red Hat Product Integration Plugin Ideas

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions