Skip to content

Commit bf21e85

Browse files
Support manually update resources based on vpa
1 parent fa5cebb commit bf21e85

28 files changed

+4321
-122
lines changed

api/compute/v1alpha1/common.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
"fmt"
2323
"strconv"
2424

25+
"k8s.io/apimachinery/pkg/api/resource"
2526
vpav1 "k8s.io/autoscaler/vertical-pod-autoscaler/pkg/apis/autoscaling.k8s.io/v1"
2627

2728
autov2 "k8s.io/api/autoscaling/v2"
@@ -558,6 +559,19 @@ type VPASpec struct {
558559
// Controls how the autoscaler computes recommended resources.
559560
// +optional
560561
ResourcePolicy *vpav1.PodResourcePolicy `json:"resourcePolicy,omitempty"`
562+
563+
// Whether the function or connector has a special resource unit
564+
// if yes, the vpa should not update the pod resources automatically
565+
// +optional
566+
ResourceUnit *ResourceUnit `json:"resourceUnit,omitempty"`
567+
}
568+
569+
type ResourceUnit struct {
570+
// The CPU request for the pod
571+
Cpu resource.Quantity `json:"cpu,omitempty"`
572+
573+
// The memory request for the pod
574+
Memory resource.Quantity `json:"memory,omitempty"`
561575
}
562576

563577
type Liveness struct {

api/compute/v1alpha1/zz_generated.deepcopy.go

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

charts/function-mesh-operator/charts/admission-webhook/templates/crd-compute.functionmesh.io-backendconfigs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ metadata:
66
{{- if eq .Values.admissionWebhook.certificate.provider "cert-manager" }}
77
{{- include "function-mesh-operator.certManager.annotation" . | nindent 4 -}}
88
{{- end }}
9-
controller-gen.kubebuilder.io/version: v0.9.2
9+
controller-gen.kubebuilder.io/version: v0.15.0
1010
name: backendconfigs.compute.functionmesh.io
1111
spec:
1212
conversion:

charts/function-mesh-operator/charts/admission-webhook/templates/crd-compute.functionmesh.io-functionmeshes.yaml

Lines changed: 603 additions & 7 deletions
Large diffs are not rendered by default.

charts/function-mesh-operator/charts/admission-webhook/templates/crd-compute.functionmesh.io-functions.yaml

Lines changed: 215 additions & 5 deletions
Large diffs are not rendered by default.

charts/function-mesh-operator/charts/admission-webhook/templates/crd-compute.functionmesh.io-sinks.yaml

Lines changed: 195 additions & 2 deletions
Large diffs are not rendered by default.

charts/function-mesh-operator/charts/admission-webhook/templates/crd-compute.functionmesh.io-sources.yaml

Lines changed: 195 additions & 2 deletions
Large diffs are not rendered by default.

config/crd/bases/compute.functionmesh.io_backendconfigs.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ apiVersion: apiextensions.k8s.io/v1
33
kind: CustomResourceDefinition
44
metadata:
55
annotations:
6-
controller-gen.kubebuilder.io/version: v0.9.2
7-
creationTimestamp: null
6+
controller-gen.kubebuilder.io/version: v0.15.0
87
name: backendconfigs.compute.functionmesh.io
98
spec:
109
group: compute.functionmesh.io

config/crd/bases/compute.functionmesh.io_functionmeshes.yaml

Lines changed: 603 additions & 8 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)