Skip to content

Commit 65df1db

Browse files
Merge pull request #106 from packagist/add-clear-redis-cache
SelfHosted: Explain how to clear Redis cache
2 parents f0b3dbc + 325fa9d commit 65df1db

File tree

3 files changed

+68
-11
lines changed

3 files changed

+68
-11
lines changed
Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
11
# Maintenance
22
## Private Packagist Self-Hosted (Kubernetes)
33

4+
## kURL installations
5+
46
### Updates
57

8+
This section describes how to update a Private Packagist Self-Hosted in a Kubernetes cluster installed with [kURL](kubernetes-embedded).
9+
This section is not relevant if you installed the application with [Helm](kubernetes-helm).
10+
611
By default Replicated checks for updates every 4 hours and you can install updates from the dashboard in the Replicated
712
Management Console on port 8800 once they are available.
813
You can configure this behavior under “Configure automatic updates” on the dashboard.
914

1015
The [Private Packagist Self-Hosted Changelog](https://packagist.com/docs/self-hosted/changelog) details all new features,
1116
behavior changes and major bugfixes each release introduces.
1217

18+
You can safely bump multiple versions at once, it's not required to install individual versions consecutively. If we ever
19+
release a version that needs to be installed specifically, we will make sure to communicate this first.
20+
21+
We recommend backing up your database before each update. We cannot guarantee that downgrading to a previous release will always work
22+
due to database migrations. In case of upgrade failure, the most reliable way to rollback to the previous version is via a snapshot.
23+
1324
New versions that ask you to upgrade KOTS (Kubernetes Off-The-Shelf), the Replicated tool used to distribute Private Packagist,
1425
require that you download and rerun the install script via the command below.
1526

@@ -22,19 +33,27 @@ Private Packagist and the Replicated Management Console will become temporarily
2233
curl -sSL https://k8s.kurl.sh/privatepackagistkots | bash -s
2334
```
2435

25-
#### Update KOTS for Private Packagist Self-Hosted Kubernetes in an existing cluster
36+
### Update or replace the SSL certificate
2637

27-
```
28-
curl https://kots.io/install | bash
29-
kubectl kots admin-console upgrade -n NAMESPACE
30-
```
38+
To update or replace the certificate, you must first restore the ability to upload new TLS certificates and then reupload
39+
the certificate through the user interface. Please refer to the
40+
[Replicated documentation](https://docs.replicated.com/enterprise/updating-tls-cert#update-custom-tls-certificates)
41+
for detailed instructions.
3142

32-
Replace `NAMESPACE` with the namespace in your cluster where KOTS is installed.
43+
## Helm installations
3344

34-
### Update or replace the SSL certificate
45+
### Updates
3546

36-
To update or replace the certificate, you must first restore the ability to upload new TLS certificates and then reupload
37-
the certificate through the user interface. Please refer to the
38-
[Replicated documentation](https://docs.replicated.com/enterprise/updating-tls-cert#update-custom-tls-certificates)
39-
for detailed instructions.
47+
If you installed Private Packagist Self-Hosted with Helm into your existing cluster, you can update the application with the command
48+
below. Make sure to compare your existing `values.yaml` file to the [current one](http://packagist.com.lo/docs/self-hosted/kubernetes-helm#annotated-configuration) first.
49+
50+
```
51+
helm upgrade -f values.yaml private-packagist oci://registry.replicated.com/privatepackagistkots/private-packagist --version VERSION
52+
```
53+
54+
You can find the latest version in the [changelog](changelog). You can safely bump multiple versions at once, it's not required to
55+
install individual versions consecutively. If we ever release a version that needs to be installed specifically,
56+
we will make sure to communicate this first.
4057

58+
We recommend backing up your database before each update. We cannot guarantee that downgrading to a previous release will always work
59+
due to database migrations. In case of upgrade failure, the most reliable way to rollback to the previous version is via backup.

docs/self-hosted/kubernetes-migration-guide.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,3 +188,24 @@ Ideally, run a `composer update` command in one of your projects to assert that
188188

189189
In case you initially set up Private Packagist Self-Hosted Kubernetes with a different domain name, you can now edit the
190190
domain names in the admin panel. If necessary, adjust your DNS entries, and shut down the old Private Packagist Self-Hosted instance.
191+
192+
### Clear the cache
193+
194+
The final step is to clear the Composer endpoint cache. If you are not using the built-in Redis database, check your internal documentation how to connect to the Redis instance.
195+
196+
**Important:** Please note that there are multiple databases created in your Redis instance, and that Redis is not solely used for caching.
197+
Be careful not to flush any of the other migrated databases.
198+
199+
```
200+
kubectl exec -it redis-0 -- redis-cli -p 9869
201+
select 5
202+
flushdb
203+
```
204+
205+
### Update Composer projects
206+
207+
Update the Composer projects that use your self-hosted Private Packagist instance to make sure all repository references are up-to-date:
208+
209+
```
210+
composer update mirrors
211+
```

docs/self-hosted/kubernetes-troubleshooting.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,4 +60,21 @@ proxy_ssl_server_name on;
6060
If you are using different hostnames on the upstream and on the reverse-proxy, set the value in the
6161
`proxy_ssl_name` directive to the corresponding hostname of the upstream server.
6262

63+
#### Issues after changing the Private Packagist Self-Hosted domain name
64+
65+
If you've changed the domain name used to access your Private Packagist Self-Hosted Kubernetes installation, you'll need to clear the Composer endpoint Redis cache.
66+
67+
**Important:** Please note that there are multiple databases created in your Redis instance, and that Redis is not solely used for caching.
68+
Be careful not to flush any of the other databases.
69+
70+
If you are not using the built-in Redis database, check your internal documentation how to connect to the Redis instance.
71+
72+
```
73+
kubectl exec -it redis-0 -- redis-cli -p 9869
74+
select 5
75+
flushdb
76+
```
77+
78+
Afterwards, run `composer update mirrors` to make sure all repository references are up-to-date.
79+
6380

0 commit comments

Comments
 (0)