From 149e9ea705d16f255893282d129747993051965f Mon Sep 17 00:00:00 2001 From: Jason Goodsell Date: Mon, 2 Sep 2019 18:15:08 +1000 Subject: [PATCH 1/8] Updated controllers to use `azure.microsoft.com` over `service.azure`. --- controllers/cosmosdb_controller.go | 4 ++-- controllers/rediscache_controller.go | 4 ++-- controllers/storage_controller.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/controllers/cosmosdb_controller.go b/controllers/cosmosdb_controller.go index 28d019538c7..4691d0619df 100644 --- a/controllers/cosmosdb_controller.go +++ b/controllers/cosmosdb_controller.go @@ -52,8 +52,8 @@ type CosmosDBReconciler struct { RequeueTime time.Duration } -// +kubebuilder:rbac:groups=service.azure,resources=cosmosdbs,verbs=get;list;watch;create;update;patch;delete -// +kubebuilder:rbac:groups=service.azure,resources=cosmosdbs/status,verbs=get;update;patch +// +kubebuilder:rbac:groups=azure.microsoft.com,resources=cosmosdbs,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=azure.microsoft.com,resources=cosmosdbs/status,verbs=get;update;patch // Reconcile function does the main reconciliation loop of the operator func (r *CosmosDBReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { diff --git a/controllers/rediscache_controller.go b/controllers/rediscache_controller.go index b8cfef9064c..ff0e0808938 100644 --- a/controllers/rediscache_controller.go +++ b/controllers/rediscache_controller.go @@ -52,8 +52,8 @@ type RedisCacheReconciler struct { RequeueTime time.Duration } -// +kubebuilder:rbac:groups=service.azure,resources=rediscaches,verbs=get;list;watch;create;update;patch;delete -// +kubebuilder:rbac:groups=service.azure,resources=rediscaches/status,verbs=get;update;patch +// +kubebuilder:rbac:groups=azure.microsoft.com,resources=rediscaches,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=azure.microsoft.com,resources=rediscaches/status,verbs=get;update;patch func (r *RedisCacheReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { ctx := context.Background() diff --git a/controllers/storage_controller.go b/controllers/storage_controller.go index 6408f88709f..d96ce920007 100644 --- a/controllers/storage_controller.go +++ b/controllers/storage_controller.go @@ -52,8 +52,8 @@ type StorageReconciler struct { RequeueTime time.Duration } -// +kubebuilder:rbac:groups=service.azure,resources=storages,verbs=get;list;watch;create;update;patch;delete -// +kubebuilder:rbac:groups=service.azure,resources=storages/status,verbs=get;update;patch +// +kubebuilder:rbac:groups=azure.microsoft.com,resources=storages,verbs=get;list;watch;create;update;patch;delete +// +kubebuilder:rbac:groups=azure.microsoft.com,resources=storages/status,verbs=get;update;patch // Reconcile function does the main reconciliation loop of the operator func (r *StorageReconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) { From ec378d8c53d11e489d61957e213a0643e52e9234 Mon Sep 17 00:00:00 2001 From: Jason Goodsell Date: Mon, 2 Sep 2019 18:15:48 +1000 Subject: [PATCH 2/8] Updated webhooks to point to `azure.microsoft.com`. --- config/crd/patches/webhook_in_cosmosdbs.yaml | 2 +- config/crd/patches/webhook_in_rediscaches.yaml | 2 +- config/crd/patches/webhook_in_storages.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/crd/patches/webhook_in_cosmosdbs.yaml b/config/crd/patches/webhook_in_cosmosdbs.yaml index 7ecf9d9fe29..d06ad93537e 100644 --- a/config/crd/patches/webhook_in_cosmosdbs.yaml +++ b/config/crd/patches/webhook_in_cosmosdbs.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: - name: cosmosdbs.service.azure + name: cosmosdbs.azure.microsoft.com spec: conversion: strategy: Webhook diff --git a/config/crd/patches/webhook_in_rediscaches.yaml b/config/crd/patches/webhook_in_rediscaches.yaml index 3a0e04368dc..21f9b0e36d9 100644 --- a/config/crd/patches/webhook_in_rediscaches.yaml +++ b/config/crd/patches/webhook_in_rediscaches.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: - name: rediscaches.service.azure + name: rediscaches.azure.microsoft.com spec: conversion: strategy: Webhook diff --git a/config/crd/patches/webhook_in_storages.yaml b/config/crd/patches/webhook_in_storages.yaml index 5811750b289..51d315b7a6e 100644 --- a/config/crd/patches/webhook_in_storages.yaml +++ b/config/crd/patches/webhook_in_storages.yaml @@ -3,7 +3,7 @@ apiVersion: apiextensions.k8s.io/v1beta1 kind: CustomResourceDefinition metadata: - name: storages.service.azure + name: storages.azure.microsoft.com spec: conversion: strategy: Webhook From 0fb8edd5205d57e816e520b8bcaeee4a84e87d8e Mon Sep 17 00:00:00 2001 From: Jason Goodsell Date: Mon, 2 Sep 2019 18:16:02 +1000 Subject: [PATCH 3/8] Updated caninject to point to `azure.microsoft.com`. --- config/crd/patches/cainjection_in_cosmosdbs.yaml | 2 +- config/crd/patches/cainjection_in_rediscaches.yaml | 2 +- config/crd/patches/cainjection_in_storages.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/config/crd/patches/cainjection_in_cosmosdbs.yaml b/config/crd/patches/cainjection_in_cosmosdbs.yaml index d14bfce13fd..d46088c8c24 100644 --- a/config/crd/patches/cainjection_in_cosmosdbs.yaml +++ b/config/crd/patches/cainjection_in_cosmosdbs.yaml @@ -5,4 +5,4 @@ kind: CustomResourceDefinition metadata: annotations: certmanager.k8s.io/inject-ca-from: $(NAMESPACE)/$(CERTIFICATENAME) - name: cosmosdbs.service.azure + name: cosmosdbs.azure.microsoft.com diff --git a/config/crd/patches/cainjection_in_rediscaches.yaml b/config/crd/patches/cainjection_in_rediscaches.yaml index 56a5e83784e..0945e3cbe00 100644 --- a/config/crd/patches/cainjection_in_rediscaches.yaml +++ b/config/crd/patches/cainjection_in_rediscaches.yaml @@ -5,4 +5,4 @@ kind: CustomResourceDefinition metadata: annotations: certmanager.k8s.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME) - name: rediscaches.service.azure + name: rediscaches.azure.microsoft.com diff --git a/config/crd/patches/cainjection_in_storages.yaml b/config/crd/patches/cainjection_in_storages.yaml index e371d696a51..a5669e97b77 100644 --- a/config/crd/patches/cainjection_in_storages.yaml +++ b/config/crd/patches/cainjection_in_storages.yaml @@ -5,4 +5,4 @@ kind: CustomResourceDefinition metadata: annotations: certmanager.k8s.io/inject-ca-from: $(NAMESPACE)/$(CERTIFICATENAME) - name: storages.service.azure + name: storages.azure.microsoft.com From 08d241ea73bb195c24199f93444740e2c432655f Mon Sep 17 00:00:00 2001 From: Jason Goodsell Date: Mon, 2 Sep 2019 18:16:35 +1000 Subject: [PATCH 4/8] Regenerated role.yaml. --- config/default/manager_role_patch.yaml | 12 +-- config/rbac/role.yaml | 102 ++++++++++++------------- 2 files changed, 57 insertions(+), 57 deletions(-) diff --git a/config/default/manager_role_patch.yaml b/config/default/manager_role_patch.yaml index ecf4ba85b76..958bbcc3a46 100644 --- a/config/default/manager_role_patch.yaml +++ b/config/default/manager_role_patch.yaml @@ -7,7 +7,7 @@ metadata: name: manager-role rules: - apiGroups: - - service.azure + - azure.microsoft.com resources: - cosmosdbs verbs: @@ -19,7 +19,7 @@ rules: - update - watch - apiGroups: - - service.azure + - azure.microsoft.com resources: - cosmosdbs/status verbs: @@ -27,7 +27,7 @@ rules: - patch - update - apiGroups: - - service.azure + - azure.microsoft.com resources: - rediscaches verbs: @@ -39,7 +39,7 @@ rules: - update - watch - apiGroups: - - service.azure + - azure.microsoft.com resources: - rediscaches/status verbs: @@ -47,7 +47,7 @@ rules: - patch - update - apiGroups: - - service.azure + - azure.microsoft.com resources: - storages verbs: @@ -59,7 +59,7 @@ rules: - update - watch - apiGroups: - - service.azure + - azure.microsoft.com resources: - storages/status verbs: diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index 76953cf089a..020cb9cc2e1 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -9,39 +9,34 @@ rules: - apiGroups: - azure.microsoft.com resources: - - eventhubnamespaces + - consumergroups/status verbs: - - create - - delete - get - - list - patch - update - - watch - apiGroups: - azure.microsoft.com resources: - - eventhubnamespaces/status + - eventhubs verbs: + - create + - delete - get + - list - patch - update + - watch - apiGroups: - azure.microsoft.com resources: - - keyvaults + - events verbs: - create - - delete - - get - - list - patch - - update - - watch - apiGroups: - - service.azure + - apps resources: - - rediscaches/status + - deployments/status verbs: - get - patch @@ -49,15 +44,15 @@ rules: - apiGroups: - azure.microsoft.com resources: - - resourcegroups/status + - cosmosdbs/status verbs: - get - patch - update - apiGroups: - - "" + - azure.microsoft.com resources: - - secrets + - eventhubnamespaces verbs: - create - delete @@ -67,16 +62,21 @@ rules: - update - watch - apiGroups: - - "" + - azure.microsoft.com resources: - - events + - keyvaults verbs: - create + - delete + - get + - list + - patch + - update - watch - apiGroups: - azure.microsoft.com resources: - - eventhubs + - rediscaches verbs: - create - delete @@ -86,9 +86,9 @@ rules: - update - watch - apiGroups: - - apps + - azure.microsoft.com resources: - - deployments/status + - storages/status verbs: - get - patch @@ -108,63 +108,62 @@ rules: - apiGroups: - azure.microsoft.com resources: - - eventhubs/status + - consumergroups verbs: + - create + - delete - get + - list - patch - update + - watch - apiGroups: - azure.microsoft.com resources: - - keyvaults/status + - eventhubnamespaces/status verbs: - get - patch - update - apiGroups: - - service.azure + - azure.microsoft.com resources: - - storages/status + - keyvaults/status verbs: - get - patch - update - apiGroups: - - service.azure + - azure.microsoft.com resources: - - cosmosdbs + - rediscaches/status verbs: - - create - - delete - get - - list - patch - update - - watch - apiGroups: - azure.microsoft.com resources: - - consumergroups/status + - resourcegroups verbs: + - create + - delete - get + - list - patch - update + - watch - apiGroups: - - service.azure + - "" resources: - - rediscaches + - events verbs: - create - - delete - - get - - list - - patch - - update - watch - apiGroups: - azure.microsoft.com resources: - - resourcegroups + - cosmosdbs verbs: - create - delete @@ -176,24 +175,21 @@ rules: - apiGroups: - azure.microsoft.com resources: - - events + - eventhubs/status verbs: - - create + - get - patch + - update - apiGroups: - azure.microsoft.com resources: - - consumergroups + - resourcegroups/status verbs: - - create - - delete - get - - list - patch - update - - watch - apiGroups: - - service.azure + - azure.microsoft.com resources: - storages verbs: @@ -205,10 +201,14 @@ rules: - update - watch - apiGroups: - - service.azure + - "" resources: - - cosmosdbs/status + - secrets verbs: + - create + - delete - get + - list - patch - update + - watch From df6dee3be032670f8abd8e4e67981bf56408aaca Mon Sep 17 00:00:00 2001 From: Jason Goodsell Date: Mon, 2 Sep 2019 18:17:00 +1000 Subject: [PATCH 5/8] Point kustomization.yaml in CRD to right base CRDs. --- config/crd/kustomization.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/crd/kustomization.yaml b/config/crd/kustomization.yaml index d2d171c55e8..75e2efb5492 100644 --- a/config/crd/kustomization.yaml +++ b/config/crd/kustomization.yaml @@ -2,9 +2,9 @@ # since it depends on service name and namespace that are out of this kustomize package. # It should be run by config/default resources: -- bases/service.azure_storages.yaml -- bases/service.azure_cosmosdbs.yaml -- bases/service.azure_rediscaches.yaml +- bases/azure.microsoft.com_storages.yaml +- bases/azure.microsoft.com_cosmosdbs.yaml +- bases/azure.microsoft.com_rediscaches.yaml - bases/azure.microsoft.com_eventhubs.yaml - bases/azure.microsoft.com_resourcegroups.yaml - bases/azure.microsoft.com_eventhubnamespaces.yaml From 11f567b0770aed0aa3c3842adab020a2a785945b Mon Sep 17 00:00:00 2001 From: Jason Goodsell Date: Mon, 2 Sep 2019 18:17:12 +1000 Subject: [PATCH 6/8] Updated demo. --- examples/demo/azure-vote-app-redis.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/demo/azure-vote-app-redis.yaml b/examples/demo/azure-vote-app-redis.yaml index 6609a498a14..a15c582af8e 100644 --- a/examples/demo/azure-vote-app-redis.yaml +++ b/examples/demo/azure-vote-app-redis.yaml @@ -1,4 +1,4 @@ -apiVersion: service.azure/v1alpha1 +apiVersion: azure.microsoft.com/v1alpha1 kind: RedisCache metadata: name: azure-redis From 69f0b1b84954b5a68c3fac83d9d7c95d34449934 Mon Sep 17 00:00:00 2001 From: Jason Goodsell Date: Mon, 2 Sep 2019 22:50:46 +1000 Subject: [PATCH 7/8] Role update. --- config/rbac/role.yaml | 96 ++++++++++++++++++++++--------------------- 1 file changed, 49 insertions(+), 47 deletions(-) diff --git a/config/rbac/role.yaml b/config/rbac/role.yaml index d27f1bb3677..3ce5e03273b 100644 --- a/config/rbac/role.yaml +++ b/config/rbac/role.yaml @@ -9,23 +9,23 @@ rules: - apiGroups: - azure.microsoft.com resources: - - consumergroups/status + - cosmosdbs verbs: + - create + - delete - get + - list - patch - update + - watch - apiGroups: - azure.microsoft.com resources: - - eventhubs + - eventhubnamespaces/status verbs: - - create - - delete - get - - list - patch - update - - watch - apiGroups: - azure.microsoft.com resources: @@ -34,17 +34,21 @@ rules: - create - patch - apiGroups: - - apps + - azure.microsoft.com resources: - - deployments/status + - consumergroups verbs: + - create + - delete - get + - list - patch - update + - watch - apiGroups: - azure.microsoft.com resources: - - cosmosdbs/status + - consumergroups/status verbs: - get - patch @@ -52,7 +56,7 @@ rules: - apiGroups: - azure.microsoft.com resources: - - eventhubnamespaces + - resourcegroups verbs: - create - delete @@ -64,15 +68,19 @@ rules: - apiGroups: - azure.microsoft.com resources: - - eventhubnamespaces/status + - storages verbs: + - create + - delete - get + - list - patch - update + - watch - apiGroups: - - azure.microsoft.com + - "" resources: - - rediscaches + - secrets verbs: - create - delete @@ -84,22 +92,15 @@ rules: - apiGroups: - azure.microsoft.com resources: - - storages/status + - eventhubs/status verbs: - get - patch - update - apiGroups: - - apps - resources: - - deployments - verbs: - - create - - patch -- apiGroups: - - apps + - azure.microsoft.com resources: - - deployments + - eventhubnamespaces verbs: - create - delete @@ -111,7 +112,7 @@ rules: - apiGroups: - azure.microsoft.com resources: - - consumergroups + - keyvaults verbs: - create - delete @@ -123,23 +124,22 @@ rules: - apiGroups: - azure.microsoft.com resources: - - eventhubnamespaces/status + - rediscaches/status verbs: - get - patch - update - apiGroups: - - azure.microsoft.com + - "" resources: - - keyvaults/status + - events verbs: - - get - - patch - - update + - create + - watch - apiGroups: - azure.microsoft.com resources: - - rediscaches/status + - cosmosdbs/status verbs: - get - patch @@ -147,7 +147,7 @@ rules: - apiGroups: - azure.microsoft.com resources: - - resourcegroups + - eventhubs verbs: - create - delete @@ -157,16 +157,17 @@ rules: - update - watch - apiGroups: - - "" + - azure.microsoft.com resources: - - events + - keyvaults/status verbs: - - create - - watch + - get + - patch + - update - apiGroups: - azure.microsoft.com resources: - - cosmosdbs + - rediscaches verbs: - create - delete @@ -178,7 +179,7 @@ rules: - apiGroups: - azure.microsoft.com resources: - - eventhubs/status + - resourcegroups/status verbs: - get - patch @@ -186,27 +187,28 @@ rules: - apiGroups: - azure.microsoft.com resources: - - resourcegroups/status + - storages/status verbs: - get - patch - update - apiGroups: - - azure.microsoft.com + - apps resources: - - storages + - deployments verbs: - create + - delete + - get + - list + - patch + - update - watch - apiGroups: - - "" + - apps resources: - - secrets + - deployments/status verbs: - - create - - delete - get - - list - patch - update - - watch From 3717aafe1ce8370c43a1a94e135803d5c9b23576 Mon Sep 17 00:00:00 2001 From: Jason Goodsell Date: Tue, 3 Sep 2019 11:01:28 +1000 Subject: [PATCH 8/8] Update group from service to azure in PROJECT. --- PROJECT | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PROJECT b/PROJECT index bf33b59a4d7..934b81867b5 100644 --- a/PROJECT +++ b/PROJECT @@ -2,13 +2,13 @@ version: "2" domain: microsoft.com repo: github.com/Azure/azure-service-operator resources: -- group: service +- group: azure version: v1 kind: Storage -- group: service +- group: azure version: v1 kind: CosmosDB -- group: service +- group: azure version: v1 kind: RedisCache - group: azure