Skip to content

Commit

Permalink
finish vol exp
Browse files Browse the repository at this point in the history
Signed-off-by: Neaj Morshad <[email protected]>
  • Loading branch information
Neaj-Morshad-101 committed Oct 25, 2024
1 parent f1283d8 commit 659dd4f
Show file tree
Hide file tree
Showing 5 changed files with 325 additions and 91 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
apiVersion: ops.kubedb.com/v1alpha1
kind: MSSQLServerOpsRequest
metadata:
name: mops-volume-exp-ag-cluster
namespace: demo
spec:
type: VolumeExpansion
databaseRef:
name: mssqlserver-ag-cluster
volumeExpansion:
mode: "Offline" # Online
mssqlserver: 2Gi
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: kubedb.com/v1alpha2
kind: MSSQLServer
metadata:
name: mssqlserver-ag-cluster
namespace: demo
spec:
version: "2022-cu12"
replicas: 3
topology:
mode: AvailabilityGroup
availabilityGroup:
databases:
- agdb1
- agdb2
internalAuth:
endpointCert:
issuerRef:
apiGroup: cert-manager.io
name: mssqlserver-ca-issuer
kind: Issuer
tls:
issuerRef:
name: mssqlserver-ca-issuer
kind: Issuer
apiGroup: "cert-manager.io"
clientTLS: false
storageType: Durable
storage:
storageClassName: "longhorn"
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
deletionPolicy: WipeOut
20 changes: 10 additions & 10 deletions docs/guides/mssqlserver/volume-expansion/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,38 +19,38 @@ This guide will give an overview on how KubeDB Ops Manager expand the volume of
## Before You Begin

- You should be familiar with the following `KubeDB` concepts:
- [MSSQLServer](/docs/guides/redis/concepts/redis.md)
- [MSSQLServerOpsRequest](/docs/guides/redis/concepts/redisopsrequest.md)
- [MSSQLServer](/docs/guides/mssqlserver/concepts/mssqlserver.md)
- [MSSQLServerOpsRequest](/docs/guides/mssqlserver/concepts/opsrequest.md)

## How Volume Expansion Process Works

The following diagram shows how KubeDB Ops Manager expand the volumes of `MSSQLServer` database components. Open the image in a new tab to see the enlarged version.

<figure align="center">
  <img alt="Volume Expansion process of MSSQLServer" src="/docs/images/day-2-operation/redis/ms-volume-expansion.svg">
  <img alt="Volume Expansion process of MSSQLServer" src="/docs/images/day-2-operation/mssqlserver/ms-volume-expansion.svg">
<figcaption align="center">Fig: Volume Expansion process of MSSQLServer</figcaption>
</figure>

The Volume Expansion process consists of the following steps:

1. At first, a user creates a `MSSQLServer` Custom Resource (CR).

2. `KubeDB` Community operator watches the `MSSQLServer` CR.
2. `KubeDB` Provisioner operator watches the `MSSQLServer` CR.

3. When the operator finds a `MSSQLServer` CR, it creates required `PetSet` and related necessary stuff like secrets, services, etc.

4. The petSet creates Persistent Volumes according to the Volume Claim Template provided in the petset configuration. This Persistent Volume will be expanded by the `KubeDB` Enterprise operator.
4. The petSet creates Persistent Volumes according to the Volume Claim Template provided in the petset configuration. This Persistent Volume will be expanded by the `KubeDB` Ops-manager operator.

5. Then, in order to expand the volume of the `MSSQLServer` database the user creates a `MSSQLServerOpsRequest` CR with desired information.

6. `KubeDB` Enterprise operator watches the `MSSQLServerOpsRequest` CR.
6. `KubeDB` Ops-manager operator watches the `MSSQLServerOpsRequest` CR.

7. When it finds a `MSSQLServerOpsRequest` CR, it pauses the `MSSQLServer` object which is referred from the `MSSQLServerOpsRequest`. So, the `KubeDB` Community operator doesn't perform any operations on the `MSSQLServer` object during the volume expansion process.
7. When it finds a `MSSQLServerOpsRequest` CR, it pauses the `MSSQLServer` object which is referred from the `MSSQLServerOpsRequest`. So, the `KubeDB` Provisioner operator doesn't perform any operations on the `MSSQLServer` object during the volume expansion process.

8. Then the `KubeDB` Enterprise operator will expand the persistent volume to reach the expected size defined in the `MSSQLServerOpsRequest` CR.
8. Then the `KubeDB` Ops-manager operator will expand the persistent volume to reach the expected size defined in the `MSSQLServerOpsRequest` CR.

9. After the successful expansion of the volume of the related PetSet Pods, the `KubeDB` Enterprise operator updates the new volume size in the `MSSQLServer` object to reflect the updated state.
9. After the successful expansion of the volume of the related PetSet Pods, the `KubeDB` Ops-manager operator updates the new volume size in the `MSSQLServer` object to reflect the updated state.

10. After the successful Volume Expansion of the `MSSQLServer`, the `KubeDB` Enterprise operator resumes the `MSSQLServer` object so that the `KubeDB` Community operator resumes its usual operations.
10. After the successful Volume Expansion of the `MSSQLServer`, the `KubeDB` Ops-manager operator resumes the `MSSQLServer` object so that the `KubeDB` Provisioner operator resumes its usual operations.

In the next docs, we are going to show a step-by-step guide on Volume Expansion of various MSSQLServer database using `MSSQLServerOpsRequest` CRD.
Loading

0 comments on commit 659dd4f

Please sign in to comment.