зеркало из
1
0
Форкнуть 0
Граф коммитов

396 Коммитов

Автор SHA1 Сообщение Дата
George Pollard 3b3476069a
Update Azure pipeline to use go 1.18 (#2218)
Fixing legacy pipeline.
2022-04-13 15:24:40 +12:00
Mathis Kretz cfb40ee2e4
Make elastic pool id configurable on Azure SQL DB (#2184) 2022-03-31 12:48:13 -07:00
George Pollard d1b1984153
Switch ASO v1 from admissionregistration v1beta1 to v1 (#2053)
Closes #2047.

This changes the v1 ASO code to generate `admissionregistration.k8s.io/v1` instead of `admissionregistration.k8s.io/v1beta1`. `v1` is supported since Kubernetes 1.16, and `v1beta1` is [removed in Kubernetes 1.22](https://github.com/kubernetes/kubernetes/issues/82021).

The Kustomize patch `admissionreviewversions_in_webhook.yaml` is removed as `admissionReviewVersions` are now generated by default.
2022-02-03 09:42:23 +13:00
Christian Muirhead 7f37186dfc
MySQL: support granting ALL privileges in a database to a user (#1784)
* Support granting ALL privileges in a database to a user

If ALL is specified, we don't delete any privileges.

* Add validation webhooks for MySQL[AAD]User to prevent server-ALL

Since the ASO mysql admin user doesn't have privileges to grant global
ALL privileges, prevent this from being set in the resources.

* Update the docs for mysql users and aad users

* Test the MySQL[AAD]User webhook prevents ALL at the server level
2021-09-08 17:52:03 +12:00
Matthew Christopher 02973a1276
Update ASO v1 dependencies (#1646)
* Update Go version to 1.16
* Update dependencies
* Pass ctx to reconcile
2021-07-15 13:20:47 -07:00
Matthew Christopher 4cf831f74b
Small MySQLServer samples update (#1641) 2021-07-12 17:30:01 -07:00
Matthew Christopher 81091cf18a
Support user specified MySQLServer secrets (#1625)
* Support user specified MySQLServer secrets
 - The specified secret must be a Kubernetes secret.
 - The specified secret must contain a "username" and "password" field.
 - The specified secret must be in the same namespace as the MySQLServer.
 - If the specified secret doesn't exist, reconciliation will be blocked
   until the secret does exist. Once the secret is created, reconciliation
   will continue as normal.
 - The operator does not make the user specified secret owned by
   the MySQLServer.
 - The operator still creates a secret containing connection string details
   and username/password for the server. This secret is named as it was
   before. This means that the customer specified username and password
   are consumed to create this secret, but other resources such as MySQLUser
   still consume the generated secret file.
2021-07-11 11:29:03 -07:00
Matthew Christopher 2f6cc6f1a4
Add new CosmosDBSQLDatabase CRD (#1549)
* Update CosmosDB SDK version
* Refactor CosmosDB folder structure
  - This is in preparation for adding new CosmosDB resources.
* Rename HandleEnsureError with a clearer name
  - Also add documentation.
* Add new CosmosDBSQLDatabase resource
* Add PollURLKind to status
  - Use it to differentiate between Create/Delete polling.
2021-06-08 14:17:05 -07:00
Bevan Arps 0cff55940f
Improve validation for some fields with enumerations (#1490)
* Add validation rules for enums

* Fix enum validation syntax

* PR feedback

Co-authored-by: Matthew Christopher <matthchr@users.noreply.github.com>
Co-authored-by: Matthew Christopher <matthchr@microsoft.com>
2021-05-25 14:51:55 +12:00
Matthew Christopher 6ba28a50ff
Use correct DNS suffix for MySQLAADUser (#1499)
Co-authored-by: George Pollard <gpollard@microsoft.com>
2021-05-20 20:11:03 -07:00
Bevan Arps 5350939db3 Update generated files 2021-05-18 14:32:48 +12:00
Bevan Arps 87f24cc59c Show StorageAutogrow options as 'enabled' and 'disabled' 2021-05-18 14:32:16 +12:00
Matthew Christopher ee50ad72a2
Ensure webhooks are correctly generated (#1425) 2021-05-12 14:20:20 -07:00
Matthew Christopher f95b976055
Minor Azure SQL FailoverGroup improvements (#1403)
* Validate FailoverGroup policy has valid values
* Fix AzureSQLFailoverGroup sample
* Fix AzureSQLFailoverGroup test
2021-04-07 16:38:24 -07:00
Christian Muirhead bfabead441
Always allow converting MySQL[AAD]Users back to v1alpha1 (#1393)
* Remove ignore entry for manager

The output of `make manager` goes into bin/ which is already
ignored. This entry was causing very confusing things to happen with
directories called `manager` further down the directory tree.

* Never error when converting v1alpha2 MySQLAADUser -> v1alpha1

(Unless JSON serialisation fails for some reason.) Instead we store
the changed fields in an annotation and allow roundtripping that when
converting in the other direction.

* Never error when converting v1alpha2 MySQLUser -> v1alpha1

(Unless JSON serialisation fails for some reason.) Instead we store
the changed fields in an annotation and allow roundtripping that when
converting in the other direction.

* Review feedback, thanks @matthchr

* Comment out the replica server in the MySQL happy path test

This is perpetually timing out for me at the moment, and testing
manually shows that creation can take more than an hour.
2021-03-24 16:26:25 +13:00
Matthew Christopher 876b1c7aa4
Fix bugs related to secret management and improve documentation (#1358)
* Fix typo in readme

* Improve secrets documentation

* Return proper error if we cannot deserialize secret

* Add new AZURE_SECRET_NAMING_VERSION mode

The new mode allows us to fix inconsitencies in how secrets
were named without making a breaking change.

  - AppInsights created secrets in the same namespace
    as the resource but with name:
    "appinsights-<resourceGroup>-<resourceName>"
  - Storage created secrets in the same namespace
    as the resource but with name:
    "storage-<resourceGroup>-<resourceName>"
  - AzureSQL resources created resources with
    a different naming scheme as well.
  - Other resources created a secret in the same
    namespace with the secret name being the
    resource name.

The new V2 mode ensures that all resources create secrets
in KeyVault and/or Kubernetes with a consistent naming pattern.

* Update Helm chart (but don't generate new package)

* Fix bug where SQLManagedUser Namespace could be empty

  - This would prevent secrets from being created in Kubernetes

* Enable V2 secrets for EnvTest tests

* Use v1beta1 explicitly with controller-gen

* PR feedback

* PR feedback

* Better testing
2021-02-05 10:05:48 -08:00
Christian Muirhead 7991802c7b
Add MySQLUser and MySQLAADUser v1alpha2 (#1357)
* Add v1alpha2 MySQLUser

This removes DbName from MySQLUser and adds DatabaseRoles to store
per-database permissions. Roles will now only store server-wide
permissions.

Add conversions between v1alpha1 and v1alpha2 versions.

* Add v1alpha2 MySQLAADUser

This removes DBName from MySQLAADUser and adds DatabaseRoles to store
per-database permissions. Roles will now only store server-wide
permissions.

Add conversions between v1alpha1 and v1alpha2 versions.

* Set up conversion webhooks for MySQLUser and MySQLAADUser

* Review feedback, thanks @matthchr!

* Ensure `preserveUnknownFields: false` is set in all webhook patches

These were set for all types with version conversions but not the
others (which aren't in use since they are still commented out in
kustomization.yaml). Turning them on in the rest to remove one step in
the process of adding conversion webhooks to types in the future.

This setting is required for conversion to work - it seems like the
only reason it's not set in the patches is that they were generated by
kubebuilder before the setting was mandatory.

* Add provisioning state methods to v1alpha2 ASOStatus

* Reimplement MySQLUser and MySQLAADUser reconciliation with v1alpha2

They now check server-level (in USER_PRIVILEGES) and
database-level (SCHEMA_PRIVILEGES) permissions.

* Update controller tests to work with v1alpha2 MySQLUser

* Move system database constant to mysql.SystemDatabase

Also rename the ServerPort and DriverName constants so they don't
repeat the name of the package.

* Change EnsureUserDatabaseRoles to return just an error

And change the reconciliation code for user and aad user to just treat
that as a provisioning failure, rather than saying that it had
succeeded but there were some errors which is just confusing. We still
try to apply changes to all databases even if there is an error for
one of them.

Also other review changes, thanks @matthchr!
2021-02-01 10:55:56 -08:00
Matthew Christopher c446f1d91e
Azure SQL FailoverGroup improvements (#1361)
* Azure SQL FailoverGroup improvements

 - Fix bug preventing reconciliation of updates after a FailoverGroup
   was created.
 - Fix bug where status of long running operation was not properly
   monitored.

* Add unit tests to CI
2021-01-20 13:22:43 -08:00
Matthew Christopher 10e3c6e5b2
Add AzureSQL short term retention policies (#1355)
* Add AzureSQL short term retention policies
2021-01-13 14:17:27 -08:00
Matthew Christopher 322e7e8359
Improve validation for AzureSQLUser and AzureSQLManagerUser (#1348)
* Kubebuilder annotation for minlength should use = not :

* Add additional validations on MySQL users

* Add validations to more Azure SQL types

* Update some dependencies

  - We're primarily interested in updating controller-runtime
    as the newer version supports webhooks in envtest better.

* Don't allow DB name "master" to be used for Azure SQL users

* Fixes for CI
2021-01-12 13:37:26 -08:00
Matthew Christopher 892b3624ae
Provisioning AccessPolicy and KeyVault at same time (#1352)
The operator was originally reconciling AccessPolicy's after the rest of the KV
had been created (see: #1158). This isn't actually required because even doing
this there are tons of reasons that this can fail. I've filed #1351 to track
removing ClientID from the CRD in a future API version as there are a ton of
obscure ways that we can fail to translate that ID into an ObjectID.
2021-01-12 12:35:39 -08:00
Colin D Murphy a50a59e020
Add optional VNET Subscription ID to VNET rules. (#1333)
* Add optional VNET Subscription ID to VNET rules.

* Update pkg/resourcemanager/azuresql/azuresqlvnetrule/azuresqlvnetrule.go
2020-12-17 10:10:53 +13:00
Christian Muirhead 82f75eab23
Clarify documentation for sample MySQLAdministrator (#1334)
* Clarify that Sid should be client ID for managed identities

* Add more detail to logging for errors connecting to MySQL

Co-authored-by: Bevan Arps <bevan.arps@microsoft.com>
2020-12-16 10:17:55 +13:00
Matthew Christopher c3fa70488c
Update to support AAD users and groups too (#1319) 2020-11-25 16:41:08 -08:00
Matthew Christopher 1b6f19de1c
Add support for MySQL AAD Users (#1315)
* Add support for MySQL AAD Users
* Fix strangeness with "user" CRDs RBAC location
* Pass pod namespace to operator via env variable
* Change to enforce tls=true in MySQL DB connection
* Improve managed identity documentation
* Attempt to read clientID when ManagedIdentity is enabled
  - This will allow us to differentiate between different
    identities when we support multi-tenancy.

This also includes updates to the Managed Identity documentation to help improve clarity of the feature. As part of this I deleted the tool createMi.go as all it really did was run 3 az cli commands to create a managed identity and assign it permissions. It made assumptions about what permissions you wanted the identity to have. Additionally it suggested to install aad-pod-identity, but this guidance is not appropriate for installations via Helm because Helm already installs that dependency as part of the chart. Rather than having a script try to be one-size fits all it makes more sense to give customers the instructions they need to create the managed identity and allow them to choose what permissions they want to give it.
2020-11-24 12:10:08 -08:00
Matthew Christopher 9a26a7445e
Add support for MySQL Administrators (#1314)
* Clean up unused code
* Clarify make target
* Add support for MySQL Administrators resource
2020-11-19 13:58:19 -08:00
Matthew Christopher 4e3e459972
Add helpers to help avoid conflicting states (#1283) 2020-10-05 10:00:20 -07:00
Matthew Christopher 4786bc071f
Move secret deletion to best effort again (#1281)
* Move secret deletion to best effort again

* Workaround issue with MySQL DB
2020-10-02 15:48:32 -07:00
Matthew Christopher fe0ac20a0c
Handle SQL DB conflicts (and other errors) (#1276)
* Handle SQL DB conflicts (and other errors)

* Rename NewAzureErrorAzureError to NewAzureError
2020-09-23 07:45:08 -07:00
Matthew Christopher a3c3d3a699
Ensure that all CRDs define subresources: status (#1272) 2020-09-21 10:52:08 -07:00
Marc Power e1b8f1a487 Add support for allocation of public ips with ip-tags 2020-07-28 21:44:44 -07:00
Matthew Christopher a926a7987c
Add support for SQL Database SKU and MaxSizeBytes (#1235)
* Update to use newer version of SQL API

* Add support for SKU and MaxSizeBytes to SQL Database

* Update helm charts
2020-07-17 14:51:02 -07:00
Matthew Christopher a408727b43
Update Azure SDK dependencies from v38 to v44 (#1233)
- Also update the other ancillary SDK dependencies such as ADAL, Auth, etc
2020-07-16 12:58:13 -07:00
Erin Corson 9d51ab1d26
Merge branch 'master' into app-insights-key 2020-07-09 13:13:37 -06:00
Erin Corson 1ea5aed18f add comment for ObjectID 2020-07-08 15:36:07 -06:00
Erin Corson e1d338a953 initial working code for app insights api keys 2020-07-08 10:07:42 -06:00
Erin Corson 31399df8ec
Merge branch 'master' into access-policy-postpone 2020-07-08 09:57:34 -06:00
Erin Corson 0b020c8407 change storageaccount alias to sacct to avoid service account alias collision 2020-07-02 13:29:27 -06:00
Melanie Rush 480872eb16 adding eventhubns shortname miss 2020-07-02 10:29:56 -06:00
Melanie Rush 5911034480 beta1 alpha2 sn 2020-07-02 10:29:56 -06:00
Melanie Rush 20c4a33768 sn 2020-07-02 10:29:56 -06:00
Melanie Rush b49544edd9 psql sn 2020-07-02 10:29:56 -06:00
Matthew Christopher 64ac94fad1
Improve error when SQL server doesn't have RG specified (#1174)
* Improve error when SQL server doesn't have RG specified

  - This fixes #1106.

* Update all occurances of Resourcegroup to have validation

  - They should be required, min length 1, and matching the specified
    Regex.

* Fix some tests

* PR feedback
2020-06-26 14:03:20 -07:00
Erin Corson a766f026df if the operator doesn't have application api permission, let the user supply the objectid isntead of client id 2020-06-25 22:52:01 -06:00
Erin Corson 81d50d3e63 allow ec keys as well as rsa 2020-06-10 13:35:11 -06:00
Hong Bu 28f4001ee2
Merge branch 'master' into UserManagerMySQL 2020-06-05 11:28:18 +08:00
Janani Vasudevan 33788ee363
Merge branch 'master' into rediscacheaction-reboot 2020-06-04 11:52:50 -06:00
jpflueger b310019965 Merge branch 'rediscacheaction-reboot' of github.com:jpflueger/azure-service-operator into rediscacheaction-reboot 2020-06-04 10:18:17 -06:00
jpflueger ad1580e356 addressing PR feedback 2020-06-04 10:18:12 -06:00
William Mortl c40f445748
Merge branch 'master' into rediscacheaction-reboot 2020-06-04 09:43:36 -06:00