Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support creating management.catte.io/v3 cluster #1

Merged
merged 5 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ issues:
linters:
- testpackage
- gochecknoglobals
- path: internal/controllers/import_controller(_v3)?\.go
linters:
- dupl
- text: var-naming
linters:
- revive
Expand Down
2 changes: 1 addition & 1 deletion charts/rancher-turtles/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ spec:
containers:
- args:
- --leader-elect
- --feature-gates=rancher-kube-secret-patch={{ index .Values "rancherTurtles" "features" "rancher-kubeconfigs" "label"}}
- --feature-gates=managementv3-cluster={{ index .Values "rancherTurtles" "features" "managementv3-cluster" "enabled"}},rancher-kube-secret-patch={{ index .Values "rancherTurtles" "features" "rancher-kubeconfigs" "label"}}
{{- range .Values.rancherTurtles.managerArguments }}
- {{ . }}
{{- end }}
Expand Down
94 changes: 11 additions & 83 deletions charts/rancher-turtles/templates/rancher-turtles-components.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1751,77 +1751,23 @@ rules:
- clusters/status
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- cluster.x-k8s.io
resources:
- machinepools
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- cluster.x-k8s.io
resources:
- machinepools/finalizers
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- cluster.x-k8s.io
resources:
- machinepools/status
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- cluster.x-k8s.io
resources:
- machines
- machines/status
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- cluster.x-k8s.io
- coordination.k8s.io
resources:
- machinesets
- leases
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- cluster.x-k8s.io
- infrastructure.cluster.x-k8s.io
resources:
- machinesets/finalizers
- '*'
verbs:
- create
- delete
Expand All @@ -1831,47 +1777,29 @@ rules:
- update
- watch
- apiGroups:
- cluster.x-k8s.io
- management.cattle.io
resources:
- machinesets/status
- clusterregistrationtokens
- clusterregistrationtokens/status
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- create
- get
- update
- apiGroups:
- infrastructure.cluster.x-k8s.io
- management.cattle.io
resources:
- '*'
- clusters
- clusters/status
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
- update
- watch
- apiGroups:
- management.cattle.io
resources:
- clusterregistrationtokens
- clusterregistrationtokens/status
verbs:
- get
- list
- watch
- create
- apiGroups:
- provisioning.cattle.io
resources:
Expand Down
2 changes: 2 additions & 0 deletions charts/rancher-turtles/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ rancherTurtles:
kubectlImage: rancher/kubectl
rancher-kubeconfigs:
label: true
managementv3-cluster:
enabled: false
cluster-api-operator:
enabled: true
cert-manager:
Expand Down
94 changes: 11 additions & 83 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,77 +37,23 @@ rules:
- clusters/status
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- cluster.x-k8s.io
resources:
- machinepools
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- cluster.x-k8s.io
resources:
- machinepools/finalizers
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- cluster.x-k8s.io
resources:
- machinepools/status
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- cluster.x-k8s.io
resources:
- machines
- machines/status
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- cluster.x-k8s.io
- coordination.k8s.io
resources:
- machinesets
- leases
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- cluster.x-k8s.io
- infrastructure.cluster.x-k8s.io
resources:
- machinesets/finalizers
- '*'
verbs:
- create
- delete
Expand All @@ -117,47 +63,29 @@ rules:
- update
- watch
- apiGroups:
- cluster.x-k8s.io
- management.cattle.io
resources:
- machinesets/status
- clusterregistrationtokens
- clusterregistrationtokens/status
verbs:
- create
- delete
- get
- list
- patch
- update
- watch
- apiGroups:
- coordination.k8s.io
resources:
- leases
verbs:
- create
- get
- update
- apiGroups:
- infrastructure.cluster.x-k8s.io
- management.cattle.io
resources:
- '*'
- clusters
- clusters/status
verbs:
- create
- delete
- deletecollection
- get
- list
- patch
- update
- watch
- apiGroups:
- management.cattle.io
resources:
- clusterregistrationtokens
- clusterregistrationtokens/status
verbs:
- get
- list
- watch
- create
- apiGroups:
- provisioning.cattle.io
resources:
Expand Down
4 changes: 4 additions & 0 deletions feature/feature.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ const (
// RancherKubeSecretPatch is used to enable patching of the Rancher v2prov created kubeconfig
// secrets so that they can be used with CAPI 1.5.x.
RancherKubeSecretPatch featuregate.Feature = "rancher-kube-secret-patch" //nolint:gosec

// ManagementV3Cluster is used to enable the management.cattle.io/v3 cluster resource.
ManagementV3Cluster featuregate.Feature = "managementv3-cluster" //nolint:gosec
)

func init() {
Expand All @@ -33,4 +36,5 @@ func init() {

var defaultGates = map[featuregate.Feature]featuregate.FeatureSpec{
RancherKubeSecretPatch: {Default: false, PreRelease: featuregate.Beta},
ManagementV3Cluster: {Default: false, PreRelease: featuregate.Beta},
}
Loading
Loading