-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into cloud-suffix
- Loading branch information
Showing
17 changed files
with
372 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,24 @@ | ||
apiVersion: azure.microsoft.com/v1alpha1 | ||
kind: CosmosDB | ||
metadata: | ||
name: cosmosdb-sample1908xyzkj | ||
name: cosmosdb-sample-1 | ||
spec: | ||
kind: GlobalDocumentDB | ||
location: westus | ||
resourceGroup: resourcegroup-azure-operators | ||
properties: | ||
databaseAccountOfferType: Standard | ||
enableMultipleWriteLocations: false | ||
# optionally set the mongoDBVersion to "3.2" or "3.6", if omitted the default is "3.2" | ||
# NOTE: kind must be set to MongoDB for this to take effect | ||
#mongoDBVersion: "3.6" | ||
|
||
# Use the field below to optionally specify a different keyvault | ||
#optional for network rule set | ||
# isVirtualNetworkFilterEnabled: true | ||
# virtualNetworkRules: | ||
# - subnetId: /subscriptions/{subscription_id}/resourceGroups/{resourcegroup}/providers/Microsoft.Network/virtualNetworks/{vnet_name}/subnets/{subnet_name} | ||
# ignoreMissingServiceEndpoint: false | ||
|
||
# Use the field below to optionally specify a different keyvault | ||
# to store the connectiong string secrets in | ||
#keyVaultToStoreSecrets: asoSecretKeyVault |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
apiVersion: azure.microsoft.com/v1alpha1 | ||
kind: MySQLServer | ||
metadata: | ||
name: mysqlserver-replica | ||
spec: | ||
location: eastus2 | ||
resourceGroup: resourcegroup-azure-operators | ||
createMode: Replica # Possible values include: Default, Replica, PointInTimeRestore (not implemented), GeoRestore (not implemented) | ||
replicaProperties: | ||
# sourceServer tier should be "GeneralPurpose" or higher for replica support | ||
sourceServerId: /subscriptions/{SUBID}/resourceGroups/resourcegroup-azure-operators/providers/Microsoft.DBforMySQL/servers/mysqlserver-sample | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# MySQL Operator | ||
|
||
## Resources Supported | ||
|
||
The MySQL operator suite consists of the following operators. | ||
|
||
1. MySQL server - Deploys an `Azure Database for MySQL server` given the Location, Resource group and other properties. This operator also helps creating read replicas for MySQL server. | ||
2. MySQL database - Deploys a database under the given `Azure Database for MySQL server` | ||
3. MySQL firewall rule - Deploys a firewall rule to allow access to the `Azure Database for MySQL server` from the specified IP range | ||
|
||
### MySQL server | ||
|
||
Here is a [sample YAML](/config/samples/azure_v1alpha1_mysqlserver.yaml) for the MySQL server. | ||
|
||
The value for kind, `MySQLServer` is the Custom Resource Definition (CRD) name. | ||
`mysqlserver-sample` is the name of the MySQL server resource that will be created. | ||
|
||
The values under `spec` provide the values for the location where you want to create the server at and the Resource group in which you want to create it under. It also contains other values that are required to create the server like the `serverVersion`, `sslEnforcement` and the `sku` information. | ||
|
||
Along with creating the MySQL server, this operator also generates the admin username and password for the MySQL server and stores it in a kube secret or keyvault (based on what is specified) with the same name as the MySQL server. | ||
|
||
This secret contains the following fields. | ||
|
||
- `fullyqualifiedservername` : Fully qualified name of the MySQL server such as mysqlserver.mysql.database.azure.com | ||
- `mysqlservername` : MySQL server name | ||
- `username` : Server admin | ||
- `password` : Password for the server admin | ||
- `fullyqualifiedusername` : Fully qualified user name that is required by some apps such as <username>@<mysqlserver> | ||
|
||
For more information on where and how secrets are stored, look [here](/docs/secrets.md) | ||
|
||
#### Read Replicas in Azure Database for MySQL | ||
|
||
The MySQL server operator can also be used to create Read Replicas given the `sourceserverid` and the `location`. | ||
|
||
The replica inherits all other properties including the admin username and password from the source server. | ||
|
||
The operator reads the admin username and password for the source server from its secret (if available) and creates a secret with the same fields as described above for the replica. | ||
|
||
For more information on read replicas, refer [here](https://docs.microsoft.com/en-us/azure/mysql/concepts-read-replicas) | ||
|
||
### MySQL Database | ||
|
||
Here is a [sample YAML](/config/samples/azure_v1alpha1_mysqldatabase.yaml) for MySQL database | ||
|
||
Update the `resourcegroup` to where you want to provision the MySQL database. `server` is the name of the MySQL server where you want to create the database in. | ||
|
||
### MySQL firewall rule | ||
|
||
The MySQL firewall rule operator allows you to add a firewall rule to the MySQL server. | ||
|
||
Here is a [sample YAML](/config/samples/azure_v1alpha1_mysqlfirewallrule.yaml) for MySQL firewall rule | ||
|
||
The `server` indicates the MySQL server on which you want to configure the new MySQL firewall rule on and `resourceGroup` is the resource group of the MySQL server. The `startIpAddress` and `endIpAddress` indicate the IP range of sources to allow access to the server. | ||
|
||
*Note*: When the `startIpAddress` and `endIpAddress` are 0.0.0.0, it denotes a special case that adds a firewall rule to allow all Azure services to access the server. | ||
|
||
## Deploy, view and delete resources | ||
|
||
You can follow the steps [here](/docs/customresource.md) to deploy, view and delete resources. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.