|
| 1 | +# Testing OpenStackAssistant with OpenStack Lightspeed |
| 2 | + |
| 3 | +This guide deploys OpenStack Lightspeed and an OpenStack Assistant instance so |
| 4 | +you can run Goose inside the cluster and try its OpenStack and OpenShift MCP |
| 5 | +tools. |
| 6 | + |
| 7 | +OpenStack Lightspeed provides the inference API Goose uses. OpenStackAssistant |
| 8 | +provides the Goose runtime and its tool configuration; it is reconciled by the |
| 9 | +OpenStack Operator. The MCP server used by Goose in this guide comes from |
| 10 | +OpenStackClient. OpenStack Lightspeed has a separate optional MCP sidecar, which |
| 11 | +this guide does not enable. |
| 12 | + |
| 13 | +> [!IMPORTANT] |
| 14 | +> Before starting, you need a working RHOSO deployment. The MCP tools in this |
| 15 | +> guide expect resources from the deployed OpenStack control plane and are not |
| 16 | +> available without RHOSO. |
| 17 | +
|
| 18 | +## 1. Deploy the OpenStack Lightspeed operator |
| 19 | + |
| 20 | +From the lightspeed-operator repository, deploy the operator using the adjacent |
| 21 | +`install_yamls` checkout: |
| 22 | + |
| 23 | +```bash |
| 24 | +(cd ../install_yamls && make openstack_lightspeed) |
| 25 | +``` |
| 26 | + |
| 27 | +## 2. Create the LLM credentials and OpenStackLightspeed instance |
| 28 | + |
| 29 | +Create the API token Secret in the `openstack-lightspeed` namespace. Replace |
| 30 | +`REDACTED` locally with the API token for your LLM provider before applying; |
| 31 | +do not commit the real token or add it to this document. |
| 32 | + |
| 33 | +```yaml |
| 34 | +apiVersion: v1 |
| 35 | +kind: Secret |
| 36 | +metadata: |
| 37 | + name: openstack-lightspeed-apitoken |
| 38 | + namespace: openstack-lightspeed |
| 39 | +type: Opaque |
| 40 | +stringData: |
| 41 | + apitoken: REDACTED |
| 42 | +``` |
| 43 | +
|
| 44 | +Save this as `openstack-lightspeed-apitoken.yaml`. |
| 45 | + |
| 46 | +Copy the maintained [OpenStackLightspeed sample](https://github.com/openstack-k8s-operators/lightspeed-operator/blob/main/config/samples/lightspeed_v1beta1_openstacklightspeed.yaml) |
| 47 | +to `openstacklightspeed.yaml`. Set `metadata.name` to `openstack-lightspeed` |
| 48 | +and `metadata.namespace` to `openstack-lightspeed`. Set `spec.defaultModel` to |
| 49 | +the name of a model in `spec.models`, then set that model's `llmEndpoint`, |
| 50 | +`llmEndpointType`, `llmCredentials`, and `modelName` for your provider. Use the |
| 51 | +provider's API URL, including `/v1` when required. The endpoint must be |
| 52 | +reachable from the `openstack-lightspeed` namespace. See |
| 53 | +[Configuration](configuration.md#models-models) for field details and supported |
| 54 | +providers. |
| 55 | + |
| 56 | +If the endpoint uses a private or self-signed certificate that the cluster |
| 57 | +does not trust, create the `llm-endpoint-ca` ConfigMap in |
| 58 | +`openstack-lightspeed` with its CA bundle in PEM format and set |
| 59 | +`spec.tlsCACertBundle` to `llm-endpoint-ca`. Otherwise, remove the sample's |
| 60 | +`tlsCACertBundle` field. |
| 61 | + |
| 62 | +Prepare `llm-endpoint-ca.yaml` locally from your provider's CA bundle if one is |
| 63 | +needed, and keep credentials and certificate material out of version control. |
| 64 | +Apply the Secret and custom resource from the lightspeed-operator repository |
| 65 | +root. Apply the CA ConfigMap only when needed: |
| 66 | + |
| 67 | +```bash |
| 68 | +oc apply -f openstack-lightspeed-apitoken.yaml |
| 69 | +oc apply -f llm-endpoint-ca.yaml # only for a private or self-signed endpoint certificate |
| 70 | +oc apply -f openstacklightspeed.yaml |
| 71 | +``` |
| 72 | + |
| 73 | +## 3. Wait for OpenStack Lightspeed to become ready |
| 74 | + |
| 75 | +Wait for the custom resource to report `Ready`, then check its pods and |
| 76 | +conditions for errors before proceeding: |
| 77 | + |
| 78 | +```bash |
| 79 | +oc wait -n openstack-lightspeed \ |
| 80 | + openstacklightspeed/openstack-lightspeed \ |
| 81 | + --for=condition=Ready --timeout=20m |
| 82 | +oc get -n openstack-lightspeed deployments,pods |
| 83 | +oc describe -n openstack-lightspeed \ |
| 84 | + openstacklightspeed/openstack-lightspeed |
| 85 | +``` |
| 86 | + |
| 87 | +Resolve any failing conditions, pod errors, or image pull issues before |
| 88 | +creating the assistant. |
| 89 | + |
| 90 | +## 4. Deploy OpenStackAssistant |
| 91 | + |
| 92 | +The `openstack_assistant` target creates the `OpenStackAssistant` custom |
| 93 | +resource and its supporting configuration. It expects the RHOSO |
| 94 | +`OpenStackClient` resource named `openstackclient` in the `openstack` |
| 95 | +namespace. The target checks that the OpenStackClient MCP endpoint is enabled |
| 96 | +and enables it through the owning `OpenStackControlPlane` if needed. |
| 97 | + |
| 98 | +```bash |
| 99 | +(cd ../install_yamls && make openstack_assistant) |
| 100 | +``` |
| 101 | + |
| 102 | +Confirm the assistant and its pod are ready before entering the pod: |
| 103 | + |
| 104 | +```bash |
| 105 | +oc get -n openstack openstackassistant/openstack-assistant |
| 106 | +oc get -n openstack pod/openstack-assistant |
| 107 | +``` |
| 108 | + |
| 109 | +## 5. Start Goose in the assistant pod |
| 110 | + |
| 111 | +Enter the pod: |
| 112 | + |
| 113 | +```bash |
| 114 | +oc rsh -n openstack openstack-assistant |
| 115 | +``` |
| 116 | + |
| 117 | +Then launch Goose in the pod: |
| 118 | + |
| 119 | +```bash |
| 120 | +goose |
| 121 | +``` |
| 122 | + |
| 123 | +You can use interactive chat directly or run a pre-configured recipe with: |
| 124 | + |
| 125 | +```bash |
| 126 | +/cluster-health |
| 127 | +``` |
| 128 | + |
| 129 | +The assistant can use the read-only OpenStack MCP server running alongside |
| 130 | +OpenStackClient in its `mcp-server` sidecar. A Kubernetes NetworkPolicy protects |
| 131 | +that MCP connection. The Goose developer extension also provides `oc` tools; |
| 132 | +those run under a locked-down service account created by openstack-operator and |
| 133 | +are restricted to read-only commands. |
0 commit comments