Local Redis
Redis, an advanced key-value store, offers a fast and efficient solution for managing data in-memory. Use Redis for applications that require rapid access to cached information, real-time analytics, and message brokering. Redis supports a variety of data structures, including strings, hashes, lists, sets, and more. You can model and manipulate data based on your specific requirements.
Configure Aembit to work with Redis as a Server Workload using the Redis-compatible CLI, application, or a library. Note that Aembit doesn’t support the Redis inline command format.
Prerequisites
Section titled “Prerequisites”- Access to a Kubernetes cluster
Edit and deploy the Redis YAML file
Section titled “Edit and deploy the Redis YAML file”Edit this example file according to your specific configurations and then deploy it to your Kubernetes cluster.
apiVersion: apps/v1kind: Deploymentmetadata: name: redisspec: replicas: 1 selector: matchLabels: app: redis strategy: type: Recreate template: metadata: labels: app: redis spec: containers: - name: redis image: redis imagePullPolicy: Always ports: - containerPort: 6379 name: redis env: - name: MASTER value: "true" - name: REDIS_USER value: "<master user name>" - name: REDIS_PASSWORD value: "<master password>"---# ServiceapiVersion: v1kind: Servicemetadata: name: redisspec: type: NodePort selector: app: redis ports: - port: 6379 targetPort: 6379Deploy this file to your Kubernetes cluster:
kubectl apply -f ./redis.yaml
Configure the Server Workload
Section titled “Configure the Server Workload”-
Create a new Server Workload:
- Name - Choose a user-friendly name.
-
Configure the service endpoint:
- Host -
redis.default.svc.cluster.local - Application Protocol - Redis
- Port - 6379
- Forward to Port - 6379
- Authentication method - Password Authentication
- Authentication scheme - Password
- Host -
Configure the Credential Provider
Section titled “Configure the Credential Provider”-
Create a new Credential Provider:
- Name - Choose a user-friendly name.
- Credential Type - Username & Password
- Username - Provide the login ID for the Redis master user.
- Password - Provide the master password associated with the Redis credentials.
Configure the Client Workload
Section titled “Configure the Client Workload”Aembit handles the credentials required to access the Server Workload. You can remove any previously used credentials from the Client Workload.
If you access the Server Workload through an SDK or library, it may still require credentials for initialization. Provide placeholder credentials, as Aembit overwrites them during the access process.
Create an Access Policy
Section titled “Create an Access Policy”Create an Access Policy for a Client Workload to access the Redis Server Workload. Assign the newly created Credential Provider to it.