You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/admin/deploy/docker-compose/upgrade.mdx
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -77,7 +77,7 @@ To perform a multi-version upgrade via migrators [upgrade](/admin/updates/migrat
77
77
```
78
78
79
79
4.**Run Migrator with the `upgrade` command**:
80
-
-*For more detailed instructions and available command flags see our [migrator docs](/admin/updates/migrator/migrator-operations#docker-compose).*
80
+
-*For more detailed instructions and available command flags see our [migrator docs](/admin/updates/migrator/migrator-operations#upgrade).*
81
81
1. If the migrator `image:` in your `docker-compose.yaml` wasn't updated to in the **latest** release of `migrator` in step 2 set migrator's image to the latest release.
Copy file name to clipboardExpand all lines: docs/admin/deploy/kubernetes/upgrade.mdx
+40-65Lines changed: 40 additions & 65 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -120,71 +120,41 @@ For example, if you use [overlays to make changes to the manifests](https://gith
120
120
121
121
## Multi-version upgrades
122
122
123
-
If you are upgrading to **Sourcegraph 5.1 or later**, we encourage you to perform an [**automatic multi-version upgrade**](/admin/updates/automatic). The following procedure has been automated, but is still applicable should errors occur in an automated upgrade.
124
-
125
-
---
126
-
127
123
> **⚠️ Attention:** please see our [cautionary note](/admin/updates/#best-practices) on upgrades, if you have any concerns about running a multiversion upgrade, please reach out to us at [[email protected]](mailto:[email protected]) for advisement.
128
124
129
-
To perform a **manual**multi-version upgrade on a Sourcegraph instance running on our **kubernetes** repo follow the procedure below:
125
+
To perform a multi-version upgrade via migrators [upgrade](/admin/updates/migrator/migrator-operations#upgrade) command on a Sourcegraph instance deployed with our [kustomize repo](https://github.com/sourcegraph/deploy-sourcegraph-k8s) follow the procedure below:
130
126
131
127
1.**Check Upgrade Readiness**:
132
128
- Check the [upgrade notes](/admin/updates/kubernetes#kubernetes-upgrade-notes) for the version range you're passing through.
133
129
- Check the `Site Admin > Updates` page to determine [upgrade readiness](/admin/updates/#upgrade-readiness).
134
130
135
-
2.**Disable Connections to the Database**:
136
-
> **⚠️ 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.
- Follow the [standard legacy upgrade procedure](#upgrade-with-legacy-kubernetes) to pull and merge upstream changes from the version you are upgrading to to your `release` branch.
158
133
159
-
- Wait until the containers come up, and complete their migration to Postgresql 16
160
-
161
-
- The following services must have their replicas scaled to 0:
- The following procedure describes running migrator in brief, for more detailed instructions and available command flags see our [migrator docs](/admin/updates/migrator/migrator-operations#kubernetes-kustomize).
181
-
1. In the `configure/migrator/migrator.Job.yaml` manifest ([kustomize](https://github.com/sourcegraph/deploy-sourcegraph/blob/master/configure/migrator/migrator.Job.yaml) or [legacy](https://github.com/sourcegraph/deploy-sourcegraph/blob/master/configure/migrator/migrator.Job.yaml)):
134
+
3.**Update cluster.yaml and scale down non-database deployments and replicas**:
135
+
- In your cluster kustomization file (`instances/my-sourcegraph/kustomize.yaml`), uncomment the [multi-version-upgrade util](https://github.com/sourcegraph/deploy-sourcegraph-k8s/blob/main/instances/template/kustomization.template.yaml#L155). This will scale down all non-database deployments and statefulSets replicas to 0.
136
+
```yaml
137
+
# - ../../components/utils/uid # -- Run all Postgres database with valid users on host
138
+
- ../../components/utils/multi-version-upgrade # -- Scale down non-database pods to 0 for multi-version upgrade
139
+
# - ../../components/utils/migrate-to-nonprivileged # -- Component for migrating from privileged to non-privileged
> Note: This step will ensure that any PostgreSQL upgrade performed as an entrypoint script will have a chance to execute before the migrator is run. For more information see [Upgradeing PostgreSQL](/admin/postgres#upgrading-postgresql).
148
+
149
+
4.**Run Migrator with the `upgrade` command**:
150
+
-*For more detailed instructions and available command flags see our [migrator docs](/admin/updates/migrator/migrator-operations#upgrade).*
151
+
1. In the `configure/migrator/migrator.Job.yaml`[manifest](https://github.com/sourcegraph/deploy-sourcegraph-k8s/blob/main/components/utils/migrator/resources/migrator.Job.yaml):
182
152
- set the `image:` to the **latest** release of `migrator`
183
153
- set the `args:` value to `upgrade`. **Example:**
@@ -234,14 +204,19 @@ To perform a **manual** multi-version upgrade on a Sourcegraph instance running
234
204
migrator 1/1 9s 35s
235
205
```
236
206
237
-
4. **Pull and merge upstream changes**:
238
-
- Follow the [standard legacy upgrade procedure](#upgrade-with-legacy-kubernetes) to pull and merge upstream changes from the version you are upgrading to to your `release` branch.
239
-
240
-
5. **Scale your replicas back up and apply new manifests**:
241
-
- The [legacy kubernetes upgrade procedure](#upgrade-with-legacy-kubernetes) describes this step in more detail.
242
-
- Ensure that the replica counts adjusted in the previous steps are turned back up.
243
-
- Run `./kubectl-apply-all.sh` to deploy the new pods to the Kubernetes cluster.
244
-
- Monitor the status of the deployment via `kubectl get pods -o wide --watch`.
207
+
5. **Generate and apply a new cluster.yaml file**:
208
+
- Comment out the [multi-version-upgrade util](https://github.com/sourcegraph/deploy-sourcegraph-k8s/blob/main/instances/template/kustomization.template.yaml#L155) in your cluster kustomization file (`instances/my-sourcegraph/kustomize.yaml`).
209
+
```yaml
210
+
# - ../../components/utils/uid # -- Run all Postgres database with valid users on host
211
+
# - ../../components/utils/multi-version-upgrade # -- Scale down non-database pods to 0 for multi-version upgrade
212
+
# - ../../components/utils/migrate-to-nonprivileged # -- Component for migrating from privileged to non-privileged
213
+
```
214
+
- Generate and apply a new cluster.yaml with the new images from Step 2.
Copy file name to clipboardExpand all lines: docs/admin/how-to/upgrade-postgres-12-16-builtin-dbs.mdx
+44-2Lines changed: 44 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,7 +8,7 @@ The following doc contains detailed instructions for upgrading the built-in Post
8
8
9
9
## Docker Compose
10
10
11
-
1. Bring down your deployments
11
+
1.**Bring down your containers**
12
12
```bash
13
13
docker-compose down --remove-orphans
14
14
```
@@ -30,8 +30,50 @@ codeinsights-db:
30
30
```bash
31
31
docker-compose up -d pgsql codeintel-db codeinsights-db
32
32
```
33
-
At this point simply wait for the database containers to come up healthy. If for some reason the database containers fail to come up healthy, please check their logs and reach out to us for support at [email protected].
33
+
Wait for the database containers to come up healthy. If for some reason the database containers fail to come up healthy, please check their logs and reach out to us for support at [email protected].
34
34
35
35
## Kubernetes Kustomize
36
36
37
+
1.**Disable Connections to the Database**:
38
+
- The following services must have their replicas scaled to 0:
2.**Update base files for the database statefulSets**:
55
+
- 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.
0 commit comments