diff --git a/config.toml b/config.toml index 20b1617..b3f4c2e 100644 --- a/config.toml +++ b/config.toml @@ -5,7 +5,7 @@ compile_sass = true build_search_index = true -generate_feed = true +generate_feeds = true [markdown] highlight_code = true diff --git a/content/authors/rafariossaa.md b/content/authors/rafariossaa.md new file mode 100644 index 0000000..162e2e4 --- /dev/null +++ b/content/authors/rafariossaa.md @@ -0,0 +1,10 @@ +--- +title: Rafael Ríos Saavedra +extra: + photo: '/assets/media/authors/rafariossaa.jpeg' + github: rafariossaa +--- + +Rafael is an Engineer part of the Tanzu Application Catalog team at VMware by Broadcom. He started as a System Engineer and over the last few years he became part of the Bitnami family, creating new assets and bringing his expertise to the team. + +In his spare time, Rafael enjoys learning new things, 3D printing, electronics and tinkering with whatever he can get his hands on. diff --git a/content/blog/2024-06-27-using-bitnami-valkey-chart/images/using-bitnami-valkey-chart_1.png b/content/blog/2024-06-27-using-bitnami-valkey-chart/images/using-bitnami-valkey-chart_1.png new file mode 100644 index 0000000..d275a0c Binary files /dev/null and b/content/blog/2024-06-27-using-bitnami-valkey-chart/images/using-bitnami-valkey-chart_1.png differ diff --git a/content/blog/2024-06-27-using-bitnami-valkey-chart/images/using-bitnami-valkey-chart_2.png b/content/blog/2024-06-27-using-bitnami-valkey-chart/images/using-bitnami-valkey-chart_2.png new file mode 100644 index 0000000..56d7235 Binary files /dev/null and b/content/blog/2024-06-27-using-bitnami-valkey-chart/images/using-bitnami-valkey-chart_2.png differ diff --git a/content/blog/2024-06-27-using-bitnami-valkey-chart/images/using-bitnami-valkey-chart_3.png b/content/blog/2024-06-27-using-bitnami-valkey-chart/images/using-bitnami-valkey-chart_3.png new file mode 100644 index 0000000..eff32ea Binary files /dev/null and b/content/blog/2024-06-27-using-bitnami-valkey-chart/images/using-bitnami-valkey-chart_3.png differ diff --git a/content/blog/2024-06-27-using-bitnami-valkey-chart/images/using-bitnami-valkey-chart_4.png b/content/blog/2024-06-27-using-bitnami-valkey-chart/images/using-bitnami-valkey-chart_4.png new file mode 100644 index 0000000..5fc0bbd Binary files /dev/null and b/content/blog/2024-06-27-using-bitnami-valkey-chart/images/using-bitnami-valkey-chart_4.png differ diff --git a/content/blog/2024-06-27-using-bitnami-valkey-chart/index.md b/content/blog/2024-06-27-using-bitnami-valkey-chart/index.md new file mode 100644 index 0000000..1c23d42 --- /dev/null +++ b/content/blog/2024-06-27-using-bitnami-valkey-chart/index.md @@ -0,0 +1,187 @@ ++++ +title="Using Bitnami's Valkey chart" +date=2024-07-09 01:01:01 +description="An introductory example using Bitnami's Valkey chart" +aliases= [ + "/blog/2024/06/using-bitnami-valkey-chart/" +] +authors=["rafariossaa"] ++++ + +Valkey is a high-performance key/value datastore that supports workloads such as caching, and message queues, supporting many data types including strings, numbers, hashes, bitmaps, and more. Valkey can run in standalone or cluster mode for replication and high availability. + +[Bitnami](https://bitnami.com/) offers a number of secure, up-to-date, and easy to deploy charts for a number of popular open source applications. + +This blog will serve as a walk-through on how you can deploy and use the [Bitnami Helm chart for Valkey](https://github.com/bitnami/charts/tree/main/bitnami/valkey). + +# Assumptions and prerequisites + +Before starting the deployment, make sure that you have the following prerequisites: +- An operational Kubernetes cluster. +- An installed and configured kubectl CLI and Helm v3.x package manager. If you need help with these steps, check our article “[Learn how to install kubectl and Helm v3.x.](https://docs.bitnami.com/kubernetes/get-started-kubernetes#step-3-install-kubectl-command-line)” +- Optional: Access to [VMware Tanzu Application Catalog](https://app-catalog.vmware.com/catalog). + +# Deploying the Bitnami package for the Valkey Helm chart + +The sections below describe the steps to configure the deployment, get and deploy the Bitnami-package Valkey Helm chart, and obtain its external IP address to access the service. + +## Getting and deploying the Bitnami package for Valkey Helm chart + +You can deploy the the [community](https://github.com/bitnami/charts/blob/main/LICENSE.md) Bitnami-packaged Valkey Helm chart from the open source Bitnami Application Catalog. Alternatively, if you have access to an enterprise Tanzu Application Catalog instance, it can also be deployed from there. + +### Deploying the open source version of the chart through Bitnami Application Catalog + +To deploy the chart in its namespace, run the following commands: + +```bash +$ kubectl create namespace valkey +$ helm install myvalkey oci://registry-1.docker.io/bitnamicharts/valkey --set auth.enabled=true --set auth.password=test_pwd --namespace valkey +``` + +### Deploying the enterprise version of the chart through Tanzu Application Catalog + +The following steps describe navigating the Tanzu Application Catalog and getting the instructions to deploy Valkey in your cluster. This example shows a Valkey chart built using Ubuntu 22 as the base OS image, but feel free to customize the chart depending on your needs. + +1. Navigate to [app-catalog.vmware.com](https://app-catalog.vmware.com) and sign in to your catalog with your VMware account. +![Tanzu Library](images/using-bitnami-valkey-chart_1.png) +3. In the My Applications section, search for Valkey and request it for your catalog. It is supported by Photon, Ubuntu, RHEL UBI, and Debian Linux distributions. On the next screen, you will find the instructions for deploying the chart on your cluster. Make sure that your cluster is up and running. +4. Execute **kubectl cluster-info**, then run the commands you will find in the Consume your Helm chart section. + +![Tanzu Application Catalog](images/using-bitnami-valkey-chart_2.png) + +![Bitnami Package Content](images/using-bitnami-valkey-chart_3.png) + +After this, the steps for deploying the chart will be the same as the ones described in the following sections to deploy its community version. + +## Obtaining the external IP address and logging into Valkey + +Wait for the deployment to complete and check that all *myvalkey* pods are Running. + +```bash +$ kubectl get pods,svc -n valkey +NAME READY STATUS RESTARTS AGE +pod/myvalkey-master-0 1/1 Running 0 4m41s +pod/myvalkey-replicas-0 1/1 Running 0 4m41s +pod/myvalkey-replicas-1 1/1 Running 0 3m59s +pod/myvalkey-replicas-2 1/1 Running 0 3m32s + +NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE +service/myvalkey-headless ClusterIP None 6379/TCP 4m41s +service/myvalkey-master ClusterIP 10.110.225.33 6379/TCP 4m41s +service/myvalkey-replicas ClusterIP 10.98.176.69 6379/TCP 4m41s +``` + +## Connecting using Valkey’s CLI client + +To connect to the server, you can deploy a client pod. + +```bash +$ export VALKEY_PASSWORD=test_pwd +$ kubectl run --namespace valkey valkey-client --restart='Never' --env VALKEY_PASSWORD=$VALKEY_PASSWORD --image docker.io/bitnami/valkey:7.2.5-debian-12-r5 --command -- sleep infinity +``` + +You are now ready to attach to the pod and interact with the server using the CLI client. + +```bash +$ kubectl exec --tty -i valkey-client --namespace valkey -- bash +$ REDISCLI_AUTH="$VALKEY_PASSWORD" valkey-cli -h myvalkey-master +myvalkey-master:6379> set test_key "test_value" +OK +myvalkey-master:6379> get test_key +"test_value" +``` + +## Using a Python environment + +The next example explains how to connect to Valkey using a Python script. To run the script, first, it is needed to provide a Python environment and install Python’s Redis package. + +```bash +$ kubectl run -it python-redis --image=bitnami/python -- bash +root@python-redis:/app# pip install redis +Collecting redis +Downloading redis-5.0.6-py3-none-any.whl.metadata (9.3 kB) +Downloading redis-5.0.6-py3-none-any.whl (252 kB) + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 252.0/252.0 kB 942.1 kB/s eta 0:00:00 +Installing collected packages: redis +Successfully installed redis-5.0.6 +``` + +You are now ready to run the script. + +```bash +root@python-redis:/app# python +Python 3.12.4 (main, Jun 7 2024, 04:30:17) [GCC 12.2.0] on linux +Type "help", "copyright", "credits" or "license" for more information. +>>> import redis +>>> creds_provider = redis.UsernamePasswordCredentialProvider("", "test_pwd") +>>> user_connection = redis.Redis(host="myvalkey-master.valkey", port=6379, credential_provider=creds_provider) +>>> +>>> user_connection.ping() +True +>>> +>>> user_connection.set('foo_key', 'bar') +True +>>> +>>> user_connection.get('foo_key') +b'bar' +>>> +>>> user_connection.hset('user-session:123', mapping={ +... 'name': 'John', +... "surname": 'Smith', +... "company": 'Redis', +... "age": 29 +... }) +4 +>>> +>>> user_connection.hgetall('user-session:123') +{b'name': b'John', b'surname': b'Smith', b'company': b'Redis', b'age': b'29'} +``` + +## Using Valkey as a cache for WordPress + +Valkey can also work as an object cache for a WordPress deployment. The following steps will show you how to set up this scenario. + +First, it is needed to create the configuration for the WordPress deployment, in this case, Valkey’s parameters and the user credential for the site administrator are set. + +```bash +$ cat > settings.yaml < 3306/TCP 74s +service/mywp-wordpress LoadBalancer 10.100.136.181 192.168.49.50 80:31116/TCP,443:31119/TCP 74s +``` + +Using the external IP, browse to the admin page and log in using the previously set credentials. + +You will be able to see the WordPress administrator UI where you can search for `Redis Object Cache` plugin, and then install and activate it. After enabling it, wait for some metrics to appear: + +![Redis Object Cache Metrics](images/using-bitnami-valkey-chart_4.png) + +This is only a drop in the bucket of what can be done with Valkey. Thereafter you could easily integrate Valkey into your projects. + +# Support and resources + +The Bitnami package for Valkey is available in both the community version, through the [Bitnami GitHub repository](https://github.com/bitnami/charts/tree/main/bitnami/valkey/#installing-the-chart), as well as the enterprise version, [Tanzu Application Catalog](https://app-catalog.vmware.com/catalog/f1242d16-218e-4773-8856-adcb2b2006e9/branch/1542f88a-71c4-42ed-b79c-89bd2063ac9a). Learn more about the differences between these two catalogs in this [blog post](https://tanzu.vmware.com/content/blog/open-source-vs-enterprise-edition-of-vmware-bitnami-application-catalog). + +To solve the problems you may have with the Bitnami community packages—including deployment support, operational support, and bug fixes—please open an issue in the Bitnami [Helm charts](https://github.com/bitnami/charts) or [containers](https://github.com/bitnami/containers) GitHub repositories. Also, if you want to contribute to the catalog, feel free to send us a [pull request](https://github.com/bitnami/containers/pulls), and the team will check it and guide you in the process for a successful merge. + +If you are interested in learning more about the Tanzu Application Catalog in general, check out the [product webpage](https://tanzu.vmware.com/application-catalog). diff --git a/static/assets/media/authors/rafariossaa.jpeg b/static/assets/media/authors/rafariossaa.jpeg new file mode 100644 index 0000000..4ea2f92 Binary files /dev/null and b/static/assets/media/authors/rafariossaa.jpeg differ