Using a Redis key-value NoSQL database
Now it’s time to use Redis as our key-value database. Redis is a nice key-value database that doesn’t consume many resources. All its data is stored in memory. It has very interesting types of data such as hash keys, lists, and sets. It also implements publisher-subscriber and streaming features to implement channels of communication and simple broker functionalities. For our Redis deployment, we are going to use a custom configuration to set the password for Redis, and a storage volume to prevent losing data. To use Redis in your cluster, follow the next steps:
- Create the ConfigMap to use a custom configuration with the password
K3s123-
and the/data
directory to store Redis data:$ cat <<EOF | kubectl apply -f - apiVersion: v1 kind: ConfigMap metadata: name: redis-configmap data: redis-config: | dir /data requirepass YOUR_PASSWORD EOF
- Create...