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(pdb): add PodDisruptionBudget support #102

Merged
merged 2 commits into from
Nov 12, 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
21 changes: 12 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -369,13 +369,14 @@ ifneq ($(strip $(HELM_DEPENDS)),)
done
endif

.PHONY: helm-install
helm-install: helm-install-depends ## Install the helm chart.
$(HELM) upgrade --install --create-namespace --namespace $(TEST_NAMESPACE) --wait $(PROJECT_NAME) kubedoop/$(PROJECT_NAME) --version $(VERSION)

.PHONY: helm-uninstall
helm-uninstall: ## Uninstall the helm chart.
$(HELM) uninstall --namespace $(TEST_NAMESPACE) $(PROJECT_NAME)
## helm uninstall depends
.PHONY: helm-uninstall-depends
helm-uninstall-depends: ## Uninstall the helm chart depends.
ifneq ($(strip $(HELM_DEPENDS)),)
for dep in $(HELM_DEPENDS); do \
$(HELM) uninstall --namespace $(TEST_NAMESPACE) $$dep; \
done
endif

# kind
KIND_VERSION ?= v0.24.0
Expand Down Expand Up @@ -448,12 +449,14 @@ $(CHAINSAW): $(LOCALBIN)
chainsaw-setup: ## Run the chainsaw setup
make docker-build
$(KIND) --name $(KIND_CLUSTER_NAME) load docker-image $(IMG)
KUBECONFIG=$(KIND_KUBECONFIG) make helm-install
KUBECONFIG=$(KIND_KUBECONFIG) make helm-install-depends
KUBECONFIG=$(KIND_KUBECONFIG) make deploy

.PHONY: chainsaw-test
chainsaw-test: chainsaw ## Run the chainsaw test
KUBECONFIG=$(KIND_KUBECONFIG) $(CHAINSAW) test --cluster cluster-1=$(KIND_KUBECONFIG) --test-dir ./test/e2e/

.PHONY: chainsaw-cleanup
chainsaw-cleanup: ## Run the chainsaw cleanup
KUBECONFIG=$(KIND_KUBECONFIG) make helm-uninstall
KUBECONFIG=$(KIND_KUBECONFIG) make helm-uninstall-depends
KUBECONFIG=$(KIND_KUBECONFIG) make undeploy
5 changes: 1 addition & 4 deletions api/v1alpha1/master_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type MasterSpec struct {
RoleGroups map[string]MasterRoleGroupSpec `json:"roleGroups,omitempty"`

// +kubebuilder:validation:Optional
PodDisruptionBudget *commonsv1alpha1.PodDisruptionBudgetSpec `json:"podDisruptionBudget,omitempty"`
RoleConfig *commonsv1alpha1.RoleConfigSpec `json:"roleConfig,omitempty"`

// +kubebuilder:validation:Optional
CliOverrides []string `json:"cliOverrides,omitempty"`
Expand Down Expand Up @@ -60,9 +60,6 @@ type MasterRoleGroupSpec struct {
// +kubebuilder:validation:Optional
Config *MasterConfigSpec `json:"config,omitempty"`

// +kubebuilder:validation:Optional
PodDisruptionBudget *commonsv1alpha1.PodDisruptionBudgetSpec `json:"podDisruptionBudget,omitempty"`

// +kubebuilder:validation:Optional
CliOverrides []string `json:"cliOverrides,omitempty"`

Expand Down
6 changes: 2 additions & 4 deletions api/v1alpha1/regionserver_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ type RegionServerSpec struct {
// +kubebuilder:validation:Optional
RoleGroups map[string]RegionServerRoleGroupSpec `json:"roleGroups,omitempty"`

PodDisruptionBudget *commonsv1alpha1.PodDisruptionBudgetSpec `json:"podDisruptionBudget,omitempty"`
// +kubebuilder:validation:Optional
RoleConfig *commonsv1alpha1.RoleConfigSpec `json:"roleConfig,omitempty"`

// +kubebuilder:validation:Optional
CliOverrides []string `json:"cliOverrides,omitempty"`
Expand Down Expand Up @@ -58,9 +59,6 @@ type RegionServerRoleGroupSpec struct {
// +kubebuilder:validation:Optional
Config *RegionConfigSpec `json:"config,omitempty"`

// +kubebuilder:validation:Optional
PodDisruptionBudget *commonsv1alpha1.PodDisruptionBudgetSpec `json:"podDisruptionBudget,omitempty"`

// +kubebuilder:validation:Optional
CliOverrides []string `json:"cliOverrides,omitempty"`

Expand Down
5 changes: 1 addition & 4 deletions api/v1alpha1/restserver_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type RestServerSpec struct {
RoleGroups map[string]RestServerRoleGroupSpec `json:"roleGroups,omitempty"`

// +kubebuilder:validation:Optional
PodDisruptionBudget *commonsv1alpha1.PodDisruptionBudgetSpec `json:"podDisruptionBudget,omitempty"`
RoleConfig *commonsv1alpha1.RoleConfigSpec `json:"roleConfig,omitempty"`

// +kubebuilder:validation:Optional
CliOverrides []string `json:"cliOverrides,omitempty"`
Expand Down Expand Up @@ -60,9 +60,6 @@ type RestServerRoleGroupSpec struct {
// +kubebuilder:validation:Optional
Config *RestServerConfigSpec `json:"config,omitempty"`

// +kubebuilder:validation:Optional
PodDisruptionBudget *commonsv1alpha1.PodDisruptionBudgetSpec `json:"podDisruptionBudget,omitempty"`

// +kubebuilder:validation:Optional
CliOverrides []string `json:"cliOverrides,omitempty"`

Expand Down
45 changes: 15 additions & 30 deletions api/v1alpha1/zz_generated.deepcopy.go

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

Loading
Loading