Skip to content

Commit eec42cd

Browse files
committed
Add helm offline installation instruction
1 parent 577987f commit eec42cd

File tree

1 file changed

+45
-17
lines changed

1 file changed

+45
-17
lines changed

docs/admin/deploy/kubernetes/index.mdx

Lines changed: 45 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,16 +1021,18 @@ When all pods have restarted and show as Running, you can browse to your Sourceg
10211021

10221022
**Step 2:**
10231023

1024-
> <Callout type="warning">
1025-
> The Kubernetes Helm deployment type does not support MVU from Sourcegraph
1026-
> `v5.9.45` versions and earlier to ANY version `v6.0.x` or later. Admins
1027-
> seeking to upgrade to any Sourcegraph version `v6.0.x` or later (including
1028-
> `v6.1.x`, `v6.2.x`, etc.) must first upgrade to `v5.10.3940` or
1029-
> `v5.11.6271` and then use the standard upgrade procedure to get to their
1030-
> target version. This is because migrator in all versions from `v6.0.0`
1031-
> onwards will no longer connect to Postgres 12 databases. For more info see
1032-
> our [PostgreSQL upgrade docs](/admin/postgres#requirements).
1033-
> </Callout>
1024+
<Callout type="warning">
1025+
1026+
The Kubernetes Helm deployment type does not support MVU from Sourcegraph
1027+
`v5.9.45` versions and earlier to ANY version `v6.0.x` or later. Admins
1028+
seeking to upgrade to any Sourcegraph version `v6.0.x` or later (including
1029+
`v6.1.x`, `v6.2.x`, etc.) must first upgrade to `v5.10.3940` or
1030+
`v5.11.6271` and then use the standard upgrade procedure to get to their
1031+
target version. This is because migrator in all versions from `v6.0.0`
1032+
onwards will no longer connect to Postgres 12 databases. For more info see
1033+
our [PostgreSQL upgrade docs](/admin/postgres#requirements).
1034+
1035+
</Callout>
10341036

10351037
Scale down `deployments` and `statefulSets` that access the database, _this step prevents services from accessing the database while schema migrations are in process._
10361038
The following services must have their replicas scaled to 0:
@@ -1049,13 +1051,15 @@ The following convenience commands provide an example of scaling down the necess
10491051

10501052
Deployments:
10511053

1052-
````sh
1054+
```sh
10531055
$ kubectl get -n sourcegraph deploy --no-headers | awk '{print $1}' | xargs -n 1 -P 8 -I % kubectl -n sourcegraph scale deployment % --replicas=0
1054-
```
1056+
```
1057+
10551058
StatefulSets:
1059+
10561060
```sh
10571061
$ kubectl -n sourcegraph get sts --selector 'app.kubernetes.io/component!=codeinsights-db,app.kubernetes.io/component!=codeintel-db,app.kubernetes.io/component!=pgsql' --no-headers | awk '{print $1}' | xargs -n 1 -P 8 -I % kubectl -n sourcegraph scale sts % --replicas=0
1058-
````
1062+
```
10591063

10601064
<Callout type="note">
10611065
The commands above use the `sourcegraph` namespace and are specific to the
@@ -1078,7 +1082,7 @@ $ helm upgrade --install -n <your namespace> --set "migrator.args={upgrade,--fro
10781082

10791083
**Example:**
10801084

1081-
````sh
1085+
```sh
10821086
$ helm upgrade --install -n sourcegraph --set "migrator.args={upgrade,--from=3.41.0,--to=4.5.1}" sourcegraph-migrator sourcegraph/sourcegraph-migrator --version {CURRENT_VERSION_NO_V}
10831087
Release "sourcegraph-migrator" has been upgraded. Happy Helming!
10841088
NAME: sourcegraph-migrator
@@ -1091,7 +1095,7 @@ TEST SUITE: None
10911095
👉 Migrating to v4.5 (step 3 of 3)
10921096
👉 Running schema migrations
10931097
✅ Schema migrations complete
1094-
```
1098+
```
10951099

10961100
You can learn more about running migrator operations in helm in the [migrator operations doc](/admin/updates/migrator/migrator-operations#kubernetes-helm).
10971101

@@ -1101,15 +1105,15 @@ Now that the databases have been migrated to the latest versions, services can b
11011105

11021106
```sh
11031107
$ helm upgrade -n <your namespace> --install -f override.yaml --version <sourcegraph version> sourcegraph sourcegraph/sourcegraph
1104-
```
1108+
```
11051109

11061110
### Rollback
11071111

11081112
You can revert to a previous version with the following command:
11091113

11101114
```sh
11111115
$ helm rollback sourcegraph
1112-
````
1116+
```
11131117

11141118
If you are rolling back more than a single version, then you must also [roll back your database](/admin/how-to/rollback_database), as database migrations (which may have run at some point during the upgrade) are guaranteed to be compatible with one previous minor version.
11151119

@@ -1121,6 +1125,30 @@ In some situations, administrators may wish to migrate their databases before up
11211125

11221126
To execute the database migrations independently, you can use the [Sourcegraph Migrator] helm chart.
11231127

1128+
## Using Helm in restricted environment
1129+
1130+
Some customers may not be allowed to directly install applications from a remote Helm Registry. In these cases, you may choose to download the chart to inspect the content, then install it locally.
1131+
1132+
It's recommended to commit your charts in a VCS repo and namespace by versions:
1133+
1134+
```
1135+
charts/
1136+
sourcegraph-6.1.0/
1137+
sourcegraph-6.2.0/
1138+
```
1139+
1140+
Download and untar to a specific directory at `charts/sourcegraph-$VERSION`:
1141+
1142+
```sh
1143+
$ helm pull sourcegraph/sourcegraph --version $VERSION --untar -d charts/sourcegraph-$VERSION
1144+
```
1145+
1146+
Then, you can install the chart from the local directory:
1147+
1148+
```sh
1149+
$ helm upgrade --install sourcegraph charts/sourcegraph-$VERSION
1150+
```
1151+
11241152
## Reviewing Changes
11251153

11261154
When configuring an override file or performing an upgrade, we recommend reviewing the changes before applying them.

0 commit comments

Comments
 (0)