-
Notifications
You must be signed in to change notification settings - Fork 1
[DPE-9311] Initial user documentation #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
90f358c
add README
reneradoi 885ba77
add tutorial
reneradoi 09f28d5
pin `myst-parser` to avoid version conflicts in sphinx starter pack
reneradoi 53e2519
add How-to documentation for deployment, scaling, managing credential…
reneradoi 4990baa
add section for updating multiple passwords at once
reneradoi 87d6f7f
fix linkcheck and spelling
reneradoi 2620c67
update contacts
reneradoi ddb3b4c
PR feedback
reneradoi 26344e4
update README
reneradoi 3655e37
add section about auto-generated credentials
reneradoi 71708f9
add information about connecting to Valkey via DNS names
reneradoi 38e5d76
add section about peer TLS to TLS How-To
reneradoi 1dee2b4
add information about dual substrate use for deployment
reneradoi 85cf70e
fix invalid links in index.md
reneradoi 248010d
Merge remote-tracking branch 'origin/9/edge' into initial-docs
reneradoi 7391ff8
Trigger a PR preview build
izmalk f941576
PR feedback
reneradoi 8a66110
PR feedback
reneradoi 1acabad
remove terminal blocks again
reneradoi 2f10a4b
Merge branch '9/edge' into initial-docs
reneradoi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,86 @@ | ||
| ## Valkey operator | ||
| [](https://charmhub.io/valkey) | ||
| [](https://app.readthedocs.com/projects/canonical-charmed-valkey/builds/?version__slug=latest) | ||
|
|
||
| Charmed Valkey is an open-source Juju charm that will automate the deployment, | ||
| scaling, configuration and operations of Valkey databases across clouds, virtual | ||
| machines and bare metal, using the Juju orchestration framework. | ||
|
|
||
| [Valkey](https://valkey.io) is a community-driven, open-source, high-performance | ||
| key-value data store compatible with Redis® clients and ecosystem tooling. | ||
|
|
||
| The charm can be deployed on Kubernetes and VM clouds and aims to simplify Valkey | ||
| operations from [Day 0 to Day 2](https://codilime.com/blog/day-0-day-1-day-2-the-software-lifecycle-in-the-cloud-age/), | ||
| offering secure defaults integration interfaces, and lifecycle automation. | ||
|
|
||
| ## Basic usage | ||
|
|
||
| Bootstrap a [MicroK8s controller](https://documentation.ubuntu.com/juju/3.6/tutorial/#set-up-a-juju-controller) | ||
| and create a new Juju model: | ||
|
|
||
| ```shell | ||
| juju add-model sample-model | ||
| ``` | ||
|
|
||
| To deploy a single unit of Valkey, run the following command: | ||
|
|
||
| ```shell | ||
| juju deploy valkey --channel 9/edge --trust | ||
| ``` | ||
|
|
||
| To deploy Valkey with multiple units, specify the number of desired units with the `-n` option: | ||
|
|
||
| ```shell | ||
| juju deploy valkey -n 3 --channel 9/edge --trust | ||
| ``` | ||
|
|
||
| Valkey can be scaled out using the `juju add-unit` command: | ||
|
|
||
| ```shell | ||
| juju add-unit valkey -n <num_of_desired_units> | ||
| ``` | ||
|
|
||
| For example, to scale a deployment with three Valkey units to five, run: | ||
|
|
||
| ```shell | ||
| juju add-unit valkey -n 2 | ||
| ``` | ||
|
|
||
| Even when scaling multiple units at the same time, the charmed operator uses a rolling restart | ||
| sequence to make sure the cluster stays available and healthy during the operation. | ||
|
|
||
| ## Download details | ||
|
|
||
| Charmed Valkey is shipped in the track `9/edge`: [Valkey 9/edge](https://charmhub.io/valkey?channel=9/edge) | ||
|
|
||
| It is based on the following platform: | ||
| - Noble (Ubuntu 24.04) | ||
| - Supported architectures: `amd64`. | ||
|
|
||
| ## Documentation | ||
|
|
||
| The [charmed Valkey documentation](https://canonical-charmed-valkey.readthedocs-hosted.com) provides a | ||
| tutorial for basic usage, multiple how-to guides about operational topics, and detailed | ||
| information about supported interfaces and integrations. | ||
|
|
||
| ## Community and support | ||
|
|
||
| The charmed Valkey operator is an open-source project that welcomes community contributions, suggestions, | ||
| fixes and constructive feedback. | ||
|
|
||
| - Report [issues](https://github.com/canonical/valkey-operator/issues) | ||
| - [Contact us on Matrix](https://matrix.to/#/#charmhub-data-platform:ubuntu.com) | ||
| - Explore [Canonical Data & AI solutions](https://canonical.com/data) | ||
|
|
||
| Charmed Valkey is covered by the [Ubuntu Code of | ||
| Conduct](https://ubuntu.com/community/ethos/code-of-conduct). | ||
|
|
||
| ## Contributing | ||
|
|
||
| Please see the [Juju docs](https://documentation.ubuntu.com/juju/3.6/howto/manage-applications/) for | ||
| guidelines and best practices, and the [contribution guide](CONTRIBUTING.md) for developer guidance. | ||
|
|
||
| ## License and copyright | ||
|
|
||
| Charmed Valkey is free software, distributed under the Apache Software License, version 2.0. | ||
| See [LICENSE](LICENSE) for more information. |
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -70,3 +70,4 @@ docstrings? | |
| Makefile | ||
| retrigger(ing)? | ||
| Valkey | ||
| failover | ||
This file contains hidden or 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,28 @@ | ||
| # How to deploy | ||
|
|
||
| This guide provides deployment instructions for Charmed Valkey. It supports both | ||
| Kubernetes and VM clouds and can be deployed seamless on both substrates. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| The basic requirements for deploying a charm are the [**Juju client**](https://documentation.ubuntu.com/juju/3.6/) | ||
|
reneradoi marked this conversation as resolved.
|
||
| and a [**cloud**](https://juju.is/docs/juju/cloud). | ||
|
|
||
| ## Setup | ||
|
|
||
| First, [bootstrap](https://juju.is/docs/juju/juju-bootstrap) the cloud controller | ||
| and create a [model](https://canonical-juju.readthedocs-hosted.com/en/latest/user/reference/model/): | ||
|
|
||
| ```shell | ||
| juju bootstrap <cloud name> <controller name> | ||
| juju add-model <model name> | ||
| ``` | ||
|
|
||
| Then, use the [`juju deploy`](https://canonical-juju.readthedocs-hosted.com/en/latest/user/reference/juju-cli/list-of-juju-cli-commands/deploy/) command: | ||
|
|
||
| ```shell | ||
| juju deploy valkey --channel 9/edge -n <number_of_replicas> --trust | ||
|
reneradoi marked this conversation as resolved.
|
||
| ``` | ||
|
reneradoi marked this conversation as resolved.
|
||
|
|
||
| If you are not sure where to start or would like a more guided walk through for | ||
| setting up your environment, see the {ref}`tutorial`. | ||
This file contains hidden or 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,13 @@ | ||
| # How-to guides | ||
|
|
||
|
reneradoi marked this conversation as resolved.
|
||
| These guides accompany you through the operations lifecycle of Charmed Valkey. | ||
|
|
||
| ```{toctree} | ||
| :titlesonly: | ||
| :maxdepth: 2 | ||
|
|
||
| Deploy <deploy> | ||
| Scale horizontally <scale-horizontally> | ||
| Manage passwords <manage-passwords> | ||
| TLS encryption <tls> | ||
| ``` | ||
This file contains hidden or 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,138 @@ | ||
| # How to manage passwords | ||
|
|
||
| This guide provides instructions for creating, updating, and otherwise managing passwords. | ||
|
|
||
| To read or write data in Valkey, we need to authenticate ourselves. | ||
|
|
||
|
reneradoi marked this conversation as resolved.
|
||
| For this guide, we will use Charmed {spellexception}`Valkey's` internal admin user | ||
| `charmed-operator`. This user is only for internal use, and it is created automatically | ||
|
izmalk marked this conversation as resolved.
|
||
| by Charmed Valkey. | ||
|
|
||
| We will go through setting a user-defined password for this admin user and configuring | ||
| Valkey. | ||
|
|
||
| ## Auto-generated credentials | ||
|
|
||
| For security purposes, Charmed Valkey automatically generates users and passwords | ||
| for its operations and internal administration tasks. These credentials are stored | ||
| in a Juju secret owned by the charm. Inspect the secret: | ||
|
|
||
| ```shell | ||
| juju show-secret valkey-peers.valkey.app.internal_users_secret --reveal | ||
| ``` | ||
|
|
||
| ```{caution} | ||
| This secret is only for internal use. It must not be updated by users. | ||
| ``` | ||
|
|
||
| To override the auto-generated passwords for the internal users, follow the instructions | ||
| of the next section. | ||
|
|
||
| ## Configure a user-provided password | ||
|
|
||
| First, create a secret in `Juju` containing your password: | ||
|
|
||
| ```shell | ||
| juju add-secret passwords charmed-operator=<NEW_PASSWORD> | ||
| ``` | ||
|
|
||
| You will get the `secret` ID as a response: | ||
|
|
||
| ```text | ||
| secret:d6s4mr7mp25c765ucep0 | ||
| ``` | ||
|
|
||
| Make note of the string following `secret:`. | ||
|
|
||
| Grant the secret to Charmed Valkey: | ||
|
|
||
| ```shell | ||
| juju grant-secret passwords valkey | ||
| ``` | ||
|
|
||
| Configure the secret's URI as `system-users` credentials to Charmed Valkey: | ||
|
|
||
| ```shell | ||
| juju config valkey system-users=secret:d6s4mr7mp25c765ucep0 | ||
| ``` | ||
|
|
||
| Charmed Valkey will now apply the new password to its internal admin user. You can | ||
| check the progress by running `juju status`. After a few moments, the deployment will settle: | ||
|
|
||
| ```text | ||
| Model Controller Cloud/Region Version SLA Timestamp | ||
| tutorial k8s-controller microk8s/localhost 3.6.14 unsupported 19:28:26+01:00 | ||
|
|
||
| App Version Status Scale Charm Channel Rev Address Exposed Message | ||
| self-signed-certificates active 1 self-signed-certificates 1/stable 586 10.152.183.111 no | ||
| valkey active 3 valkey 9/edge 11 10.152.183.123 no | ||
|
|
||
| Unit Workload Agent Address Ports Message | ||
| self-signed-certificates/0* active idle 10.1.44.89 | ||
| valkey/0* active idle 10.1.44.126 | ||
| valkey/1 active idle 10.1.44.117 | ||
| valkey/2 active idle 10.1.44.127 | ||
| ``` | ||
|
|
||
| Now you can use the password to access Valkey. Select the IP address for one of the units to connect to: | ||
|
|
||
|
reneradoi marked this conversation as resolved.
|
||
| ```shell | ||
| valkey-cli -h 10.1.44.126 -p 6379 | ||
| ``` | ||
|
|
||
| Authenticate with the username and password you just configured: | ||
|
|
||
| ```text | ||
| 10.1.44.126:6379> AUTH charmed-operator <NEW_PASSWORD> | ||
| ``` | ||
|
|
||
| Check the current health of the server with this command: | ||
|
|
||
| ```text | ||
| 10.1.44.126:6379> ping | ||
| ``` | ||
|
|
||
| ## Update the password | ||
|
|
||
| To update your user-configured password, simply update the value of the secret. Here's an example: | ||
|
|
||
| ```shell | ||
| juju update-secret passwords charmed-operator=<MORE_SECURE_PASSWORD> | ||
| ``` | ||
|
|
||
| After running this command, Charmed Valkey will immediately update the password. | ||
| Once the deployment has settled to `active`/`idle` state again, you can no longer use | ||
| the old password to access Valkey. Instead, you will receive an error similar to this: | ||
|
|
||
| ```text | ||
| (error) WRONGPASS invalid username-password pair or user is disabled. | ||
| ``` | ||
|
|
||
| Instead, use your updated password to authenticate: | ||
|
|
||
| ```text | ||
| 10.1.44.126:6379> AUTH charmed-operator moresecurepassword | ||
| ``` | ||
|
|
||
| ## Handle multiple passwords | ||
|
|
||
| Charmed Valkey maintains multiple internal users with different permissions for | ||
| different scopes: | ||
|
|
||
| * `charmed-operator`: the user that manages the database instances | ||
|
reneradoi marked this conversation as resolved.
|
||
| * `charmed-replication`: the user performs replication between primary and replica instances of Valkey | ||
| * `charmed-sentinel-operator`: the user that manages Sentinel for Valkey | ||
| * `charmed-sentinel-peers`: the user for communication between Sentinel instances | ||
| * `charmed-sentinel-valkey`: the user that Sentinel uses to connect to Valkey | ||
| * `charmed-stats`: the user for monitoring and observability | ||
|
|
||
| It is possible to manage the passwords for all of above's users with a Juju secret, | ||
| or just for some of them. | ||
|
|
||
| To set the password for the `charmed-operator` and `charmed-sentinel-operator` users, | ||
| but keeping the automatically generated passwords for all other users, run the following | ||
| command: | ||
|
|
||
| ```shell | ||
| juju update-secret passwords charmed-operator=<MORE_SECURE_PASSWORD> charmed-sentinel-operator=<SENTINEL_PASSWORD> | ||
| ``` | ||
This file contains hidden or 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,69 @@ | ||
| # How to scale horizontally | ||
|
|
||
| Horizontal scaling of a Valkey deployment is done by adding and removing [Juju units](https://juju.is/docs/juju/unit). | ||
|
|
||
| ## Add a unit | ||
|
|
||
| To add additional units to your deployed Valkey application, run the following command: | ||
|
|
||
| ```shell | ||
| juju add-unit valkey -n 1 | ||
|
izmalk marked this conversation as resolved.
|
||
| ``` | ||
|
|
||
| Where `-n 1` specifies the number of units to add. | ||
|
|
||
| You can now watch the new unit join the deployment with `watch juju status`. | ||
| It usually takes a few minutes for a unit to be added to an existing deployment. | ||
|
|
||
| ```text | ||
| Model Controller Cloud/Region Version SLA Timestamp | ||
| tutorial k8s-controller microk8s/localhost 3.6.14 unsupported 19:21:12+01:00 | ||
|
|
||
| App Version Status Scale Charm Channel Rev Address Exposed Message | ||
| self-signed-certificates active 1 self-signed-certificates 1/stable 586 10.152.183.111 no | ||
| valkey active 4 valkey 9/edge 11 10.152.183.123 no | ||
|
|
||
| Unit Workload Agent Address Ports Message | ||
| self-signed-certificates/0* active idle 10.1.44.89 | ||
| valkey/0* active idle 10.1.44.126 | ||
| valkey/1 active idle 10.1.44.117 | ||
| valkey/2 active idle 10.1.44.127 | ||
| valkey/3 active idle 10.1.44.68 | ||
| ``` | ||
|
|
||
| ### Remove units | ||
|
|
||
| Removing a unit from the application scales down the application. If you currently have | ||
| four units, then only one is the primary and three are replicas. Removing a unit will reduce the | ||
| number of replicas to two and the total number of units to three. | ||
|
|
||
| Before scaling down, list all the units with `juju status`: | ||
|
|
||
| * `valkey/0` | ||
| * `valkey/1` | ||
| * `valkey/2` | ||
| * `valkey/3` | ||
|
|
||
| To scale the application down to three units, run: | ||
|
|
||
| ```shell | ||
| juju remove-unit valkey --num-units 1 | ||
| ``` | ||
|
|
||
| Safely removing the unit will take a few moments. You’ll know that the unit was | ||
| successfully removed when `juju status` reports all units `active`/`idle` again: | ||
|
|
||
| ```text | ||
| Model Controller Cloud/Region Version SLA Timestamp | ||
| tutorial k8s-controller microk8s/localhost 3.6.14 unsupported 19:23:44+01:00 | ||
|
|
||
| App Version Status Scale Charm Channel Rev Address Exposed Message | ||
| self-signed-certificates active 1 self-signed-certificates 1/stable 586 10.152.183.111 no | ||
| valkey active 3 valkey 9/edge 11 10.152.183.123 no | ||
|
|
||
| Unit Workload Agent Address Ports Message | ||
| self-signed-certificates/0* active idle 10.1.44.89 | ||
| valkey/0* active idle 10.1.44.126 | ||
| valkey/1 active idle 10.1.44.117 | ||
| valkey/2 active idle 10.1.44.127 | ||
| ``` | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.