Skip to content
This repository has been archived by the owner on Feb 2, 2024. It is now read-only.

Commit

Permalink
remove hvpa (#24)
Browse files Browse the repository at this point in the history
  • Loading branch information
reshnm authored Jun 24, 2022
1 parent 21ce4dd commit e5ebe69
Show file tree
Hide file tree
Showing 32 changed files with 43 additions and 3,229 deletions.
42 changes: 0 additions & 42 deletions .landscaper/blueprint/blueprint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ imports:
handleETCDPersistentVolumes:
description: "If true, the persistent volumes for the etcds are also deleted."
type: boolean
hvpaEnabled:
type: boolean
kubeAPIServer:
type: object
properties:
Expand Down Expand Up @@ -150,46 +148,6 @@ imports:
type: boolean
certificateAuthorityData:
type: string
hvpaEnabled:
type: boolean
hvpa:
type: object
properties:
maxReplicas:
type: integer
minReplicas:
type: integer
targetAverageUtilizationCpu:
type: integer
targetAverageUtilizationMemory:
type: integer
vpaScaleUpMode:
type: string
vpaScaleDownMode:
type: string
vpaScaleUpStabilization:
type: object
properties:
stabilizationDuration:
type: string
minChange:
"$ref": "#/definitions/scaleParams"
vpaScaleDownStabilization:
type: object
properties:
stabilizationDuration:
type: string
minChange:
"$ref": "#/definitions/scaleParams"
limitsRequestsGapScaleParams:
"$ref": "#/definitions/scaleParams"
maintenanceWindow:
type: object
properties:
begin:
type: string
end:
type: string
eventTTL:
type: string
oidcIssuerURL:
Expand Down
8 changes: 2 additions & 6 deletions cmd/virtual-garden/app/virtual_garden.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,13 @@ import (
"github.com/gardener/virtual-garden/pkg/api/validation"
"github.com/gardener/virtual-garden/pkg/virtualgarden"

hvpav1alpha1 "github.com/gardener/hvpa-controller/api/v1alpha1"
lsv1alpha1 "github.com/gardener/landscaper/apis/core/v1alpha1"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
apiextensionsv1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
"k8s.io/apimachinery/pkg/runtime"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
autoscalingv1beta2 "k8s.io/autoscaler/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1beta2"
kubernetesscheme "k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/tools/clientcmd"
"k8s.io/component-base/version/verflag"
Expand Down Expand Up @@ -178,9 +176,7 @@ func NewClientFromKubeconfig(kubeconfig []byte) (client.Client, error) {

scheme := runtime.NewScheme()
utilruntime.Must(kubernetesscheme.AddToScheme(scheme))
utilruntime.Must(hvpav1alpha1.AddToScheme(scheme))
utilruntime.Must(autoscalingv1beta2.AddToScheme(scheme))
utilruntime.Must(apiextensionsv1beta1.AddToScheme(scheme))
utilruntime.Must(apiextensionsv1.AddToScheme(scheme))

return client.New(restConfig, client.Options{Scheme: scheme})
}
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ require (
github.com/gardener/component-cli v0.36.0
github.com/gardener/component-spec/bindings-go v0.0.53
github.com/gardener/gardener v1.26.0
github.com/gardener/hvpa-controller v0.3.1
github.com/gardener/landscaper/apis v0.20.0
github.com/ghodss/yaml v1.0.0
github.com/golang/mock v1.6.0
Expand All @@ -25,7 +24,6 @@ require (
k8s.io/apiextensions-apiserver v0.21.2
k8s.io/apimachinery v0.21.2
k8s.io/apiserver v0.21.2
k8s.io/autoscaler v0.0.0-20190805135949-100e91ba756e
k8s.io/client-go v11.0.1-0.20190409021438-1a26190bd76a+incompatible
k8s.io/component-base v0.21.2
k8s.io/utils v0.0.0-20210527160623-6fdb442a123b
Expand Down
2 changes: 1 addition & 1 deletion hack/install-requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ set -e
CURRENT_DIR=$(dirname $0)
PROJECT_ROOT="${CURRENT_DIR}"/..

curl -sfL "https://install.goreleaser.com/github.com/golangci/golangci-lint.sh" | sh -s -- -b $(go env GOPATH)/bin v1.32.2
curl -sfL "https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh" | sh -s -- -b $(go env GOPATH)/bin v1.32.2

GO111MODULE=off go get golang.org/x/tools/cmd/goimports

9 changes: 8 additions & 1 deletion hack/setup-testenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,14 @@ echo "> Setup Test Environment for K8s Version ${K8S_VERSION}"

CURRENT_DIR=$(dirname $0)
PROJECT_ROOT="${CURRENT_DIR}"/..
export KUBEBUILDER_ASSETS=$(setup-envtest use -p path ${K8S_VERSION})

ARCH_ARG=""
if [[ $(go env GOOS) == "darwin" && $(go env GOARCH) == "arm64" ]]; then
ARCH_ARG="--arch amd64"
fi

export KUBEBUILDER_ASSETS=$(setup-envtest use -p path ${K8S_VERSION} ${ARCH_ARG})

mkdir -p ${PROJECT_ROOT}/tmp/test
rm -f ${PROJECT_ROOT}/tmp/test/bin
ln -s "${KUBEBUILDER_ASSETS}" ${PROJECT_ROOT}/tmp/test/bin
5 changes: 0 additions & 5 deletions pkg/api/helper/helper.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,3 @@ func KubeAPIServerSNIEnabled(kubeAPIServer *api.KubeAPIServer) bool {
func ETCDBackupEnabled(etcd *api.ETCD) bool {
return etcd != nil && etcd.Backup != nil
}

// ETCDHVPAEnabled returns true if the etcd HVPA settings are configured.
func ETCDHVPAEnabled(etcd *api.ETCD) bool {
return etcd != nil && etcd.HVPAEnabled
}
9 changes: 0 additions & 9 deletions pkg/api/helper/helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,4 @@ var _ = Describe("Helper", func() {
Entry("backup is nil", &api.ETCD{}, BeFalse()),
Entry("backup is not nil", &api.ETCD{Backup: &api.ETCDBackup{}}, BeTrue()),
)

DescribeTable("#ETCDHVPAEnabled",
func(etcd *api.ETCD, matcher types.GomegaMatcher) {
Expect(ETCDHVPAEnabled(etcd)).To(matcher)
},

Entry("etcd is nil", nil, BeFalse()),
Entry("hvpa is nil", &api.ETCD{}, BeFalse()),
)
})
152 changes: 0 additions & 152 deletions pkg/api/hvpa_types.go

This file was deleted.

16 changes: 0 additions & 16 deletions pkg/api/imports.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,6 @@ type ETCD struct {
// +optional
Backup *ETCDBackup `json:"backup,omitempty" yaml:"backup,omitempty"`

HVPAEnabled bool `json:"hvpaEnabled,omitempty" yaml:"hvpaEnabled,omitempty"`

// HandleETCDPersistentVolumes defines whether the PV(C)s that are getting automatically created by the etcd
// statefulset shall be handled or not (false by default). If true then they will be deleted when the virtual
// garden is deleted. Otherwise, they will remain in the system for manual cleanup (to prevent data loss).
Expand Down Expand Up @@ -118,17 +116,12 @@ type KubeAPIServer struct {

OidcWebhookAuthenticator OidcWebhookAuthenticator `json:"oidcWebhookAuthenticator,omitempty" yaml:"oidcWebhookAuthenticator,omitempty"`

HVPAEnabled bool `json:"hvpaEnabled,omitempty" yaml:"hvpaEnabled,omitempty"`
HVPA *HvpaConfig `json:"hvpa,omitempty" yaml:"hvpa,omitempty"`

EventTTL *string `json:"eventTTL,omitempty" yaml:"eventTTL,omitempty"`
OidcIssuerURL *string `json:"oidcIssuerURL,omitempty" yaml:"oidcIssuerURL,omitempty"`

AdditionalVolumeMounts []corev1.VolumeMount `json:"additionalVolumeMounts,omitempty" yaml:"additionalVolumeMounts,omitempty"`
AdditionalVolumes []corev1.Volume `json:"additionalVolumes,omitempty" yaml:"additionalVolumes,omitempty"`

HorizontalPodAutoscaler *HorizontalPodAutoscaler `json:"horizontalPodAutoscaler,omitempty" yaml:"horizontalPodAutoscaler,omitempty"`

MaxRequestsInflight *int `json:"maxRequestsInflight,omitempty" yaml:"maxRequestsInflight,omitempty"`
MaxMutatingRequestsInflight *int `json:"maxMutatingRequestsInflight,omitempty" yaml:"maxMutatingRequestsInflight,omitempty"`

Expand All @@ -149,15 +142,6 @@ func (r *KubeAPIServer) GetMaxMutatingRequestsInflight(defaultValue int) int {
return *r.MaxMutatingRequestsInflight
}

// HorizontalPodAutoscaler contains configuration for the horizontal pod auto scaler.
type HorizontalPodAutoscaler struct {
DownscaleStabilization string `json:"downscaleStabilization,omitempty" yaml:"downscaleStabilization,omitempty"`
ReadinessDelay string `json:"readinessDelay,omitempty" yaml:"readinessDelay,omitempty"`
CpuInitializationPeriod string `json:"cpuInitializationPeriod,omitempty" yaml:"cpuInitializationPeriod,omitempty"`
SyncPeriod string `json:"syncPeriod,omitempty" yaml:"syncPeriod,omitempty"`
Tolerance string `json:"tolerance,omitempty" yaml:"tolerance,omitempty"`
}

// GardenerControlplane contains the activation info for webhooks
type GardenerControlplane struct {
ValidatingWebhook AdmissionWebhookConfig `json:"validatingWebhook,omitempty" yaml:"validatingWebhook,omitempty"`
Expand Down
Loading

0 comments on commit e5ebe69

Please sign in to comment.