GitHub Copilot
Configure GitHub Copilot in VS Code to use agentgateway deployed in Kubernetes.
Before you begin
3. Install the GitHub Copilot extension in VS Code. 4. Have a GitHub Copilot Business or Enterprise subscription.Get the gateway URL
export INGRESS_GW_ADDRESS=$(kubectl get svc -n agentgateway-system agentgateway-proxy \
-o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo "Gateway address: $INGRESS_GW_ADDRESS"export INGRESS_GW_ADDRESS=$(kubectl get svc -n agentgateway-system agentgateway-proxy \
-o jsonpath='{.status.loadBalancer.ingress[0].hostname}')
echo "Gateway address: $INGRESS_GW_ADDRESS"After port-forwarding, the gateway is accessible at http://localhost:8080. Use localhost:8080 wherever the instructions reference $INGRESS_GW_ADDRESS.
kubectl port-forward -n agentgateway-system svc/agentgateway-proxy 8080:80Configure GitHub Copilot
Open VS Code Settings (
Cmd + ,on macOS,Ctrl + ,on Windows/Linux).Search for
github.copilotin the settings search bar.Set the proxy URL to your agentgateway address. Click Edit in settings.json and add:
{ "github.copilot.advanced": { "debug.overrideProxyUrl": "http://<INGRESS_GW_ADDRESS>/<route-path>" } }For example, if your HTTPRoute uses path
/openai, usehttp://<INGRESS_GW_ADDRESS>/openai.Save the file and reload VS Code (
Cmd + Shift + P> Developer: Reload Window).
Verify the connection
- Open a code file in VS Code.
- Start typing and wait for Copilot suggestions to appear.
- Open the Copilot chat panel and send a test message.