Skip to content

Commit

Permalink
feat(sync): sync to none cluster when object is fed hpa
Browse files Browse the repository at this point in the history
  • Loading branch information
wy-lucky committed Dec 12, 2023
1 parent 070a686 commit 3a626c3
Show file tree
Hide file tree
Showing 16 changed files with 1,463 additions and 334 deletions.
4 changes: 2 additions & 2 deletions config/sample/host/01-ftc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -406,15 +406,15 @@ apiVersion: core.kubeadmiral.io/v1alpha1
kind: FederatedTypeConfig
metadata:
annotations:
hpa.kubeadmiral.io/scale-target-ref-path: spec.scaleTargetRef
kubeadmiral.io/scale-target-ref-path: spec.scaleTargetRef
name: horizontalpodautoscalers.autoscaling
spec:
sourceType:
group: autoscaling
kind: HorizontalPodAutoscaler
pluralName: horizontalpodautoscalers
scope: Namespaced
version: v1
version: v2beta2
controllers:
- - kubeadmiral.io/federatedhpa-controller
- - kubeadmiral.io/global-scheduler
Expand Down
10 changes: 4 additions & 6 deletions pkg/controllers/common/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ const (
TemplateGeneratorMergePatchAnnotation = FederateControllerPrefix + "template-generator-merge-patch"

LatestReplicasetDigestsAnnotation = DefaultPrefix + "latest-replicaset-digests"

HPAScaleTargetRefPath = DefaultPrefix + "scale-target-ref-path"

CentralizedHPAEnableKey = DefaultPrefix + "centralized-hpa-enabled"
)

// PropagatedAnnotationKeys and PropagatedLabelKeys are used to store the keys of annotations and labels that are present
Expand Down Expand Up @@ -190,9 +194,3 @@ var (
//
//nolint:lll
const MaxFederatedObjectNameLength = 253

// HPAScaleTargetRefPath defines the fed hpa annotations and labels
const (
HPAScaleTargetRefPath = DefaultPrefix + "scale-target-ref-path"
FedHPAEnableKey = DefaultPrefix + "fed-hpa-enabled"
)
Loading

0 comments on commit 3a626c3

Please sign in to comment.