Skip to content

Commit

Permalink
Add option to disable cluster roles
Browse files Browse the repository at this point in the history
Signed-off-by: Tamal Saha <[email protected]>
  • Loading branch information
tamalsaha committed Jan 30, 2025
1 parent 6730cc3 commit 5ace3e7
Show file tree
Hide file tree
Showing 62 changed files with 401 additions and 542 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ _testmain.go
/.idea
/.crds
/charts/kubedb/charts
/charts/kubedb-autoscaler/charts
/charts/kubedb-dashboard/charts
/charts/kubedb-ops-manager/charts
/charts/kubedb-opscenter/charts
/charts/kubedb-provisioner/charts
/charts/kubedb-schema-manager/charts
/charts/kubedb-ui-server/charts

.DS_Store
2 changes: 2 additions & 0 deletions apis/installer/v1alpha1/kubedb_autoscaler_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ type KubedbAutoscalerSpec struct {
Recommender Recommender `json:"recommender"`
// +optional
MaxConcurrentReconciles int `json:"maxConcurrentReconciles"`
// +optional
EnableClusterRoles ClusterRoleSpec `json:"enableClusterRoles"`
}

type StorageAutoscalerSpec struct {
Expand Down
2 changes: 2 additions & 0 deletions apis/installer/v1alpha1/kubedb_dashboard_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ type KubedbDashboardSpec struct {
License string `json:"license"`
// +optional
LicenseSecretName string `json:"licenseSecretName"`
// +optional
EnableClusterRoles ClusterRoleSpec `json:"enableClusterRoles"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down
2 changes: 2 additions & 0 deletions apis/installer/v1alpha1/kubedb_ops_manager_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ type KubedbOpsManagerSpec struct {
// +listType=map
// +listMapKey=name
Env []core.EnvVar `json:"env"`
// +optional
EnableClusterRoles ClusterRoleSpec `json:"enableClusterRoles"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down
2 changes: 2 additions & 0 deletions apis/installer/v1alpha1/kubedb_provisioner_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ type KubedbProvisionerSpec struct {
// +listType=map
// +listMapKey=name
Env []core.EnvVar `json:"env"`
// +optional
EnableClusterRoles ClusterRoleSpec `json:"enableClusterRoles"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down
2 changes: 2 additions & 0 deletions apis/installer/v1alpha1/kubedb_schema_manager_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ type KubedbSchemaManagerSpec struct {
LicenseSecretName string `json:"licenseSecretName"`
// +optional
MaxConcurrentReconciles int `json:"maxConcurrentReconciles"`
// +optional
EnableClusterRoles ClusterRoleSpec `json:"enableClusterRoles"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down
5 changes: 5 additions & 0 deletions apis/installer/v1alpha1/kubedb_ui_server_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@ type KubedbUiServerSpec struct {
ServiceAccount ServiceAccountSpec `json:"serviceAccount"`
Apiserver EASSpec `json:"apiserver"`
Monitoring EASMonitoring `json:"monitoring"`
// +optional
EnableClusterRoles KubedbUiClusterRoleSpec `json:"enableClusterRoles"`
}
type KubedbUiClusterRoleSpec struct {
UserRoles bool `json:"userRoles"`
}

// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
Expand Down
5 changes: 5 additions & 0 deletions apis/installer/v1alpha1/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,3 +103,8 @@ type PSPSpec struct {
type NetworkPolicy struct {
Enabled bool `json:"enabled"`
}

type ClusterRoleSpec struct {
LicenseProxyserver bool `json:"licenseProxyserver"`
UserRoles bool `json:"userRoles"`
}
38 changes: 38 additions & 0 deletions apis/installer/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion charts/kubedb-autoscaler/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v1
apiVersion: v2
description: KubeDB Autoscaler by AppsCode - Autoscale KubeDB operated Databases
name: kubedb-autoscaler
version: v0.36.0
Expand All @@ -10,3 +10,8 @@ sources:
maintainers:
- name: appscode
email: [email protected]
dependencies:
- name: license-proxyserver-user-roles
repository: oci://ghcr.io/appscode-charts
condition: enableClusterRoles.licenselicenseProxyserver
version: v2025.1.17
2 changes: 2 additions & 0 deletions charts/kubedb-autoscaler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ The following table lists the configurable parameters of the `kubedb-autoscaler`
| recommender.memoryHistogramDecayHalfLife | | <code>"5m0s"</code> |
| recommender.cpuHistogramDecayHalfLife | | <code>"5m0s"</code> |
| maxConcurrentReconciles | The maximum number of concurrent reconciles which can be run | <code>0</code> |
| enableClusterRoles.licenseProxyserver | | <code>true</code> |
| enableClusterRoles.userRoles | | <code>true</code> |


Specify each parameter using the `--set key=value[,key=value]` argument to `helm upgrade -i`. For example:
Expand Down
6 changes: 6 additions & 0 deletions charts/kubedb-autoscaler/requirements.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: license-proxyserver-user-roles
repository: oci://ghcr.io/appscode-charts
version: v2025.1.17
digest: sha256:d7528354ce2b160a823806f087f97f97870badcfa8973a7d7227ec8554addb24
generated: "2025-01-30T18:57:13.745044+06:00"

This file was deleted.

This file was deleted.

4 changes: 4 additions & 0 deletions charts/kubedb-autoscaler/templates/user-roles.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{{- if .Values.enableClusterRoles.userRoles }}

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
Expand Down Expand Up @@ -45,3 +47,5 @@ rules:
resources:
- "*"
verbs: ["get", "list", "watch"]

{{- end }}
10 changes: 10 additions & 0 deletions charts/kubedb-autoscaler/values.openapiv3_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,16 @@ properties:
type: object
criticalAddon:
type: boolean
enableClusterRoles:
properties:
licenseProxyserver:
type: boolean
userRoles:
type: boolean
required:
- licenseProxyserver
- userRoles
type: object
fullnameOverride:
type: string
imagePullPolicy:
Expand Down
4 changes: 4 additions & 0 deletions charts/kubedb-autoscaler/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -129,3 +129,7 @@ recommender:

# The maximum number of concurrent reconciles which can be run
maxConcurrentReconciles: 0

enableClusterRoles:
licenseProxyserver: true
userRoles: true
2 changes: 1 addition & 1 deletion charts/kubedb-catalog/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v1
apiVersion: v2
description: KubeDB Catalog by AppsCode - Catalog for database versions
name: kubedb-catalog
version: v2025.1.9
Expand Down
2 changes: 1 addition & 1 deletion charts/kubedb-crd-manager/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: v1
apiVersion: v2
description: KubeDB CRD Manager by AppsCode
name: kubedb-crd-manager
version: v0.6.0
Expand Down
6 changes: 6 additions & 0 deletions charts/kubedb-dashboard/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: license-proxyserver-user-roles
repository: oci://ghcr.io/appscode-charts
version: v2025.1.17
digest: sha256:d7528354ce2b160a823806f087f97f97870badcfa8973a7d7227ec8554addb24
generated: "2025-01-30T19:20:46.133997+06:00"
5 changes: 5 additions & 0 deletions charts/kubedb-dashboard/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,8 @@ sources:
maintainers:
- name: appscode
email: [email protected]
dependencies:
- name: license-proxyserver-user-roles
repository: oci://ghcr.io/appscode-charts
condition: enableClusterRoles.licenselicenseProxyserver
version: v2025.1.17
Loading

0 comments on commit 5ace3e7

Please sign in to comment.