Skip to content

Commit

Permalink
MsSqlDatabase resource (#96)
Browse files Browse the repository at this point in the history
  • Loading branch information
fraliv13 authored Nov 21, 2024
1 parent e366faf commit e7d90ce
Show file tree
Hide file tree
Showing 29 changed files with 1,875 additions and 35 deletions.
53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,59 @@ spec:
keyTemplate: UserPrincipalName
```

### MsSqlDatabase

`MsSqlDatabase` is a Custom Resource Definition (CRD) that represents a SQL database.

Definition can be found [here](./helm/crds/provisioning.totalsoft.ro_mssqldatabases.yaml)

## Spec

The `MsSqlDatabase` spec has the following fields:

- `dbName`: Database name prefix. The actual database name will have platform and tenant suffix.
- `sqlServer`: Specification of the SQL Server where the new database will be created.
* `hostName`: The host name of the SQL Server.
* `port`: The port of the SQL Server.
* `sqlAuth`: The SQL authentication credentials.
- `username`: The username.
- `password`: The password.
- `restoreFrom`: Specification for restoring the database from a backup. Leave empty for a new empty database.
* `backupFilePath`: The path to the backup file.
- `domainRef`: The reference to the domain that the user belongs to.
- `platformRef`: The reference to the platform that the user belongs to.

## Example

Here's an example of an `MsSqlDatabase` resource:

```yaml
apiVersion: provisioning.totalsoft.ro/v1alpha1
kind: MsSqlDatabase
name: test-db
namespace: provisioning-test
spec:
dbName: test
domainRef: domain1
exports:
- dbName:
toConfigMap:
keyTemplate: MultiTenancy__Tenants__{{ .Tenant.Code }}__ConnectionStrings__Test_Database__Database
domain: domain1
platformRef: provisioning.test
restoreFrom:
backupFilePath: C:\tmp\test-db\mydb.bak
sqlServer:
hostName: myhost
port: 1433
sqlAuth:
password: mypassword
username: sa
target:
category: Tenant
```


## configuration.totalsoft.ro
manages external configuration for the services in the platform, read more about from the [Twelve-Factor App ](https://12factor.net/config) methodology.

Expand Down
38 changes: 26 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ require (
github.com/pulumi/pulumi-kubernetes/sdk/v3 v3.28.1
github.com/pulumi/pulumi-random/sdk/v4 v4.13.2
github.com/pulumi/pulumi-vault/sdk/v5 v5.11.0
github.com/pulumi/pulumi/sdk/v3 v3.68.0
github.com/pulumi/pulumi/sdk/v3 v3.84.0
github.com/pulumiverse/pulumi-mssql/sdk v0.0.8
github.com/stretchr/testify v1.8.1
google.golang.org/grpc v1.55.0
google.golang.org/protobuf v1.30.0
google.golang.org/grpc v1.57.0
google.golang.org/protobuf v1.31.0
k8s.io/api v0.27.2
k8s.io/apiextensions-apiserver v0.27.2
k8s.io/apimachinery v0.27.2
Expand All @@ -43,9 +44,15 @@ require (
github.com/aead/chacha20 v0.0.0-20180709150244-8b13a72661da // indirect
github.com/agext/levenshtein v1.2.1 // indirect
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
github.com/atotto/clipboard v0.1.4 // indirect
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
github.com/cenkalti/backoff/v3 v3.0.0 // indirect
github.com/charmbracelet/bubbles v0.16.1 // indirect
github.com/charmbracelet/bubbletea v0.24.2 // indirect
github.com/charmbracelet/lipgloss v0.7.1 // indirect
github.com/cheggaaa/pb v1.0.29 // indirect
github.com/cloudflare/circl v1.3.3 // indirect
github.com/containerd/console v1.0.4-0.20230313162750-1ae8d489ac81 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/djherbis/times v1.5.0 // indirect
github.com/emicklei/go-restful/v3 v3.9.0 // indirect
Expand All @@ -61,7 +68,6 @@ require (
github.com/go-openapi/jsonpointer v0.19.6 // indirect
github.com/go-openapi/jsonreference v0.20.1 // indirect
github.com/go-openapi/swag v0.22.3 // indirect
github.com/gofrs/uuid v4.2.0+incompatible // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/glog v1.1.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
Expand All @@ -85,14 +91,21 @@ require (
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/josharian/intern v1.0.0 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-localereader v0.0.1 // indirect
github.com/mattn/go-runewidth v0.0.14 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/go-ps v1.0.0 // indirect
github.com/mitchellh/go-wordwrap v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/muesli/ansi v0.0.0-20211018074035-2e021307bc4b // indirect
github.com/muesli/cancelreader v0.2.2 // indirect
github.com/muesli/reflow v0.3.0 // indirect
github.com/muesli/termenv v0.15.1 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/opentracing/basictracer-go v1.1.0 // indirect
Expand All @@ -102,7 +115,7 @@ require (
github.com/pkg/term v1.1.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/pulumi/pulumi-azure-native-sdk/v2 v2.4.0 // indirect
github.com/rivo/uniseg v0.2.0 // indirect
github.com/rivo/uniseg v0.4.4 // indirect
github.com/rogpeppe/go-internal v1.10.0 // indirect
github.com/ryanuber/go-glob v1.0.0 // indirect
github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 // indirect
Expand All @@ -119,14 +132,15 @@ require (
github.com/zclconf/go-cty v1.12.1 // indirect
go.uber.org/atomic v1.10.0 // indirect
golang.org/x/crypto v0.7.0 // indirect
golang.org/x/net v0.8.0 // indirect
golang.org/x/oauth2 v0.6.0 // indirect
golang.org/x/sys v0.6.0 // indirect
golang.org/x/term v0.6.0 // indirect
golang.org/x/text v0.8.0 // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/oauth2 v0.7.0 // indirect
golang.org/x/sync v0.1.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/term v0.8.0 // indirect
golang.org/x/text v0.9.0 // indirect
golang.org/x/time v0.3.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230306155012-7f2fa6fef1f4 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230706204954-ccb25ca9f130 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/square/go-jose.v2 v2.5.1 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
Expand Down
Loading

0 comments on commit e7d90ce

Please sign in to comment.