-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implemented Scheduled Capacity Metrics Producer
- Loading branch information
Showing
8 changed files
with
218 additions
and
466 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
apiVersion: autoscaling.karpenter.sh/v1alpha1 | ||
kind: MetricsProducer | ||
metadata: | ||
name: scheduling | ||
spec: | ||
scheduleSpec: | ||
timezone: America/Los_Angeles | ||
defaultReplicas: 1 | ||
behaviors: | ||
# leaving hours/minutes empty == specifying 0 | ||
# leaving every other field empty == * | ||
# single value (non-replicas) int fields need quotations | ||
# Scale way down for the weekend | ||
- replicas: 2 | ||
start: | ||
weekdays: fri | ||
hours: "17" | ||
end: | ||
weekdays: mon | ||
hours: "9" | ||
# Scale way up for higher traffic for weekdays during work hours | ||
- replicas: 6 | ||
start: | ||
weekdays: mon,tue,wed,thu,fri | ||
hours: "9" | ||
end: | ||
weekdays: Mon,Tue,Wed,Thu,Fri | ||
hours: "17" | ||
# Scale a little down for lower traffic for weekdays, but not as much as on the weekends | ||
- replicas: 4 | ||
start: | ||
weekdays: Mon,Tue,Wed,Thu,Fri | ||
hours: "17" | ||
end: | ||
weekdays: Mon,Tue,Wed,Thu,Fri | ||
hours: "9" | ||
--- | ||
apiVersion: autoscaling.karpenter.sh/v1alpha1 | ||
kind: HorizontalAutoscaler | ||
metadata: | ||
name: scheduled-autoscaler | ||
spec: | ||
scaleTargetRef: | ||
apiVersion: autoscaling.karpenter.sh/v1alpha1 | ||
kind: ScalableNodeGroup | ||
name: scheduled-nodegroup | ||
minReplicas: 1 | ||
maxReplicas: 10 | ||
metrics: | ||
- prometheus: | ||
query: karpenter_scheduled_capacity_recommendation{name="scheduling"} | ||
target: | ||
type: AverageValue | ||
value: 1 | ||
--- | ||
apiVersion: autoscaling.karpenter.sh/v1alpha1 | ||
kind: ScalableNodeGroup | ||
metadata: | ||
name: scheduled-nodegroup | ||
spec: | ||
replicas: 1 | ||
type: AWSEKSNodeGroup | ||
id: arn:aws:eks:us-west-2:112358132134:nodegroup/fibonacci/demo/qwertyuiop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package scheduledcapacity | ||
|
||
import "github.com/awslabs/karpenter/pkg/metrics" | ||
|
||
const ( | ||
Subsystem = "scheduled_capacity" | ||
) | ||
|
||
func init() { | ||
metrics.RegisterNewGauge(Subsystem, "recommendation") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.