Use the CQL console to interact with the databases in your datacenter
Mission Control lets you use the CQL console in the UI to interact with the databases in your datacenter using the Cassandra Query Language (CQL). The CQL console is a web-based interface that provides a way to execute CQL commands and view the results.
You can use the CQL console to execute any supported CQL commands against your database, for example to create keyspaces or insert data. For a list of available commands, see the following documentation:
Connect to the CQL console
-
In the Mission Control UI navigation menu, select your project, and then select your database cluster.
-
Click CQL Console.
-
Select your datacenter from the list of available datacenters.
-
Enter your username and password.
cqlsh-pod
container
When you deploy a Mission Control cluster, Mission Control automatically creates a cqlsh-pod
.
This pod supports the CQL console in the Mission Control UI.
The cqlsh-pod
is a container that runs the cqlsh
utility, allowing you to interact with your database cluster using CQL commands.
The pod serves as the backend for the CQL console in the UI.
If needed, you can connect to the pod manually using kubectl exec
.
The pod includes the following labels:
-
app.kubernetes.io/name=cqlsh
-
app.kubernetes.io/part-of=missioncontrol
-
cassandra.datastax.com/datacenter=DATACENTER_NAME
-
missioncontrol.datastax.com/cluster-name=CLUSTER_NAME
-
missioncontrol.datastax.com/cluster-namespace=PROJECT_SLUG
-
pod-template-hash=POD_HASH
The Mission Control airgap bundle includes this image.
For non-airgap installations, Mission Control pulls this container through an authenticated proxy.
For a list of available container images and versions, see the Mission Control release notes.
DataStax doesn’t publish the cqlsh-pod
image on Docker Hub because the underlying code is proprietary.
Customize the CQLSH pod
You can fully customize the CQLSH pod using the podTemplateSpec
field in the MissionControlCluster
custom resource.
The Mission Control operator automatically merges your podTemplateSpec
configuration with its generated values.
To customize the CQLSH pod independently from other pods in your cluster, you can override the CQLSH pod configuration at the cluster level through the |
This means you can customize various aspects of the CQLSH pod, including:
-
Container image: Point to different image coordinates separately from other pods.
-
Resource management: Set
resources.requests
andresources.limits
to control CPU and memory allocation. -
Security hardening: Configure
securityContext
at both pod and container levels for enhanced security. -
Scheduling control: Use
nodeSelector
,affinity
, andtolerations
to control where the CQLSH pod is scheduled. -
Environment configuration: Add custom environment variables through the
env
field. -
Volume configuration: Mount additional volumes or configuration files as needed.
When customizing the CQLSH pod, ensure that:
|
The operator merges the podTemplateSpec
configuration with the operator-generated values, so you only need to specify the fields you want to customize.
The operator will handle the rest of the pod configuration automatically.
All CQLSH pods that Mission Control creates for this cluster use the cluster-level configuration.
Custom CQLSH pod configuration template
The following template customizes the CQLSH pod at the cluster level in your MissionControlCluster
specification.
Replace the placeholders with your own values:
apiVersion: missioncontrol.datastax.com/v1beta2
kind: MissionControlCluster
metadata:
name: CLUSTER_NAME
spec:
cqlsh:
podTemplateSpec:
spec:
containers:
- name: cqlsh
image: CUSTOM_IMAGE_REGISTRY/CUSTOM_CQLSH_IMAGE:TAG
resources:
requests:
memory: "MEMORY_REQUEST"
cpu: "CPU_REQUEST"
limits:
memory: "MEMORY_LIMIT"
cpu: "CPU_LIMIT"
env:
- name: CUSTOM_ENV_VAR_NAME
value: "CUSTOM_ENV_VAR_VALUE"
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: USER_ID
securityContext:
fsGroup: GROUP_ID
runAsGroup: GROUP_ID
runAsNonRoot: true
runAsUser: USER_ID
nodeSelector:
NODE_LABEL_KEY: "NODE_LABEL_VALUE"
tolerations:
- key: "TAINT_KEY"
operator: "Equal"
value: "TAINT_VALUE"
effect: "TAINT_EFFECT"
k8ssandra:
cassandra:
# ... rest of your cluster configuration
Field | Description | Value/Placeholder |
---|---|---|
|
API version for the |
|
|
Resource type |
|
|
The name of your |
|
|
Container name |
|
|
Specify a custom CQLSH image from your private registry |
|
|
Memory request for the container |
|
|
CPU request for the container |
|
|
Memory limit for the container |
|
|
CPU limit for the container |
|
|
Name of your custom environment variable |
|
|
Value for your custom environment variable |
|
|
Prevent privilege escalation |
|
|
Drop all capabilities |
|
|
Make root filesystem read-only |
|
|
Run as non-root user |
|
|
User ID for the container security context |
|
|
Group ID for the pod filesystem |
|
|
Group ID for the pod security context |
|
|
Run as non-root user |
|
|
User ID for the pod security context |
|
|
Control which nodes the CQLSH pod is scheduled on |
|
|
Key for the taint |
|
|
Taint operator |
|
|
Value for the taint |
|
|
Effect for the taint |
|
Download the CQL command line shell
You can download the CQL command line shell (cqlsh
) utility on your local machine to interact with your database cluster using CQL commands outside of the Mission Control UI.
To download the cqlsh
utility from the Mission Control UI, do the following:
-
In the Mission Control UI navigation menu, select your project, and then select your database cluster.
-
Click CQL Console.
-
Click Download Command Line Shell. The DataStax downloads page opens in a new browser tab.
-
Select your database Version from the list of available versions, and then select the option to agree to the terms of the license agreement.
-
Click Download. Your browser downloads the
cqlsh
package to your local machine. -
Start the
cqlsh
tool. For more information, see the following documentation for starting thecqlsh
tool: