Skip to content

Commit 9a2eeea

Browse files
authored
Modify Instructions to install KDP AI Agent (kubermatic#1965)
* modify instructions to set up kdp ai agent Signed-off-by: julioc-p <14-10820@usb.ve> * taking out manual dletion of pods Signed-off-by: julioc-p <14-10820@usb.ve> * set ingress to true Signed-off-by: julioc-p <14-10820@usb.ve> * introducing manual deletion of pods for kdp dashboard to pick up new config values Signed-off-by: julioc-p <14-10820@usb.ve> * note for spec generation Signed-off-by: julioc-p <14-10820@usb.ve> --------- Signed-off-by: julioc-p <14-10820@usb.ve>
1 parent 8df0c35 commit 9a2eeea

File tree

2 files changed

+91
-45
lines changed

2 files changed

+91
-45
lines changed

content/developer-platform/setup/ai-agent/_index.en.md

Lines changed: 86 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -21,78 +21,115 @@ The AI Agent is deployed using Helm. Follow these steps to install it:
2121

2222
### Prepare the Configuration
2323

24-
Create a `values.yaml` file with your specific configuration:
24+
Create a `ai-agent.values.yaml` file with your specific configuration:
2525

2626
```yaml
2727
aiAgent:
2828
imagePullSecret: |
2929
{
30-
"quay.io": {}
30+
"auths": {
31+
"quay.io": {
32+
"auth": "<PULL_CREDENTIALS>",
33+
"email": ""
34+
}
35+
}
3136
}
3237
33-
image:
34-
repository: "quay.io/kubermatic/developer-platform-ai-agent"
35-
tag: "v1.0.0" # Use the latest version or a specific version
3638
3739
config:
38-
oidc_client_id: kdp-kubelogin # OIDC client ID for authentication
39-
oidc_client_secret: "your-client-secret" # OIDC client secret
40-
oidc_issuer: "https://your-oidc-provider" # URL of the OIDC provider
41-
kubernetes_api_url: "https://your-kdp-api" # KDP API server URL
42-
openai_api_key: "your-openai-api-key" # OpenAI API key for the language model
40+
oidc:
41+
clientID: kdp-kubelogin
42+
clientSecret: <OIDC_CLIENT_SECRET>
43+
issuerURL: https://login.<DOMAIN>
44+
kubernetes_api_url: https://api.<DOMAIN>
45+
openai_api_key: "<OPEN_API_KEY>" # OpenAI API key for the language model
4346

4447
ingress:
45-
create: false
46-
host: kdp.example.com # this should be main domain configured for KDP
47-
class: nginx
48-
scheme: https
49-
prefix: /ai-agent(/|$)(.*)
50-
51-
# When scheme is set to "https", you either need to provide a TLS certificate
52-
# yourself, or you can use the settings below to use cert-manager.
53-
# certIssuer:
54-
# # This needs to reference an _existing_ (Cluster)Issuer to provision
55-
# # the TLS certificate for the protoboard.
56-
# kind: ClusterIssuer
57-
# name: letsencrypt-prod
58-
59-
resources:
60-
requests:
61-
cpu: 100m
62-
memory: 128Mi
63-
limits:
64-
cpu: 500m
65-
memory: 256Mi
48+
create: true
49+
host: ai-agent.<DOMAIN>
50+
certIssuer:
51+
kind: ClusterIssuer
52+
name: letsencrypt-prod
6653

6754
```
6855

69-
Adjust the values according to your environment.
56+
Before deploying the KDP dashboard, you need to replace the following placeholder variables in the `ai-agent.values.yaml` file with your own values:
57+
58+
* `<OPEN_API_KEY>`
59+
* `<DOMAIN>`
60+
* `<OIDC_CLIENT_SECRET>`
61+
62+
The `<OIDC_CLIENT_SECRET>` placeholder **must** be replaced with the value set in Dex and configured in the `dex.values.yaml` file.
7063

7164
### Install with Helm
7265

66+
Now that all placeholders are replaced, deploy the KDP AI Agent Helm chart.
67+
To log into the Helm registry, use your email address as the username and the license key you received as the password.
68+
69+
```bash
70+
$ helm registry login quay.io
71+
$ helm upgrade --install kdp-ai-agent \
72+
oci://quay.io/kubermatic/helm-charts/developer-platform-ai-agent \
73+
--version=0.9.0 \
74+
--create-namespace \
75+
--namespace=kdp-system \
76+
--values=ai-agent.values.yaml
7377
```
74-
helm upgrade \
75-
--install \
76-
--namespace <namespace> \ # if you are using an Issuer (namespaced), remember to use the same namespace here
77-
--version <kdp_version> \
78-
--values <your_values_path> \
79-
--set-string "ai-agent.image.tag=v<kdp_version>" \
80-
<release_name> <chart_path>
78+
79+
### Configure DNS record
80+
81+
You need to create a DNS record pointing to the load balancer of your Kubernetes cluster.
82+
83+
Create a DNS record that directs traffic from `ai-agent.<DOMAIN>` to your cluster's NGINX ingress controller.
84+
85+
Assuming you installed the NGINX ingress controller into the `ingress-nginx` namespace, use the following command to the retrieve the external IP address or DNS name of the load balancer (in column "EXTERNAL-IP"):
86+
87+
```bash
88+
$ kubectl --namespace=ingress-nginx get service ingress-nginx-controller
89+
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
90+
ingress-nginx-controller LoadBalancer 10.47.248.232 4cdd93dfab834ed9a78858c7f2633380.eu-west-1.elb.amazonaws.com 80:30807/TCP,443:30184/TCP 449d
8191
```
8292

8393
### Configure the Dashboard
8494

85-
To make the AI Agent accessible from the KDP Dashboard, you need to update the `values.yaml` file for your **dashboard deployment**. You'll need to set two environment variables within your dashboard's configuration.
95+
To make the AI Agent accessible from the KDP Dashboard, you need to update the `values.yaml` file for your **dashboard deployment**. Assuming you followed the quickstart, this file would be `kdp-dashboard.values.yaml`.
96+
97+
You will need to edit it to activate the AI Agent feature and set the backend url.
98+
99+
100+
```yaml
101+
dashboard:
102+
config:
103+
features:
104+
aiAgent:
105+
enabled: true
106+
generatorURL: ai-agent.<DOMAIN>
107+
```
108+
109+
110+
You'll need to replace `<DOMAIN>`.
86111

87-
First, enable the AI Agent feature in the UI by setting the environment variable `next_public_enable_generate_spec` to `"true"`.
112+
Then after this update the release of your kdp dashboard. If you followed the Quickstart it will be called `kdp-dashboard` in the `kdp-system` namespace, so the command would look like this to first login and then update:
88113

89-
Second, tell the frontend where the AI Agent backend is located by setting the environment variable `next_public_spec_generator_url` to your agent's URL (for example, `"https://kdp.example.com/ai-agent/"`).
114+
```bash
115+
$ helm registry login quay.io
116+
$ helm upgrade --install kdp-dashboard \
117+
oci://quay.io/kubermatic/helm-charts/developer-platform-dashboard \
118+
--version=0.9.0 \
119+
--create-namespace \
120+
--namespace=kdp-system \
121+
--values=kdp-dashboard.values.yaml
122+
```
123+
124+
After this you will need to delete the pod for the dashboard manually for it to be redeployed and pick up the new values. You can find them by the label `app.kubernetes.io/name: kdp-dashboard` and delete with.
90125

91-
**Important:** To avoid CORS errors, the URL for `next_public_spec_generator_url` must use the same host as your main KDP dashboard (and in general the main kdp domain). The path (`/ai-agent/` in this example) must also match the `ingress.prefix` you configured in the AI Agent's `values.yaml` in Step 1.
126+
```bash
127+
kubectl delete pods -l app.kubernetes.io/name=kdp-dashboard -n kdp-system
128+
```
92129

93130
### Verify the Installation
94131

95-
Once the pod is running, you can use it in the frontend.
132+
Once the pods start, you can use the AI Agent in the frontend.
96133

97134
A purple button should be visible in the form to create a new service object within a workspace.
98135

@@ -108,4 +145,8 @@ After a few seconds you should get the result:
108145

109146
![AI Agent response](ai-agent-example-response.png)
110147

111-
You can then edit and modify if you like. You also do not have to worry about getting a wrong schema since it is getting validated in the backend. You can be sure there are no hallucinated fields nor missing required fields.
148+
You can then edit and modify if you like, from the form or directly in the YAML.
149+
150+
You also do not have to worry about getting a wrong schema since it is getting validated in the backend. You can be sure there are no hallucinated fields nor missing required fields.
151+
152+
**Note:** Please be sure to check the values and the YAML in general before submitting. AI can make mistakes.

content/developer-platform/setup/quickstart/_index.en.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,3 +254,8 @@ After logging in, you will be taken to the KDP dashboard, where you can begin ex
254254
[k8s/docs/tools/installation]: https://kubernetes.io/docs/tasks/tools/#kubectl
255255
[kcp/chart/readme]: https://github.com/kcp-dev/helm-charts/tree/main/charts/kcp
256256
[kubelogin/src/readme]: https://github.com/int128/kubelogin
257+
258+
259+
### Extensions
260+
261+
If you want to install the KDP AI Agent, which helps you generate yaml files for resources from descriptions in natural language, follow [these instructions](../ai-agent/_index.en.md).

0 commit comments

Comments
 (0)