Connect to an In-Memory DB Instance from the Kubernetes Cluster
This topic describes connecting to the In-Memory DB instance from your managed Kubernetes cluster.
Prerequisites
Ensure that the following are available before connecting to the In-Memory DB instance:
A datacenter with the following
id
:xyz-my-datacenter
.A private LAN with
id 3
using the network10.1.1.0/24
.A database connected to
LAN 3
with the following IP address:10.1.1.5/24
.A Kubernetes cluster with the following
id
:xyz-my-cluster
.
Connect to the In-Memory DB Instance from the cluster
In the following example, DHCP is used to assign IP addresses to node pools. Therefore, the database must be in the same subnet as the DHCP server.
To enable connectivity, follow these steps:
Connect node pools to the private LAN, which is connected to the database:
Note: It may take a while for the node pool to be ready.
Create a pod to test the connectivity. Schedule the pod exclusively for the node pools connected to the additional LAN if you have several node pools.
Alternatively, you can also use the following commands:
Create the pod using either of these commands:
kubectl run redis-client --rm -it --image=redis -- /bin/bash
orkubectl apply -f pod.yaml
Attach the pod and test connectivity:
Prerequisites:
— Ensure that the connectivity-test
pod already exists and that the node pool on which it is running has the same private LAN attached as the In-Memory DB instance.
— To establish a secure connection via the TLS, the --tls
and --cacert
command line options must be passed to the redis-cli
.
Result: The database starts accepting connections.
Last updated