Use the CQL console to interact with the databases in your datacenter
The Mission Control UI includes a CQL console, which is an embedded CQL shell (cqlsh) interface.
Use the CQL console to interact with your databases using Cassandra Query Language (CQL) commands and cqlsh commands.
You can use the CQL console to execute any CQL and cqlsh commands that are supported for your database platform.
For example, you can create keyspaces, insert data, and query data.
For a list of available commands, see the following documentation:
-
Hyper-Converged Database (HCD): HCD CQL shell commands reference and HCD CQL commands reference.
-
DataStax Enterprise (DSE): DSE CQL shell commands reference and DSE CQL commands reference.
-
Apache Cassandra®: Apache Cassandra CQL shell commands reference and Apache Cassandra CQL commands reference.
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
You can find the project slug in the Mission Control UI breadcrumbs next to the cluster name on the cluster details page.
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 (CR).
The Mission Control operator automatically merges your podTemplateSpec configuration with its generated values.
|
To customize the |
This means you can customize various aspects of the cqlsh-pod, including:
-
Container image: Point to different image coordinates separately from other pods.
-
Image coordinate separation: Specify registry, repository, and tag separately for more granular image management.
-
Resource management: Set
resources.requestsandresources.limitsto control CPU and memory allocation. -
Security hardening: Configure
securityContextat both pod and container levels for enhanced security. -
Scheduling control: Use
nodeSelector,affinity, andtolerationsto control where thecqlsh-podis scheduled. -
Environment configuration: Add custom environment variables through the
envfield. -
Volume configuration: Mount additional volumes or configuration files as needed.
|
When customizing the
|
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.
Every cqlsh-pod that Mission Control creates for this cluster uses the cluster-level configuration.
Configure cqlsh-pod image coordinates separately in version 1.15.0 and later
This feature is available in Mission Control version 1.15.0 and later.
This structure was introduced with k8ssandra-operator version 1.27 and cass-operator version 1.27, which modify how image coordinates are defined using a unified structure.
|
When using coordinate separation, ensure that:
|
You can configure the cqlsh-pod image coordinates using separate registry, repository, and tag fields.
This approach provides granular control over image coordinates, allowing you to override individual components independently.
apiVersion: missioncontrol.datastax.com/v1beta2
kind: MissionControlCluster
metadata:
name: CLUSTER_NAME
spec:
cqlsh:
image:
registry: CUSTOM_REGISTRY_ADDRESS:CUSTOM_REGISTRY_PORT
repository: CUSTOM_CQLSH_REPOSITORY
tag: CUSTOM_TAG
podTemplateSpec:
spec:
containers:
- name: cqlsh
# Additional container configuration...
k8ssandra:
cassandra:
# ... rest of your cluster configuration
Replace the following:
-
CUSTOM_REGISTRY_ADDRESS: The address of your custom registry -
CUSTOM_REGISTRY_PORT: The port of your custom registry -
CUSTOM_CQLSH_REPOSITORY: Your customcqlsh-podrepository -
CUSTOM_TAG: The image tag you want to use
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 |
|
|
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 |
|
|
Key for the taint |
|
|
Taint operator |
|
|
Value for the taint |
|
|
Effect for the taint |
|
Download the CQL shell
You can install a standalone CQL shell (cqlsh) tool on your local machine to interact with your database cluster using CQL commands outside of the Mission Control UI.
To install the standalone CQL shell tool, you need a cqlsh binary tarball file.
These files are available on IBM Fix Central in the DSE fix packs for each DSE version.
Regardless of your actual database platform, you must find a DSE fix pack, and then download the cqlsh binary tarball from that fix pack.
-
Find DSE fix packs on IBM Fix Central:
-
Go to Fix Central.
-
In the Product selector field, begin typing
IBM DataStax Enterprise, and then select that option from the menu. -
In the Release field, select the version that you want to install.
-
Click Continue.
-
On the Identify fixes page, click Continue to use the default Browse for fixes option.
-
On the Select fixes page, select the fix pack (DSE version) you want to install, and then click Continue.
Depending on the product and version, more fix packs might be available if you set the Platform filter to All, and then click Submit.
-
If prompted, sign in with your IBMid.
An IBMid account with MFA enabled is required. If you don’t have one, create an IBMid account. If your organization uses Enterprise Federation (EF) for authentication with corporate credentials, see the IBMid EF documentation.
-
On the Download options page, select Download using your browser (HTTPS), and then click Continue.
-
Review the terms and conditions, and then click I agree to activate the download links.
-
-
Click the
cqlshbinary tarball link to download the file, for example,cqlsh-6.9.15-bin.tar.gz. -
Once the file is downloaded, change to the directory where you want to install
cqlsh, and then extract the distribution:tar -xzvf cqlsh-**VERSION**-bin.tar.gzReplace
VERSIONwith the package version that you downloaded, such as6.9.15. -
Start the
cqlshtool. For more information, see the following documentation for starting thecqlshtool: