Home > Workload Solutions > SQL Server > Guides > Design Guide—Data Analytics with SQL Server 2022 on Red Hat OpenShift and Dell ObjectScale > SQL Server 2022 deployment
The process of implementing SQL Server 2022 within the Red Hat OpenShift cluster is simple and straightforward. The SQL Server 2022 image has been customized to incorporate PolyBase, which facilitates the validation of potential use cases. PolyBase is not enabled by default and has been included in this custom image for data virtualization.
We have developed a customized image that includes the installation of PolyBase along with Microsoft SQL Server 2022 as shown below.
Change the image artifacts using the tag command.
Then push the newly created container image to container registry.
In this command, replace username with your dockerhub.io public container registry username. This container image can be pulled to run SQL Server 2022 with PolyBase pre-installed on any setup.
The certificate must be mapped so that the Kubernetes cluster can communicate with the Elastic Cloud Storage deployment. This can be done using the Kubernetes ConfigMap, which maps the certificate to a SQL container.
The certificate must be mapped so that the OpenShift cluster can communicate with the Dell ObjectScale storage deployment. This can be done using the OpenShift ConfigMap, which maps the certificate to a SQL container.
A PersistentVolumeClaim (PVC) is a request for storage by a user. It is like a Pod, as Pods consume node resources and PVCs consume PV resources. Pods can request specific resource amounts (CPU and Memory). Claims can request specific amounts of storage and can be mounted with ReadWriteOnce, ReadOnlyMany or ReadWriteMany access modes.
To provide persistent storage to a container or pod, a persistent volume claim is created using the RHODF storage class “ocs-storagecluster-cephfs”. The following script provides an example of how to create a PVC that will be used by the SQL Server pods. This pvc yaml script creates a 500 GB volume in ReadWriteOnce access mode.
A Secret is an object that contains a small amount of sensitive data like a password, token, or key which might otherwise be put in a Pod specification or container image.
Secrets can be created independently of the Pods that use them, reducing the risk of the secrets data being exposed during the workflow of creating, viewing, and editing Pods.
To provide the SA password within the deployment file for the containers, a secret was created in OpenShift’s cluster environment using a base 64 encryption for the password.
The deployment section provides a declarative update pattern for pods and replica sets. A preferred state is described, and the deployment controller changes the actual state to match the preferred state at a controlled rate. This allows high availability to be maintained, and it is possible to specify when resources should be destroyed, allowing cluster updates to occur without any loss of service in some cases.
This yaml script is used to deploy SQL Server 2022 on a OpenShift cluster.
Services are an abstract way to expose an application running on a set of Pods as a network service. With OpenShift there is no need to modify the application to use an unfamiliar service discovery mechanism. Pods are given IP addresses by OpenShift. Pods can be load balanced and can share a single DNS.
A Service is an abstraction which defines a logical set of Pods and their access policy. The set of Pods targeted by a Service is usually determined by a selector (in this case it is “mssql-31445”). Specific ports can be specified for container port mapping.
There are several types of services that can be created such as ClusterIP, NodePort, LoadBalancer, and ExternalName. This example creates a service of type NodePort. More details on the service and service types can be found on the OpenShift website.
Once the SQL Server pods are running successfully, these SQL Server pods can be connected to just like any SQL Server instance. The above screenshot shows a connection to a SQL Server 2022 instance running in an OpenShift cluster environment.
Many different tools can be used to connect to a SQL Server instance that is running in a pod. SQL Server Management Studio, PowerShell, Visual Studio, third-party SQL monitoring or development tools and other platforms will connect to the container instance as intended.