-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
203 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
--- | ||
title: Redict | ||
--- | ||
|
||
## Seamless migration between providers | ||
|
||
We have tested a seamless migration from Redis to Redict on our production | ||
deployment. To reproduce: | ||
|
||
1. We have deployed Redict to our production cluster. | ||
|
||
- Defaults have been changed to: | ||
|
||
```yaml | ||
with_redis: false | ||
with_redict: true | ||
``` | ||
These can be changed in their respective `vars/` files. | ||
|
||
- Run | ||
|
||
``` | ||
DEPLOYMENT=prod TAGS=redict make deploy | ||
``` | ||
|
||
2. Using remote shell and `redict-cli` run: | ||
|
||
```sh | ||
replicaof redis 6379 | ||
``` | ||
|
||
This converts the Redict instance into a read-only replica of the Redis. | ||
|
||
3. After the data exchange is done, change **all** references in variables to | ||
redis to point to the new hostname, in this case `redis → redict`. | ||
|
||
- Run | ||
|
||
``` | ||
DEPLOYMENT=prod TAGS=packit-service-beat,fedmsg,packit-worker,packit-service make deploy | ||
``` | ||
|
||
4. Simultaneously run the deployment with the changed hostnames and via | ||
`redict-cli` run: | ||
|
||
```sh | ||
replicaof no one | ||
``` | ||
|
||
to make the redict deployment the primary one. | ||
|
||
5. (optional) For safety reasons and easier rollback, it's possible to convert | ||
the former Redis deployment into a replica of Redict, just in case it needs | ||
to be reverted without loss of data. For this you can run in `redis-cli`: | ||
|
||
```sh | ||
replicaof redict 6379 | ||
``` | ||
|
||
:::warning References to Redis | ||
|
||
Redis is being referenced from: | ||
|
||
- `packit-service` (API endpoint) | ||
- `packit-service-fedmsg` (Fedora Messaging listener) | ||
- `packit-service-beat` (triggers periodic tasks) | ||
- `packit-worker` (runs the jobs provided by API, Fedora Messaging and “beat”) | ||
- `flower` (monitoring of the Celery queues) | ||
|
||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# Copyright Contributors to the Packit project. | ||
# SPDX-License-Identifier: MIT | ||
|
||
--- | ||
kind: Deployment | ||
apiVersion: apps/v1 | ||
metadata: | ||
name: redict | ||
spec: | ||
selector: | ||
matchLabels: | ||
component: redict | ||
template: | ||
metadata: | ||
labels: | ||
component: redict | ||
{% if managed_platform %} | ||
paas.redhat.com/appcode: {{ appcode }} | ||
{% endif %} | ||
spec: | ||
containers: | ||
- name: redict | ||
image: registry.redict.io/redict:7 | ||
ports: | ||
- containerPort: 6379 | ||
volumeMounts: | ||
- mountPath: /data | ||
name: redict-pv | ||
resources: | ||
# requests and limits have to be the same to have Guaranteed QoS | ||
requests: | ||
memory: "128Mi" | ||
cpu: "10m" | ||
limits: | ||
memory: "256Mi" | ||
cpu: "10m" | ||
volumes: | ||
- name: redict-pv | ||
persistentVolumeClaim: | ||
claimName: redict-pvc | ||
replicas: 1 | ||
strategy: | ||
type: Recreate | ||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: redict | ||
{% if managed_platform %} | ||
labels: | ||
paas.redhat.com/appcode: {{ appcode }} | ||
{% endif %} | ||
spec: | ||
ports: | ||
- name: "6379" | ||
port: 6379 | ||
targetPort: 6379 | ||
selector: | ||
component: redict | ||
--- | ||
apiVersion: v1 | ||
kind: PersistentVolumeClaim | ||
metadata: | ||
name: redict-pvc | ||
{% if managed_platform %} | ||
labels: | ||
paas.redhat.com/appcode: {{ appcode }} | ||
annotations: | ||
kubernetes.io/reclaimPolicy: Delete | ||
{% endif %} | ||
spec: | ||
accessModes: | ||
- ReadWriteOnce | ||
resources: | ||
requests: | ||
storage: 1Gi | ||
{% if managed_platform %} | ||
storageClassName: aws-ebs | ||
{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters