Skip to content

Commit b144cc0

Browse files
fix: add copy-paste commands for k8s upgrade
1 parent fae5c96 commit b144cc0

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

docs/admin/deploy/kubernetes/upgrade.mdx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,30 @@ To perform a **manual** multi-version upgrade on a Sourcegraph instance running
134134

135135
2. **Disable Connections to the Database**:
136136
> **⚠️ Attention:** If your database is still running Postgres 12, upgrade your database to Postgres 16 in this step. For our built-in databases offerings, this can be accomplished by starting the databases using our `postgresql-16` images packaged in the deploy repos starting in version `5.10.0`. Learn more [here](/admin/postgres).
137+
- If you're using our built in Postgres containers, versions from 5.10 onwards contain update in place scripts than run if necessary. You will first have to update the `image` field in your `pgsql`, `codeintel-db` and `codeinsights-db` StatefulSets to `sourcegraph/postgresql-16:6.0.0` and `sourcegraph/codeinsights-db:6.0.0` respectively.
138+
- **Example:**
139+
```yaml
140+
# deploy-sourcegraph-k8s/base/sourcegraph/codeinsights-db/codeinsights-db.StatefulSet.yaml
141+
containers:
142+
- name: codeinsights
143+
image: index.docker.io/sourcegraph/postgresql-16-codeinsights:6.0.0
144+
# deploy-sourcegraph-k8s/base/sourcegraph/codeintel-db/codeintel-db.StatefulSet.yaml
145+
containers:
146+
- name: pgsql
147+
image: index.docker.io/sourcegraph/postgresql-16:6.0.0
148+
# deploy-sourcegraph-k8s/base/sourcegraph/pgsql/pgsql.StatefulSet.yaml
149+
containers:
150+
- name: pgsql
151+
image: index.docker.io/sourcegraph/postgresql-16:6.0.0
152+
```
153+
154+
- Apply specifically these changes to your cluster:
155+
```sh
156+
$ kubectl apply -f deploy-sourcegraph-k8s/base/sourcegraph/pgsql/pgsql.StatefulSet.yaml deploy-sourcegraph-k8s/base/sourcegraph/codeintel-db/codeintel-db.StatefulSet.yaml deploy-sourcegraph-k8s/base/sourcegraph/codeinsights-db/codeinsights-db.StatefulSet.yaml
157+
```
158+
159+
- Wait until the containers come up, and complete their migration to Postgresql 16
160+
137161
- The following services must have their replicas scaled to 0:
138162
- Deployments (e.g., `kubectl scale deployment <name> --replicas=0`)
139163
- precise-code-intel-worker

0 commit comments

Comments
 (0)