Skip to content

Commit

Permalink
Change AzureMachinePool experiment API group to infrastructure.x-k8s.io
Browse files Browse the repository at this point in the history
  • Loading branch information
Cecile Robert-Michon committed May 27, 2021
1 parent b05ad4e commit 977e141
Show file tree
Hide file tree
Showing 48 changed files with 556 additions and 190 deletions.
16 changes: 0 additions & 16 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ def deploy_capi():
if core_extra_args:
for namespace in ["capi-system", "capi-webhook-system"]:
patch_args_with_extra_args(namespace, "capi-controller-manager", core_extra_args)
patch_capi_manager_role_with_exp_infra_rbac()
if extra_args.get("kubeadm-bootstrap"):
kb_extra_args = extra_args.get("kubeadm-bootstrap")
if kb_extra_args:
Expand All @@ -73,21 +72,6 @@ def patch_args_with_extra_args(namespace, name, extra_args):
local("kubectl patch deployment {} -n {} --type json -p='{}'".format(name, namespace, str(encode_json(patch)).replace("\n", "")))


# patch the CAPI manager role to also provide access to experimental infrastructure
def patch_capi_manager_role_with_exp_infra_rbac():
api_groups_str = str(local('kubectl get clusterrole capi-manager-role -o jsonpath={.rules[1].apiGroups}'))
exp_infra_group = "exp.infrastructure.cluster.x-k8s.io"
if exp_infra_group not in api_groups_str:
groups = api_groups_str[1:-1].split() # "[arg1 arg2 ...]" trim off the first and last, then split
groups.append(exp_infra_group)
patch = [{
"op": "replace",
"path": "/rules/1/apiGroups",
"value": groups,
}]
local("kubectl patch clusterrole capi-manager-role --type json -p='{}'".format(str(encode_json(patch)).replace("\n", "")))


# Users may define their own Tilt customizations in tilt.d. This directory is excluded from git and these files will
# not be checked in to version control.
def include_user_tilt_files():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.5.0
creationTimestamp: null
name: azuremachinepools.exp.infrastructure.cluster.x-k8s.io
name: azuremachinepools.infrastructure.cluster.x-k8s.io
spec:
group: exp.infrastructure.cluster.x-k8s.io
group: infrastructure.cluster.x-k8s.io
names:
categories:
- cluster-api
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.5.0
creationTimestamp: null
name: azuremanagedclusters.exp.infrastructure.cluster.x-k8s.io
name: azuremanagedclusters.infrastructure.cluster.x-k8s.io
spec:
group: exp.infrastructure.cluster.x-k8s.io
group: infrastructure.cluster.x-k8s.io
names:
categories:
- cluster-api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.5.0
creationTimestamp: null
name: azuremanagedcontrolplanes.exp.infrastructure.cluster.x-k8s.io
name: azuremanagedcontrolplanes.infrastructure.cluster.x-k8s.io
spec:
group: exp.infrastructure.cluster.x-k8s.io
group: infrastructure.cluster.x-k8s.io
names:
categories:
- cluster-api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.5.0
creationTimestamp: null
name: azuremanagedmachinepools.exp.infrastructure.cluster.x-k8s.io
name: azuremanagedmachinepools.infrastructure.cluster.x-k8s.io
spec:
group: exp.infrastructure.cluster.x-k8s.io
group: infrastructure.cluster.x-k8s.io
names:
categories:
- cluster-api
Expand Down
8 changes: 4 additions & 4 deletions config/crd/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ resources:
- bases/infrastructure.cluster.x-k8s.io_azureclusters.yaml
- bases/infrastructure.cluster.x-k8s.io_azuremachinetemplates.yaml
- bases/infrastructure.cluster.x-k8s.io_azureclusteridentities.yaml
- bases/exp.infrastructure.cluster.x-k8s.io_azuremachinepools.yaml
- bases/exp.infrastructure.cluster.x-k8s.io_azuremanagedmachinepools.yaml
- bases/exp.infrastructure.cluster.x-k8s.io_azuremanagedclusters.yaml
- bases/exp.infrastructure.cluster.x-k8s.io_azuremanagedcontrolplanes.yaml
- bases/infrastructure.cluster.x-k8s.io_azuremachinepools.yaml
- bases/infrastructure.cluster.x-k8s.io_azuremanagedmachinepools.yaml
- bases/infrastructure.cluster.x-k8s.io_azuremanagedclusters.yaml
- bases/infrastructure.cluster.x-k8s.io_azuremanagedcontrolplanes.yaml
# +kubebuilder:scaffold:crdkustomizeresource


Expand Down
2 changes: 1 addition & 1 deletion config/crd/patches/cainjection_in_azuremachinepools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ kind: CustomResourceDefinition
metadata:
annotations:
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
name: azuremachinepools.exp.infrastructure.cluster.x-k8s.io
name: azuremachinepools.infrastructure.cluster.x-k8s.io
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ kind: CustomResourceDefinition
metadata:
annotations:
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
name: azuremanagedclusters.exp.infrastructure.cluster.x-k8s.io
name: azuremanagedclusters.infrastructure.cluster.x-k8s.io
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ kind: CustomResourceDefinition
metadata:
annotations:
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
name: azuremanagedcontrolplanes.exp.infrastructure.cluster.x-k8s.io
name: azuremanagedcontrolplanes.infrastructure.cluster.x-k8s.io
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ kind: CustomResourceDefinition
metadata:
annotations:
cert-manager.io/inject-ca-from: $(CERTIFICATE_NAMESPACE)/$(CERTIFICATE_NAME)
name: azuremanagedmachinepools.exp.infrastructure.cluster.x-k8s.io
name: azuremanagedmachinepools.infrastructure.cluster.x-k8s.io
2 changes: 1 addition & 1 deletion config/crd/patches/webhook_in_azuremachinepools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: azuremachinepools.exp.infrastructure.cluster.x-k8s.io
name: azuremachinepools.infrastructure.cluster.x-k8s.io
spec:
conversion:
strategy: Webhook
Expand Down
2 changes: 1 addition & 1 deletion config/crd/patches/webhook_in_azuremanagedclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: azuremanagedclusters.exp.infrastructure.cluster.x-k8s.io
name: azuremanagedclusters.infrastructure.cluster.x-k8s.io
spec:
conversion:
strategy: Webhook
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: azuremanagedcontrolplanes.exp.infrastructure.cluster.x-k8s.io
name: azuremanagedcontrolplanes.infrastructure.cluster.x-k8s.io
spec:
conversion:
strategy: Webhook
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: azuremanagedmachinepools.exp.infrastructure.cluster.x-k8s.io
name: azuremanagedmachinepools.infrastructure.cluster.x-k8s.io
spec:
conversion:
strategy: Webhook
Expand Down
82 changes: 41 additions & 41 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,33 +60,34 @@ rules:
- apiGroups:
- cluster.x-k8s.io
resources:
- machines
- machines/status
- machinepools
- machinepools/status
verbs:
- get
- list
- watch
- apiGroups:
- ""
- cluster.x-k8s.io
resources:
- nodes
- machines
- machines/status
verbs:
- get
- list
- watch
- apiGroups:
- exp.cluster.x-k8s.io
- ""
resources:
- machinepools
- machinepools/status
- nodes
verbs:
- get
- list
- watch
- apiGroups:
- exp.infrastructure.cluster.x-k8s.io
- infrastructure.cluster.x-k8s.io
resources:
- azuremachinepools
- azureclusteridentities
- azureclusteridentities/status
verbs:
- create
- delete
Expand All @@ -96,17 +97,9 @@ rules:
- update
- watch
- apiGroups:
- exp.infrastructure.cluster.x-k8s.io
resources:
- azuremachinepools/status
verbs:
- get
- patch
- update
- apiGroups:
- exp.infrastructure.cluster.x-k8s.io
- infrastructure.cluster.x-k8s.io
resources:
- azuremanagedclusters
- azureclusters
verbs:
- create
- delete
Expand All @@ -116,17 +109,17 @@ rules:
- update
- watch
- apiGroups:
- exp.infrastructure.cluster.x-k8s.io
- infrastructure.cluster.x-k8s.io
resources:
- azuremanagedclusters/status
- azureclusters/status
verbs:
- get
- patch
- update
- apiGroups:
- exp.infrastructure.cluster.x-k8s.io
- infrastructure.cluster.x-k8s.io
resources:
- azuremanagedcontrolplanes
- azuremachinepools
verbs:
- create
- delete
Expand All @@ -136,17 +129,17 @@ rules:
- update
- watch
- apiGroups:
- exp.infrastructure.cluster.x-k8s.io
- infrastructure.cluster.x-k8s.io
resources:
- azuremanagedcontrolplanes/status
- azuremachinepools/status
verbs:
- get
- patch
- update
- apiGroups:
- exp.infrastructure.cluster.x-k8s.io
- infrastructure.cluster.x-k8s.io
resources:
- azuremanagedmachinepools
- azuremachines
verbs:
- create
- delete
Expand All @@ -156,30 +149,26 @@ rules:
- update
- watch
- apiGroups:
- exp.infrastructure.cluster.x-k8s.io
- infrastructure.cluster.x-k8s.io
resources:
- azuremanagedmachinepools/status
- azuremachines/status
verbs:
- get
- patch
- update
- apiGroups:
- infrastructure.cluster.x-k8s.io
resources:
- azureclusteridentities
- azureclusteridentities/status
- azuremachinetemplates
- azuremachinetemplates/status
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- infrastructure.cluster.x-k8s.io
resources:
- azureclusters
- azuremanagedclusters
verbs:
- create
- delete
Expand All @@ -191,15 +180,15 @@ rules:
- apiGroups:
- infrastructure.cluster.x-k8s.io
resources:
- azureclusters/status
- azuremanagedclusters/status
verbs:
- get
- patch
- update
- apiGroups:
- infrastructure.cluster.x-k8s.io
resources:
- azuremachines
- azuremanagedcontrolplanes
verbs:
- create
- delete
Expand All @@ -211,17 +200,28 @@ rules:
- apiGroups:
- infrastructure.cluster.x-k8s.io
resources:
- azuremachines/status
- azuremanagedcontrolplanes/status
verbs:
- get
- patch
- update
- apiGroups:
- infrastructure.cluster.x-k8s.io
resources:
- azuremachinetemplates
- azuremachinetemplates/status
- azuremanagedmachinepools
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- infrastructure.cluster.x-k8s.io
resources:
- azuremanagedmachinepools/status
verbs:
- get
- patch
- update
Loading

0 comments on commit 977e141

Please sign in to comment.