Skip to content

Commit e346ab2

Browse files
Document PostgreSQL CA certificate setup (#687)
* Document PostgreSQL CA certificate setup Explain how to verify PostgreSQL certificates using system roots or a mounted private CA, and note the Agent Substrate chart limitation. Signed-off-by: Rachael Graham <rachael.graham@solo.io> * Update installation.md Signed-off-by: Rachael Graham <rachael.graham@solo.io> * Update upgrade-from-0x.md Signed-off-by: Rachael Graham <rachael.graham@solo.io> * Update upgrade.md Signed-off-by: Rachael Graham <rachael.graham@solo.io> * Update upgrade.md Signed-off-by: Rachael Graham <rachael.graham@solo.io> * review comments Signed-off-by: Rachael Graham <rachael.graham@solo.io> --------- Signed-off-by: Rachael Graham <rachael.graham@solo.io>
1 parent 9b62347 commit e346ab2

3 files changed

Lines changed: 31 additions & 8 deletions

File tree

‎docs-site/content/kagent/1.x/operations/upgrade-from-0x.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ author: kagent.dev
99

1010
## In-place upgrade blockers
1111

12-
Each of the following independent changes rules out `helm upgrade`, so working around any one of them does not help.
12+
Review the following changes between 0.10.x and 1.0 before you continue. Each change blocks `helm upgrade` by itself, so fixing one change does not unblock the upgrade.
1313

1414
| Change | Consequence |
1515
| ------ | ----------- |
@@ -40,11 +40,11 @@ The two releases also cannot run side by side on one cluster. The group rename s
4040
--file=kagent-0.10-backup.dump
4141
```
4242

43-
5. Install [`yq`](https://github.com/mikefarah/yq#install) version 4 or later. The steps in [Resources that carry forward](#resources-that-carry-forward) use `yq` to convert the exported resources.
43+
5. Install [`yq`](https://github.com/mikefarah/yq#install) version 4 or later. The steps in [Resources that you can convert](#resources-that-you-can-convert) use `yq` to convert the exported resources.
4444

4545
## Export your 0.10.x resources
4646

47-
Your Kubernetes resources do carry forward, so export them before anything replaces the CRDs. Conversation history does not carry forward.
47+
Export your resources before the 1.0 CRDs replace the 0.10.x CRDs. Some resources convert to 1.0, and the rest serve as a reference when you write their 1.0 replacements. 1.0 cannot read the conversation history of 0.10.x.
4848

4949
1. Export every kagent resource in your namespace.
5050
```bash
@@ -159,9 +159,9 @@ Before you start, complete the [Before you begin]({{< link path="setup/installat
159159
160160
## Recreate your resources
161161
162-
The export splits into resources that carry forward with small changes, agents that need rewriting, and resources that do not have a 1.0 equivalent. Because an AgentTemplate refers to the ModelConfigs and RemoteMCPServers that you recreate in [Resources that carry forward](#resources-that-carry-forward), work through the groups in that order.
162+
The export splits into resources that convert with small changes, agents that need rewriting, and resources that do not have a 1.0 equivalent. Because an AgentTemplate refers to the ModelConfigs and RemoteMCPServers that you recreate in [Resources that you can convert](#resources-that-you-can-convert), work through the groups in that order.
163163
164-
### Resources that carry forward
164+
### Resources that you can convert {#resources-that-you-can-convert}
165165
166166
ModelConfig, ModelProviderConfig, and RemoteMCPServer keep most of the fields that `v1alpha2` sets. `v1alpha3` renames the ModelConfig field `apiKeyPassthrough` to `tokenPassthrough`, and the field's behavior does not change. `v1alpha3` removes the following ModelConfig fields. When a resource sets any of them, the API server rejects the resource and reports the field as unknown.
167167

‎docs-site/content/kagent/1.x/operations/upgrade.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ author: kagent.dev
77

88
An installation of {{< reuse "kagent-docs/snippets/name-product.md" >}} consists of five Helm releases. Upgrade the releases in the order that you installed them, starting with the CRDs, then Agent Substrate, and then the kagent control plane.
99

10-
Upgrade through each minor version in order, and do not skip a minor version. For example, to move from 1.0.x to 1.2.0, upgrade to 1.1.0 first, and then to 1.2.0. Within a minor version, you can upgrade directly to any later patch release, such as from 1.0.0 to 1.0.2. To move a 0.10.x installation to 1.x, see [Upgrade from 0.x]({{< link path="operations/upgrade-from-0x" >}}) instead.
10+
Upgrade from one stable release to the next, and do not skip a stable release. Before you move to the next stable release, upgrade to the latest patch version of your current stable release. Patch releases do not change the database schema, so you can upgrade directly to the latest patch release without the patch releases in between. To move a 0.10.x installation to 1.x, see [Upgrade from 0.x]({{< link path="operations/upgrade-from-0x" >}}) instead.
1111

12-
<!-- REVIEW: kagent is moving from semantic versioning to calendar versioning. The release-order examples in the preceding paragraph, the version variables in "Prepare to upgrade", and the release-order rule itself assume semver. Rewrite them when the calendar version format is published. -->
12+
<!-- REVIEW: kagent is moving from semantic versioning to calendar versioning. The release-order rule in the preceding paragraph follows the stable-release model that OSS and enterprise share and names no version format. Add version examples, and define a stable release, when the calendar version format is published. The calendar versioning scheme calls these releases LTS releases, so replace "stable" with "LTS" then. The version variables in "Prepare to upgrade" assume semver. -->
1313

1414
## Prepare to upgrade
1515

@@ -49,7 +49,7 @@ Complete every step in this section before you change any release. The steps mak
4949
```
5050
For an installation that you exported from the kagent CLI, the `kagent-values.yaml` file contains your model provider API key in plain text. Store the files securely.
5151

52-
6. Save the target versions in environment variables. The following values are the versions that this documentation describes. To upgrade through an intermediate minor version first, set the versions of that release.
52+
6. Save the target versions in environment variables. The following values are the versions that this documentation describes. To upgrade across more than one stable release, set the versions of the next stable release, and repeat the upgrade for each stable release.
5353
```bash
5454
export KAGENT_VERSION={{< reuse "kagent-docs/versions/kagent.md" >}}
5555
export SUBSTRATE_VERSION={{< reuse "kagent-docs/versions/agent-substrate-chart.md" >}}

‎docs-site/content/kagent/1.x/setup/installation.md‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,29 @@ kagent and Agent Substrate each connect with an owner login, which applies migra
280280
kubectl create secret generic substrate-postgres-readwrite -n ate-system \
281281
--from-literal=readWriteConnectionString="postgresql://substrate_readwrite_user:${SUBSTRATE_READWRITE_PASSWORD}@<host>:5432/kagent?sslmode=verify-full"
282282
```
283+
The `sslmode=verify-full` setting makes each component verify the server certificate of the database against a root certificate. How you provide that root certificate depends on the certificate authority (CA) that signed the server certificate.
284+
* For a publicly trusted CA, add `sslrootcert=system` to each connection string. Each component then verifies the server certificate against the root certificates in its container image.
285+
* For a private CA, such as the Amazon RDS CA, kagent reads the CA certificate from a file that you mount on the controller. Agent Substrate cannot mount a CA file in this release, so the Agent Substrate connection strings cannot verify a server certificate that a private CA signed.
286+
<!-- REVIEW: Agent Substrate chart gap, tracked in https://github.com/kagent-dev/substrate/issues/125. Replace the preceding sentence with the procedure when the chart can mount a CA file. -->
287+
1. Store the CA certificate in a Secret.
288+
```bash
289+
kubectl create secret generic kagent-postgres-ca -n kagent \
290+
--from-file=ca.crt=<path-to-ca-certificate>
291+
```
292+
2. Add `sslrootcert=/run/postgres-ca/ca.crt` to both kagent connection strings.
293+
3. When you [install kagent](#install-kagent-helm), add the following values to the command. The values mount the `kagent-postgres-ca` Secret on the controller as a read-only volume at `/run/postgres-ca`. The `sslrootcert` setting in the kagent connection strings reads the CA certificate from that path.
294+
```yaml
295+
controller:
296+
volumes:
297+
- name: postgres-ca
298+
secret:
299+
secretName: kagent-postgres-ca
300+
volumeMounts:
301+
- name: postgres-ca
302+
mountPath: /run/postgres-ca
303+
readOnly: true
304+
```
305+
283306
For the other database settings, such as the connection pool and the `pgvector` extension that [long-term memory]({{< link path="agents/agent-memory" >}}) needs, see [Use an external PostgreSQL instance]({{< link path="operations/operational-considerations#use-an-external-postgresql-instance" >}}).
284307
285308
### Install Agent Substrate

0 commit comments

Comments
 (0)