Enabling Data API
To enable Data API on a DataStax service, create a DataApi custom resource in OpenShift.
To create a DataApi custom resource, complete the following steps:
- Collect the Cassandra datacenter name and common license annotations:
export DC_NAME=<datacenter name>
export COMMON_ANNOTATIONS=$(oc get cassandradatacenters.cassandra.datastax.com $DC_NAME -n $PROJECT_CPD_INST_OPERANDS -o json | jq '.spec.additionalAnnotations')
Example
oc get cassandradatacenters.cassandra.datastax.com -n $PROJECT_CPD_INST_OPERANDS
NAME AGE
dc718 23h
export DC_NAME=dc718
export COMMON_ANNOTATIONS=$(oc get cassandradatacenters.cassandra.datastax.com $DC_NAME -n $PROJECT_CPD_INST_OPERANDS -o json | jq '.spec.additionalAnnotations')
echo $COMMON_ANNOTATIONS
{
"cloudpakId": "a30579a0e5214cfaa0224c6043b37ea4",
"cloudpakInstanceId": "ece3e3d4-6f2d-448b-b2b3-82c65eada382",
"cloudpakName": "IBM watsonx.data Premium Edition",
"productChargedContainers": "All",
"productCloudpakRatio": "12:1",
"productID": "e174d32f45b44e929043e6b952007433",
"productMetric": "VIRTUAL_PROCESSOR_CORE",
"productName": "DataStax Hyper-Converged Database",
"productVersion": "2.3.0"
}
- Use the information you collected in the previous step to enable Data API on a Cassandra datacenter. In the following example, the deployment creates a single Data API pod with 1 vCPU and 1 GB of RAM. To modify the size of the Data API deployment, update the resources section in the example command:
cat <<EOF | oc apply -f -
{
"apiVersion": "missioncontrol.datastax.com/v1alpha1",
"kind": "DataApi",
"metadata": {
"name": "$DC_NAME",
"namespace": "$PROJECT_CPD_INST_OPERANDS"
},
"spec": {
"cassandraDatacenterRef": {
"name": "$DC_NAME"
},
"metadata": {
"commonAnnotations": $COMMON_ANNOTATIONS,
"commonLabels": {
"icpdsupport/addOnId": "datastax-mc",
"velero.io/exclude-from-backup": "true",
"icpdsupport/ignore-on-nd-backup": "true",
"icpdsupport/empty-on-nd-backup": "true"
}
},
"replicas": 1,
"resources": {
"limits": {
"cpu": 1,
"memory": "1G",
"ephemeral-storage": "500Mi"
},
"requests": {
"cpu": 1,
"memory": "1G",
"ephemeral-storage": "500Mi"
}
},
"services": {
"clusterIP": {
"port": 8080
}
}
}
}
EOF