microsoft / arc-sql-mi-db-operator Goto Github PK
View Code? Open in Web Editor NEWControl Arc SQL MI databases using kubectl
Control Arc SQL MI databases using kubectl
# Azure MS SQl Operator This is a K8S operator to interact with MS SQL Managed Instance ## TL;DR This project was genereated using [Red Hat's Operator SDK](https://sdk.operatorframework.io/) and [Kubebuilder](https://book.kubebuilder.io/introduction.html) You can use the `make` file to handle most use cases including `building, deploying and building docker image` Check out the `config` directory for the manifests generated and the `config/samples` directory for a sample of the `CRD`. ## Building ### Building the Operator To build the `arc-sql-mi-db-operator` you can use the `make docker-build` command. This command uses the `make` variable `IMG` to tag the image. I recommend explicitly setting this variable when building the image. ```bash make docker-build IMG=azure-sql-mi:v0.1.0 ``` ### Building the Sync Image To build the `sync` image you can use the `make docker-sync-build` command. This command makes use of a few `make` variables. Like building the operator, you can explicitly set the `SYNC_IMG`. However, `SYNC_IMG` is a concatenation of several variables in the following form: `SYNC_IMG ?= $(REPO)/sync:v$(SYNC_VERSION)` Each variable can be set or a combination of using the default and explicitly setting the variable. ```bash make docker-sync-build REPO=mcr.microsoft.io ``` ## Publishing ### Publishing the Operator To publish the `arc-sql-mi-db-operator` you can use the `make docker-push` command. This command uses the `make` variable `IMG` to push the image. I recommend explicitly setting this variable as it needs to match what was used to build the image. ```bash make docker-push IMG=azure-sql-mi:v0.1.0 ``` ### Publishing the Sync Image To publish the `sync` you can use the `make docker-sync-push` command. This command uses the `make` variable `SYNC_IMG` to push the image. I recommend explicitly setting this variable as it needs to match what was used to build the image. ```bash make docker-sync-push SYNC_IMG=mcr.microsoft.io/sycn:v0.1.0 ``` ## Deploying Operator To deploy the operator into your `K8S` environment you can use the `make deploy`. This command uses the `make` variable `IMG`. I recommend explicitly setting this variable as it needs to match what was used to publish the image. ```bash make deploy IMG=azure-sql-mi:v0.1.0 ``` This command also deploys all the necessary `K8S` manifest files located in the `config` directory. It includes the `RBAC` related manifests, and the `CRD` of database controller. Keep in mind that you need to have `KUBECONFIG` set or at a minimum an active configuration for this process to complete successfully. ## Create the Database This is accomplished by applying the `Database` manifest using `kubectl`. Here is an example manifest: ```yaml apiVersion: sqlmi.arc-sql-mi.microsoft.io/v1alpha1 kind: Database metadata: name: database-sample spec: name: MyDatabase1 sqlManagedInstance: jumpstart-sql collation: SQL_Latin1_General_CP1_CS_AS # optional parameterization: forced # optional, options:[simple, forced] allowSnapshotIsolation: true # optional allowReadCommittedSnapshot: false # optional compatibilityLevel: 160 # optional schedule: "*/1 * * * *" # optional ``` ## Contributing This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com. When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments. ## Trademarks This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow [Microsoft's Trademark & Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general). Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.
There are important files that Microsoft projects should all have that are not present in this repository. A pull request has been opened to add the missing file(s). When the pr is merged this issue will be closed automatically.
Microsoft teams can learn more about this effort and share feedback within the open source guidance available internally.
This repository is currently missing a LICENSE file.
A license helps users understand how to use your project in a compliant manner. You can find the standard MIT license Microsoft uses at: https://github.com/microsoft/repo-templates/blob/main/shared/LICENSE.
If you would like to learn more about open source licenses, please visit the document at https://aka.ms/license (Microsoft-internal guidance).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.