diff --git a/apps/vertical-pod-autoscaler/Makefile b/apps/vertical-pod-autoscaler/Makefile new file mode 100644 index 00000000..76fcc021 --- /dev/null +++ b/apps/vertical-pod-autoscaler/Makefile @@ -0,0 +1,28 @@ +SHELL = /usr/bin/env bash + +# Find HelmRelease and Source files +release := $(shell yq '. | select(.kind=="HelmRelease") | filename' *.yaml) +source := $(shell yq '. | select(.kind=="HelmRepository") | filename' *.yaml) + +# Fetch data from HelmRepository and HelmRelease +name := $(shell yq '.metadata.name' $(release)) +namespace := $(shell yq '.metadata.namespace' $(release)) +version := $(shell yq '.spec.chart.spec.version' $(release)) +chart := $(shell yq '.spec.chart.spec.chart' $(release)) +values := yq '.spec.values' $(release) +url := $(shell yq '.spec.url' $(source)) + +# Run all tasks +all: crds.yaml manifests + +# Generate CRDs with helm +crds.yaml: $(release) $(source) + helm show crds $(chart) --repo $(url) --version $(version) > $@ + +# Render template with helm (filtering away noisy annotations when diffing) +manifests: $(release) $(source) + mkdir -p manifests + rm -rf manifests/* + helm template $(name) $(chart) --repo $(url) --version $(version) --namespace $(namespace) --skip-crds -f <(echo "$$($(values))") | grep -vE "helm.sh/chart|app.kubernetes.io/version" | yq -s '"manifests/" + .kind + "-" + .metadata.name' + +.PHONY: all manifests diff --git a/apps/vertical-pod-autoscaler/crds.yaml b/apps/vertical-pod-autoscaler/crds.yaml new file mode 100644 index 00000000..d7788ad1 --- /dev/null +++ b/apps/vertical-pod-autoscaler/crds.yaml @@ -0,0 +1,1007 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + api-approved.kubernetes.io: https://github.com/kubernetes/kubernetes/pull/63797 + controller-gen.kubebuilder.io/version: v0.21.0 + name: verticalpodautoscalercheckpoints.autoscaling.k8s.io +spec: + group: autoscaling.k8s.io + names: + kind: VerticalPodAutoscalerCheckpoint + listKind: VerticalPodAutoscalerCheckpointList + plural: verticalpodautoscalercheckpoints + shortNames: + - vpacheckpoint + singular: verticalpodautoscalercheckpoint + scope: Namespaced + versions: + - name: v1 + schema: + openAPIV3Schema: + description: |- + VerticalPodAutoscalerCheckpoint is the checkpoint of the internal state of VPA that + is used for recovery after recommender's restart. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: |- + Specification of the checkpoint. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. + properties: + containerName: + description: Name of the checkpointed container. + type: string + vpaObjectName: + description: Name of the VPA object that stored VerticalPodAutoscalerCheckpoint + object. + type: string + type: object + status: + description: Data of the checkpoint. + properties: + cpuHistogram: + description: Checkpoint of histogram for consumption of CPU. + properties: + bucketWeights: + description: Map from bucket index to bucket weight. + type: object + x-kubernetes-preserve-unknown-fields: true + referenceTimestamp: + description: Reference timestamp for samples collected within + this histogram. + format: date-time + nullable: true + type: string + totalWeight: + description: Sum of samples to be used as denominator for weights + from BucketWeights. + type: number + type: object + firstSampleStart: + description: Timestamp of the first sample from the histograms. + format: date-time + nullable: true + type: string + lastSampleStart: + description: Timestamp of the last sample from the histograms. + format: date-time + nullable: true + type: string + lastUpdateTime: + description: The time when the status was last refreshed. + format: date-time + nullable: true + type: string + memoryHistogram: + description: Checkpoint of histogram for consumption of memory. + properties: + bucketWeights: + description: Map from bucket index to bucket weight. + type: object + x-kubernetes-preserve-unknown-fields: true + referenceTimestamp: + description: Reference timestamp for samples collected within + this histogram. + format: date-time + nullable: true + type: string + totalWeight: + description: Sum of samples to be used as denominator for weights + from BucketWeights. + type: number + type: object + totalSamplesCount: + description: Total number of samples in the histograms. + type: integer + version: + description: Version of the format of the stored data. + type: string + type: object + type: object + served: true + storage: true + - name: v1beta2 + schema: + openAPIV3Schema: + description: |- + VerticalPodAutoscalerCheckpoint is the checkpoint of the internal state of VPA that + is used for recovery after recommender's restart. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: |- + Specification of the checkpoint. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. + properties: + containerName: + description: Name of the checkpointed container. + type: string + vpaObjectName: + description: Name of the VPA object that stored VerticalPodAutoscalerCheckpoint + object. + type: string + type: object + status: + description: Data of the checkpoint. + properties: + cpuHistogram: + description: Checkpoint of histogram for consumption of CPU. + properties: + bucketWeights: + description: Map from bucket index to bucket weight. + type: object + x-kubernetes-preserve-unknown-fields: true + referenceTimestamp: + description: Reference timestamp for samples collected within + this histogram. + format: date-time + nullable: true + type: string + totalWeight: + description: Sum of samples to be used as denominator for weights + from BucketWeights. + type: number + type: object + firstSampleStart: + description: Timestamp of the first sample from the histograms. + format: date-time + nullable: true + type: string + lastSampleStart: + description: Timestamp of the last sample from the histograms. + format: date-time + nullable: true + type: string + lastUpdateTime: + description: The time when the status was last refreshed. + format: date-time + nullable: true + type: string + memoryHistogram: + description: Checkpoint of histogram for consumption of memory. + properties: + bucketWeights: + description: Map from bucket index to bucket weight. + type: object + x-kubernetes-preserve-unknown-fields: true + referenceTimestamp: + description: Reference timestamp for samples collected within + this histogram. + format: date-time + nullable: true + type: string + totalWeight: + description: Sum of samples to be used as denominator for weights + from BucketWeights. + type: number + type: object + totalSamplesCount: + description: Total number of samples in the histograms. + type: integer + version: + description: Version of the format of the stored data. + type: string + type: object + type: object + served: false + storage: false +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + api-approved.kubernetes.io: https://github.com/kubernetes/kubernetes/pull/63797 + controller-gen.kubebuilder.io/version: v0.21.0 + name: verticalpodautoscalers.autoscaling.k8s.io +spec: + group: autoscaling.k8s.io + names: + kind: VerticalPodAutoscaler + listKind: VerticalPodAutoscalerList + plural: verticalpodautoscalers + shortNames: + - vpa + singular: verticalpodautoscaler + scope: Namespaced + versions: + - additionalPrinterColumns: + - jsonPath: .spec.updatePolicy.updateMode + name: Mode + type: string + - jsonPath: .status.recommendation.containerRecommendations[0].target.cpu + name: CPU + type: string + - jsonPath: .status.recommendation.containerRecommendations[0].target.memory + name: Mem + type: string + - jsonPath: .status.conditions[?(@.type=='RecommendationProvided')].status + name: Provided + type: string + - jsonPath: .metadata.creationTimestamp + name: Age + type: date + - jsonPath: .spec.updatePolicy.minReplicas + name: MinReplicas + priority: 1 + type: integer + - jsonPath: .spec.updatePolicy.evictAfterOOMSeconds + name: OOMSeconds + priority: 1 + type: integer + name: v1 + schema: + openAPIV3Schema: + description: |- + VerticalPodAutoscaler is the configuration for a vertical pod + autoscaler, which automatically manages pod resources based on historical and + real time resource utilization. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: |- + Specification of the behavior of the autoscaler. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. + properties: + recommenders: + description: |- + Recommender responsible for generating recommendation for this object. + List should be empty (then the default recommender will generate the + recommendation) or contain exactly one recommender. + items: + description: |- + VerticalPodAutoscalerRecommenderSelector points to a specific Vertical Pod Autoscaler recommender. + In the future it might pass parameters to the recommender. + properties: + name: + description: Name of the recommender responsible for generating + recommendation for this object. + type: string + required: + - name + type: object + type: array + resourcePolicy: + description: |- + Controls how the autoscaler computes recommended resources. + The resource policy may be used to set constraints on the recommendations + for individual containers. + If any individual containers need to be excluded from getting the VPA recommendations, then + it must be disabled explicitly by setting mode to "Off" under containerPolicies. + If not specified, the autoscaler computes recommended resources for all containers in the pod, + without additional constraints. + properties: + containerPolicies: + description: Per-container resource policies. + items: + description: |- + ContainerResourcePolicy controls how autoscaler computes the recommended + resources for a specific container. + properties: + containerName: + description: |- + Name of the container or DefaultContainerResourcePolicy, in which + case the policy is used by the containers that don't have their own + policy specified. + type: string + controlledResources: + description: |- + Specifies the type of recommendations that will be computed + (and possibly applied) by VPA. + If not specified, the default of [cpu, memory] will be used. + items: + description: ResourceName is the name identifying various + resources in a ResourceList. + type: string + type: array + controlledValues: + description: |- + Specifies which resource values should be controlled. + The default is "RequestsAndLimits". + enum: + - RequestsAndLimits + - RequestsOnly + type: string + maxAllowed: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: |- + Specifies the maximum amount of resources that will be recommended + for the container. The default is no maximum. + type: object + memoryAggregationIntervalCount: + description: |- + memoryAggregationIntervalCount is the number of consecutive + memoryAggregationIntervals which make up the memory aggregation window. + The total window length is: + MemoryAggregationIntervalSeconds * MemoryAggregationIntervalCount. + format: int64 + minimum: 1 + type: integer + memoryAggregationIntervalSeconds: + description: |- + memoryAggregationIntervalSeconds is the length of a single interval + (in seconds) for which the peak memory usage is computed. + Memory usage peaks are aggregated in multiples of this interval. + In other words, there is one memory usage sample per interval + (the maximum usage over that interval). + format: int32 + minimum: 1 + type: integer + minAllowed: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: |- + Specifies the minimal amount of resources that will be recommended + for the container. The default is no minimum. + type: object + mode: + description: Whether autoscaler is enabled for the container. + The default is "Auto". + enum: + - Auto + - "Off" + type: string + oomBumpUpRatio: + anyOf: + - type: integer + - type: string + description: oomBumpUpRatio is the ratio to increase memory + when OOM is detected. + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + oomMinBumpUp: + anyOf: + - type: integer + - type: string + description: oomMinBumpUp is the minimum increase in memory + when OOM is detected. + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + startupBoost: + description: |- + startupBoost specifies the startup boost policy for the container. + This overrides any pod-level startup boost policy. + The startup boost policy takes precedence over the rest of the fields in + this struct, except for ContainerName and ControlledValues. + properties: + cpu: + description: |- + cpu specifies the CPU startup boost policy. + If this field is not set, no startup boost is applied. + properties: + durationSeconds: + description: |- + durationSeconds indicates for how long to keep the pod boosted after it goes to Ready. + Defaults to 0. + format: int32 + type: integer + factor: + description: |- + factor specifies the factor to apply to the resource request. + This field is required when Type is "Factor". + format: int32 + type: integer + quantity: + anyOf: + - type: integer + - type: string + description: |- + quantity specifies the absolute resource quantity to be used as the + resource request and limit during the boost phase. + This field is required when Type is "Quantity". + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: + description: |- + type specifies the kind of boost to apply. + Supported values are: "Factor", "Quantity". + No startupboost will be applied for unrecognized values. + enum: + - Factor + - Quantity + type: string + required: + - type + type: object + x-kubernetes-validations: + - message: factor is required when type is Factor and + forbidden otherwise + rule: (self.type == 'Factor') == has(self.factor) + - message: quantity is required when type is Quantity + and forbidden otherwise + rule: (self.type == 'Quantity') == has(self.quantity) + type: object + type: object + type: array + type: object + startupBoost: + description: startupBoost specifies the startup boost policy for the + pod. + properties: + cpu: + description: |- + cpu specifies the CPU startup boost policy. + If this field is not set, no startup boost is applied. + properties: + durationSeconds: + description: |- + durationSeconds indicates for how long to keep the pod boosted after it goes to Ready. + Defaults to 0. + format: int32 + type: integer + factor: + description: |- + factor specifies the factor to apply to the resource request. + This field is required when Type is "Factor". + format: int32 + type: integer + quantity: + anyOf: + - type: integer + - type: string + description: |- + quantity specifies the absolute resource quantity to be used as the + resource request and limit during the boost phase. + This field is required when Type is "Quantity". + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + type: + description: |- + type specifies the kind of boost to apply. + Supported values are: "Factor", "Quantity". + No startupboost will be applied for unrecognized values. + enum: + - Factor + - Quantity + type: string + required: + - type + type: object + x-kubernetes-validations: + - message: factor is required when type is Factor and forbidden + otherwise + rule: (self.type == 'Factor') == has(self.factor) + - message: quantity is required when type is Quantity and forbidden + otherwise + rule: (self.type == 'Quantity') == has(self.quantity) + type: object + targetRef: + description: |- + TargetRef points to the controller managing the set of pods for the + autoscaler to control - e.g. Deployment, StatefulSet. VerticalPodAutoscaler + can be targeted at controller implementing scale subresource (the pod set is + retrieved from the controller's ScaleStatus) or some well known controllers + (e.g. for DaemonSet the pod set is read from the controller's spec). + If VerticalPodAutoscaler cannot use specified target it will report + ConfigUnsupported condition. + Note that VerticalPodAutoscaler does not require full implementation + of scale subresource - it will not use it to modify the replica count. + The only thing retrieved is a label selector matching pods grouped by + the target resource. + properties: + apiVersion: + description: apiVersion is the API version of the referent + type: string + kind: + description: 'kind is the kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'name is the name of the referent; More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + required: + - kind + - name + type: object + x-kubernetes-map-type: atomic + updatePolicy: + description: |- + Describes the rules on how changes are applied to the pods. + If not specified, all fields in the `PodUpdatePolicy` are set to their + default values. + properties: + evictAfterOOMSeconds: + description: |- + evictAfterOOMSeconds specifies the time in seconds to wait after an OOM event before + considering the pod for eviction. Pods that have OOMed in less than this time + since start will be evicted. + format: int32 + minimum: 1 + type: integer + evictionRequirements: + description: |- + EvictionRequirements is a list of EvictionRequirements that need to + evaluate to true in order for a Pod to be evicted. If more than one + EvictionRequirement is specified, all of them need to be fulfilled to allow eviction. + items: + description: |- + EvictionRequirement defines a single condition which needs to be true in + order to evict a Pod + properties: + changeRequirement: + description: EvictionChangeRequirement refers to the relationship + between the new target recommendation for a Pod and its + current requests, what kind of change is necessary for + the Pod to be evicted + enum: + - TargetHigherThanRequests + - TargetLowerThanRequests + type: string + resources: + description: |- + Resources is a list of one or more resources that the condition applies + to. If more than one resource is given, the EvictionRequirement is fulfilled + if at least one resource meets `changeRequirement`. + items: + description: ResourceName is the name identifying various + resources in a ResourceList. + type: string + type: array + required: + - changeRequirement + - resources + type: object + type: array + minReplicas: + description: |- + Minimal number of replicas which need to be alive for Updater to attempt + pod eviction (pending other checks like PDB). Only positive values are + allowed. Overrides global '--min-replicas' flag. + format: int32 + type: integer + updateMode: + description: |- + Controls when autoscaler applies changes to the pod resources. + The default is 'Recreate'. + enum: + - "Off" + - Initial + - Recreate + - InPlaceOrRecreate + - InPlace + - Auto + type: string + type: object + required: + - targetRef + type: object + status: + description: Current information about the autoscaler. + properties: + conditions: + description: |- + Conditions is the set of conditions required for this autoscaler to scale its target, + and indicates whether or not those conditions are met. + items: + description: |- + VerticalPodAutoscalerCondition describes the state of + a VerticalPodAutoscaler at a certain point. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from + one status to another + format: date-time + type: string + message: + description: |- + message is a human-readable explanation containing details about + the transition + type: string + observedGeneration: + description: |- + observedGeneration represents the .metadata.generation that the condition was set based upon. + For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date + with respect to the current state of the instance. + format: int64 + minimum: 0 + type: integer + reason: + description: reason is the reason for the condition's last transition. + type: string + status: + description: status is the status of the condition (True, False, + Unknown) + type: string + type: + description: type describes the current condition + type: string + required: + - status + - type + type: object + type: array + observedGeneration: + description: observedGeneration is the most recent generation observed + by this autoscaler. + format: int64 + minimum: 0 + type: integer + recommendation: + description: |- + The most recently computed amount of resources recommended by the + autoscaler for the controlled pods. + properties: + containerRecommendations: + description: Resources recommended by the autoscaler for each + container. + items: + description: |- + RecommendedContainerResources is the recommendation of resources computed by + autoscaler for a specific container. Respects the container resource policy + if present in the spec. In particular the recommendation is not produced for + containers with `ContainerScalingMode` set to 'Off'. + properties: + containerName: + description: Name of the container. + type: string + lowerBound: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: |- + Minimum recommended amount of resources. Observes ContainerResourcePolicy. + This amount is not guaranteed to be sufficient for the application to operate in a stable way, however + running with less resources is likely to have significant impact on performance/availability. + type: object + target: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: Recommended amount of resources. Observes ContainerResourcePolicy. + type: object + uncappedTarget: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: |- + The most recent recommended resources target computed by the autoscaler + for the controlled pods, based only on actual resource usage, not taking + into account the ContainerResourcePolicy. + May differ from the Recommendation if the actual resource usage causes + the target to violate the ContainerResourcePolicy (lower than MinAllowed + or higher that MaxAllowed). + Used only as status indication, will not affect actual resource assignment. + type: object + upperBound: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: |- + Maximum recommended amount of resources. Observes ContainerResourcePolicy. + Any resources allocated beyond this value are likely wasted. This value may be larger than the maximum + amount of application is actually capable of consuming. + type: object + required: + - target + type: object + type: array + type: object + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} + - deprecated: true + deprecationWarning: autoscaling.k8s.io/v1beta2 API is deprecated + name: v1beta2 + schema: + openAPIV3Schema: + description: |- + VerticalPodAutoscaler is the configuration for a vertical pod + autoscaler, which automatically manages pod resources based on historical and + real time resource utilization. + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + description: |- + Specification of the behavior of the autoscaler. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status. + properties: + resourcePolicy: + description: |- + Controls how the autoscaler computes recommended resources. + The resource policy may be used to set constraints on the recommendations + for individual containers. If not specified, the autoscaler computes recommended + resources for all containers in the pod, without additional constraints. + properties: + containerPolicies: + description: Per-container resource policies. + items: + description: |- + ContainerResourcePolicy controls how autoscaler computes the recommended + resources for a specific container. + properties: + containerName: + description: |- + Name of the container or DefaultContainerResourcePolicy, in which + case the policy is used by the containers that don't have their own + policy specified. + type: string + maxAllowed: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: |- + Specifies the maximum amount of resources that will be recommended + for the container. The default is no maximum. + type: object + minAllowed: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: |- + Specifies the minimal amount of resources that will be recommended + for the container. The default is no minimum. + type: object + mode: + description: Whether autoscaler is enabled for the container. + The default is "Auto". + enum: + - Auto + - "Off" + type: string + type: object + type: array + type: object + targetRef: + description: |- + TargetRef points to the controller managing the set of pods for the + autoscaler to control - e.g. Deployment, StatefulSet. VerticalPodAutoscaler + can be targeted at controller implementing scale subresource (the pod set is + retrieved from the controller's ScaleStatus) or some well known controllers + (e.g. for DaemonSet the pod set is read from the controller's spec). + If VerticalPodAutoscaler cannot use specified target it will report + ConfigUnsupported condition. + Note that VerticalPodAutoscaler does not require full implementation + of scale subresource - it will not use it to modify the replica count. + The only thing retrieved is a label selector matching pods grouped by + the target resource. + properties: + apiVersion: + description: apiVersion is the API version of the referent + type: string + kind: + description: 'kind is the kind of the referent; More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + name: + description: 'name is the name of the referent; More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names' + type: string + required: + - kind + - name + type: object + x-kubernetes-map-type: atomic + updatePolicy: + description: |- + Describes the rules on how changes are applied to the pods. + If not specified, all fields in the `PodUpdatePolicy` are set to their + default values. + properties: + updateMode: + description: |- + Controls when autoscaler applies changes to the pod resources. + The default is 'Auto'. + enum: + - "Off" + - Initial + - Recreate + - Auto + type: string + type: object + required: + - targetRef + type: object + status: + description: Current information about the autoscaler. + properties: + conditions: + description: |- + Conditions is the set of conditions required for this autoscaler to scale its target, + and indicates whether or not those conditions are met. + items: + description: |- + VerticalPodAutoscalerCondition describes the state of + a VerticalPodAutoscaler at a certain point. + properties: + lastTransitionTime: + description: |- + lastTransitionTime is the last time the condition transitioned from + one status to another + format: date-time + type: string + message: + description: |- + message is a human-readable explanation containing details about + the transition + type: string + reason: + description: reason is the reason for the condition's last transition. + type: string + status: + description: status is the status of the condition (True, False, + Unknown) + type: string + type: + description: type describes the current condition + type: string + required: + - status + - type + type: object + type: array + recommendation: + description: |- + The most recently computed amount of resources recommended by the + autoscaler for the controlled pods. + properties: + containerRecommendations: + description: Resources recommended by the autoscaler for each + container. + items: + description: |- + RecommendedContainerResources is the recommendation of resources computed by + autoscaler for a specific container. Respects the container resource policy + if present in the spec. In particular the recommendation is not produced for + containers with `ContainerScalingMode` set to 'Off'. + properties: + containerName: + description: Name of the container. + type: string + lowerBound: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: |- + Minimum recommended amount of resources. Observes ContainerResourcePolicy. + This amount is not guaranteed to be sufficient for the application to operate in a stable way, however + running with less resources is likely to have significant impact on performance/availability. + type: object + target: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: Recommended amount of resources. Observes ContainerResourcePolicy. + type: object + uncappedTarget: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: |- + The most recent recommended resources target computed by the autoscaler + for the controlled pods, based only on actual resource usage, not taking + into account the ContainerResourcePolicy. + May differ from the Recommendation if the actual resource usage causes + the target to violate the ContainerResourcePolicy (lower than MinAllowed + or higher that MaxAllowed). + Used only as status indication, will not affect actual resource assignment. + type: object + upperBound: + additionalProperties: + anyOf: + - type: integer + - type: string + pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$ + x-kubernetes-int-or-string: true + description: |- + Maximum recommended amount of resources. Observes ContainerResourcePolicy. + Any resources allocated beyond this value are likely wasted. This value may be larger than the maximum + amount of application is actually capable of consuming. + type: object + required: + - target + type: object + type: array + type: object + type: object + required: + - spec + type: object + served: false + storage: false + subresources: + status: {} + diff --git a/apps/vertical-pod-autoscaler/kustomization.yaml b/apps/vertical-pod-autoscaler/kustomization.yaml new file mode 100644 index 00000000..821dbdd3 --- /dev/null +++ b/apps/vertical-pod-autoscaler/kustomization.yaml @@ -0,0 +1,8 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - crds.yaml + - namespace.yaml + - sources.yaml + - release.yaml + - vpa.yaml diff --git a/apps/vertical-pod-autoscaler/manifests/Certificate-vpa-webhook-ca.yml b/apps/vertical-pod-autoscaler/manifests/Certificate-vpa-webhook-ca.yml new file mode 100644 index 00000000..887b5cb2 --- /dev/null +++ b/apps/vertical-pod-autoscaler/manifests/Certificate-vpa-webhook-ca.yml @@ -0,0 +1,26 @@ +--- +# Source: vertical-pod-autoscaler/templates/admission-controller-certmanager.yaml +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: vpa-webhook-ca + namespace: vpa + labels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: admission-controller + app.kubernetes.io/component-instance: vpa-admission-controller +spec: + isCA: true + secretName: vpa-webhook-ca + commonName: vpa-webhook-ca + privateKey: + algorithm: RSA + size: 2048 + issuerRef: + name: vpa-selfsigned + kind: Issuer + group: cert-manager.io + duration: 8760h + renewBefore: 720h diff --git a/apps/vertical-pod-autoscaler/manifests/Certificate-vpa-webhook-cert.yml b/apps/vertical-pod-autoscaler/manifests/Certificate-vpa-webhook-cert.yml new file mode 100644 index 00000000..3fb96f1e --- /dev/null +++ b/apps/vertical-pod-autoscaler/manifests/Certificate-vpa-webhook-cert.yml @@ -0,0 +1,33 @@ +--- +# Source: vertical-pod-autoscaler/templates/admission-controller-certmanager.yaml +apiVersion: cert-manager.io/v1 +kind: Certificate +metadata: + name: vpa-webhook-cert + namespace: vpa + labels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: admission-controller + app.kubernetes.io/component-instance: vpa-admission-controller +spec: + secretName: vpa-tls-certs + dnsNames: + - vpa-webhook + - vpa-webhook.vpa + - vpa-webhook.vpa.svc + - vpa-webhook.vpa.svc.cluster.local + privateKey: + algorithm: RSA + size: 2048 + usages: + - digital signature + - key encipherment + - server auth + issuerRef: + name: vpa-ca + kind: Issuer + group: cert-manager.io + duration: 168h + renewBefore: 24h diff --git a/apps/vertical-pod-autoscaler/manifests/ClusterRole-vpa-admission-controller.yml b/apps/vertical-pod-autoscaler/manifests/ClusterRole-vpa-admission-controller.yml new file mode 100644 index 00000000..d040f663 --- /dev/null +++ b/apps/vertical-pod-autoscaler/manifests/ClusterRole-vpa-admission-controller.yml @@ -0,0 +1,71 @@ +--- +# Source: vertical-pod-autoscaler/templates/admission-controller-clusterrole.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: vpa-admission-controller + labels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: admission-controller + app.kubernetes.io/component-instance: vpa-admission-controller +rules: + - apiGroups: + - "" + resources: + - pods + - configmaps + - nodes + - limitranges + - replicationcontrollers + verbs: + - get + - list + - watch + - apiGroups: + - apps + resources: + - deployments + - replicasets + - daemonsets + - statefulsets + verbs: + - get + - list + - watch + - apiGroups: + - batch + resources: + - jobs + - cronjobs + verbs: + - get + - list + - watch + - apiGroups: + - autoscaling.k8s.io + resources: + - verticalpodautoscalers + verbs: + - get + - list + - watch + - apiGroups: + - coordination.k8s.io + resources: + - leases + verbs: + - create + - update + - get + - list + - watch + # Allow access to scale subresources for resolving target selectors + - apiGroups: + - "*" + resources: + - "*/scale" + verbs: + - get + - watch diff --git a/apps/vertical-pod-autoscaler/manifests/ClusterRole-vpa-recommender-actor.yml b/apps/vertical-pod-autoscaler/manifests/ClusterRole-vpa-recommender-actor.yml new file mode 100644 index 00000000..f491ec81 --- /dev/null +++ b/apps/vertical-pod-autoscaler/manifests/ClusterRole-vpa-recommender-actor.yml @@ -0,0 +1,51 @@ +--- +# Source: vertical-pod-autoscaler/templates/recommender-clusterroles.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: vpa-recommender-actor + labels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: recommender + app.kubernetes.io/component-instance: vpa-recommender +rules: + - apiGroups: + - "" + resources: + - pods + - nodes + - limitranges + verbs: + - get + - list + - watch + - apiGroups: + - "" + - events.k8s.io + resources: + - events + verbs: + - create + - get + - list + - watch + - patch + - update + - apiGroups: + - "poc.autoscaling.k8s.io" + resources: + - verticalpodautoscalers + verbs: + - get + - list + - watch + - apiGroups: + - "autoscaling.k8s.io" + resources: + - verticalpodautoscalers + verbs: + - get + - list + - watch diff --git a/apps/vertical-pod-autoscaler/manifests/ClusterRole-vpa-recommender-checkpoint-actor.yml b/apps/vertical-pod-autoscaler/manifests/ClusterRole-vpa-recommender-checkpoint-actor.yml new file mode 100644 index 00000000..1f09d549 --- /dev/null +++ b/apps/vertical-pod-autoscaler/manifests/ClusterRole-vpa-recommender-checkpoint-actor.yml @@ -0,0 +1,42 @@ +--- +# Source: vertical-pod-autoscaler/templates/recommender-clusterroles.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: vpa-recommender-checkpoint-actor + labels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: recommender + app.kubernetes.io/component-instance: vpa-recommender +rules: + - apiGroups: + - "poc.autoscaling.k8s.io" + resources: + - verticalpodautoscalercheckpoints + verbs: + - get + - list + - watch + - create + - patch + - delete + - apiGroups: + - "autoscaling.k8s.io" + resources: + - verticalpodautoscalercheckpoints + verbs: + - get + - list + - watch + - create + - patch + - delete + - apiGroups: + - "" + resources: + - namespaces + verbs: + - get + - list diff --git a/apps/vertical-pod-autoscaler/manifests/ClusterRole-vpa-recommender-metrics-reader.yml b/apps/vertical-pod-autoscaler/manifests/ClusterRole-vpa-recommender-metrics-reader.yml new file mode 100644 index 00000000..78fc2457 --- /dev/null +++ b/apps/vertical-pod-autoscaler/manifests/ClusterRole-vpa-recommender-metrics-reader.yml @@ -0,0 +1,20 @@ +--- +# Source: vertical-pod-autoscaler/templates/recommender-clusterroles.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: vpa-recommender-metrics-reader + labels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: recommender + app.kubernetes.io/component-instance: vpa-recommender +rules: + - apiGroups: + - "metrics.k8s.io" + resources: + - pods + verbs: + - get + - list diff --git a/apps/vertical-pod-autoscaler/manifests/ClusterRole-vpa-recommender-status-actor.yml b/apps/vertical-pod-autoscaler/manifests/ClusterRole-vpa-recommender-status-actor.yml new file mode 100644 index 00000000..0293a97c --- /dev/null +++ b/apps/vertical-pod-autoscaler/manifests/ClusterRole-vpa-recommender-status-actor.yml @@ -0,0 +1,20 @@ +--- +# Source: vertical-pod-autoscaler/templates/recommender-clusterroles.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: vpa-recommender-status-actor + labels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: recommender + app.kubernetes.io/component-instance: vpa-recommender +rules: + - apiGroups: + - "autoscaling.k8s.io" + resources: + - verticalpodautoscalers/status + verbs: + - get + - patch diff --git a/apps/vertical-pod-autoscaler/manifests/ClusterRole-vpa-recommender-target-reader.yml b/apps/vertical-pod-autoscaler/manifests/ClusterRole-vpa-recommender-target-reader.yml new file mode 100644 index 00000000..9d0511ab --- /dev/null +++ b/apps/vertical-pod-autoscaler/manifests/ClusterRole-vpa-recommender-target-reader.yml @@ -0,0 +1,48 @@ +--- +# Source: vertical-pod-autoscaler/templates/recommender-clusterroles.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: vpa-recommender-target-reader + labels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: recommender + app.kubernetes.io/component-instance: vpa-recommender +rules: + - apiGroups: + - '*' + resources: + - '*/scale' + verbs: + - get + - watch + - apiGroups: + - "" + resources: + - replicationcontrollers + verbs: + - get + - list + - watch + - apiGroups: + - apps + resources: + - daemonsets + - deployments + - replicasets + - statefulsets + verbs: + - get + - list + - watch + - apiGroups: + - batch + resources: + - jobs + - cronjobs + verbs: + - get + - list + - watch diff --git a/apps/vertical-pod-autoscaler/manifests/ClusterRole-vpa-updater-actor.yml b/apps/vertical-pod-autoscaler/manifests/ClusterRole-vpa-updater-actor.yml new file mode 100644 index 00000000..0c57d854 --- /dev/null +++ b/apps/vertical-pod-autoscaler/manifests/ClusterRole-vpa-updater-actor.yml @@ -0,0 +1,45 @@ +--- +# Source: vertical-pod-autoscaler/templates/updater-clusterrole.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: vpa-updater-actor +rules: + - apiGroups: + - "" + resources: + - pods + - nodes + - limitranges + verbs: + - get + - list + - watch + - apiGroups: + - "" + - events.k8s.io + resources: + - events + verbs: + - create + - get + - list + - watch + - patch + - update + - apiGroups: + - "poc.autoscaling.k8s.io" + resources: + - verticalpodautoscalers + verbs: + - get + - list + - watch + - apiGroups: + - "autoscaling.k8s.io" + resources: + - verticalpodautoscalers + verbs: + - get + - list + - watch diff --git a/apps/vertical-pod-autoscaler/manifests/ClusterRole-vpa-updater-evictioner.yml b/apps/vertical-pod-autoscaler/manifests/ClusterRole-vpa-updater-evictioner.yml new file mode 100644 index 00000000..93eebeae --- /dev/null +++ b/apps/vertical-pod-autoscaler/manifests/ClusterRole-vpa-updater-evictioner.yml @@ -0,0 +1,20 @@ +--- +# Source: vertical-pod-autoscaler/templates/updater-clusterrole.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: vpa-updater-evictioner +rules: + - apiGroups: + - "apps" + - "extensions" + resources: + - replicasets + verbs: + - get + - apiGroups: + - "" + resources: + - pods/eviction + verbs: + - create diff --git a/apps/vertical-pod-autoscaler/manifests/ClusterRole-vpa-updater-in-place.yml b/apps/vertical-pod-autoscaler/manifests/ClusterRole-vpa-updater-in-place.yml new file mode 100644 index 00000000..24193c27 --- /dev/null +++ b/apps/vertical-pod-autoscaler/manifests/ClusterRole-vpa-updater-in-place.yml @@ -0,0 +1,20 @@ +--- +# Source: vertical-pod-autoscaler/templates/updater-clusterrole.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: vpa-updater-in-place + labels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: updater + app.kubernetes.io/component-instance: vpa-updater +rules: + - apiGroups: + - "" + resources: + - pods/resize + - pods + verbs: + - patch diff --git a/apps/vertical-pod-autoscaler/manifests/ClusterRole-vpa-updater-status-reader.yml b/apps/vertical-pod-autoscaler/manifests/ClusterRole-vpa-updater-status-reader.yml new file mode 100644 index 00000000..51d72641 --- /dev/null +++ b/apps/vertical-pod-autoscaler/manifests/ClusterRole-vpa-updater-status-reader.yml @@ -0,0 +1,15 @@ +--- +# Source: vertical-pod-autoscaler/templates/updater-clusterrole.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: vpa-updater-status-reader +rules: + - apiGroups: + - "coordination.k8s.io" + resources: + - leases + verbs: + - get + - list + - watch diff --git a/apps/vertical-pod-autoscaler/manifests/ClusterRole-vpa-updater-target-reader.yml b/apps/vertical-pod-autoscaler/manifests/ClusterRole-vpa-updater-target-reader.yml new file mode 100644 index 00000000..118da7fb --- /dev/null +++ b/apps/vertical-pod-autoscaler/manifests/ClusterRole-vpa-updater-target-reader.yml @@ -0,0 +1,42 @@ +--- +# Source: vertical-pod-autoscaler/templates/updater-clusterrole.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: vpa-updater-target-reader +rules: + - apiGroups: + - '*' + resources: + - '*/scale' + verbs: + - get + - watch + - apiGroups: + - "" + resources: + - replicationcontrollers + verbs: + - get + - list + - watch + - apiGroups: + - apps + resources: + - daemonsets + - deployments + - replicasets + - statefulsets + verbs: + - get + - list + - watch + - apiGroups: + - batch + resources: + - jobs + - cronjobs + verbs: + - get + - list + - watch diff --git a/apps/vertical-pod-autoscaler/manifests/ClusterRoleBinding-vpa-admission-controller.yml b/apps/vertical-pod-autoscaler/manifests/ClusterRoleBinding-vpa-admission-controller.yml new file mode 100644 index 00000000..5a2b8c93 --- /dev/null +++ b/apps/vertical-pod-autoscaler/manifests/ClusterRoleBinding-vpa-admission-controller.yml @@ -0,0 +1,20 @@ +--- +# Source: vertical-pod-autoscaler/templates/admission-controller-clusterrolebinding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: vpa-admission-controller + labels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: admission-controller + app.kubernetes.io/component-instance: vpa-admission-controller +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: vpa-admission-controller +subjects: + - kind: ServiceAccount + name: vpa-admission-controller + namespace: vpa diff --git a/apps/vertical-pod-autoscaler/manifests/ClusterRoleBinding-vpa-recommender-actor.yml b/apps/vertical-pod-autoscaler/manifests/ClusterRoleBinding-vpa-recommender-actor.yml new file mode 100644 index 00000000..8ca16f7c --- /dev/null +++ b/apps/vertical-pod-autoscaler/manifests/ClusterRoleBinding-vpa-recommender-actor.yml @@ -0,0 +1,20 @@ +--- +# Source: vertical-pod-autoscaler/templates/recommender-clusterrolebindings.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: vpa-recommender-actor + labels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: recommender + app.kubernetes.io/component-instance: vpa-recommender +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: vpa-recommender-actor +subjects: + - kind: ServiceAccount + name: vpa-recommender + namespace: vpa diff --git a/apps/vertical-pod-autoscaler/manifests/ClusterRoleBinding-vpa-recommender-checkpoint-actor.yml b/apps/vertical-pod-autoscaler/manifests/ClusterRoleBinding-vpa-recommender-checkpoint-actor.yml new file mode 100644 index 00000000..682b51d7 --- /dev/null +++ b/apps/vertical-pod-autoscaler/manifests/ClusterRoleBinding-vpa-recommender-checkpoint-actor.yml @@ -0,0 +1,20 @@ +--- +# Source: vertical-pod-autoscaler/templates/recommender-clusterrolebindings.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: vpa-recommender-checkpoint-actor + labels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: recommender + app.kubernetes.io/component-instance: vpa-recommender +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: vpa-recommender-checkpoint-actor +subjects: + - kind: ServiceAccount + name: vpa-recommender + namespace: vpa diff --git a/apps/vertical-pod-autoscaler/manifests/ClusterRoleBinding-vpa-recommender-metrics-reader.yml b/apps/vertical-pod-autoscaler/manifests/ClusterRoleBinding-vpa-recommender-metrics-reader.yml new file mode 100644 index 00000000..2a2b19d7 --- /dev/null +++ b/apps/vertical-pod-autoscaler/manifests/ClusterRoleBinding-vpa-recommender-metrics-reader.yml @@ -0,0 +1,20 @@ +--- +# Source: vertical-pod-autoscaler/templates/recommender-clusterrolebindings.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: vpa-recommender-metrics-reader + labels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: recommender + app.kubernetes.io/component-instance: vpa-recommender +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: vpa-recommender-metrics-reader +subjects: + - kind: ServiceAccount + name: vpa-recommender + namespace: vpa diff --git a/apps/vertical-pod-autoscaler/manifests/ClusterRoleBinding-vpa-recommender-status-actor.yml b/apps/vertical-pod-autoscaler/manifests/ClusterRoleBinding-vpa-recommender-status-actor.yml new file mode 100644 index 00000000..e4d6a0bf --- /dev/null +++ b/apps/vertical-pod-autoscaler/manifests/ClusterRoleBinding-vpa-recommender-status-actor.yml @@ -0,0 +1,20 @@ +--- +# Source: vertical-pod-autoscaler/templates/recommender-clusterrolebindings.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: vpa-recommender-status-actor + labels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: recommender + app.kubernetes.io/component-instance: vpa-recommender +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: vpa-recommender-status-actor +subjects: + - kind: ServiceAccount + name: vpa-recommender + namespace: vpa diff --git a/apps/vertical-pod-autoscaler/manifests/ClusterRoleBinding-vpa-recommender-target-reader.yml b/apps/vertical-pod-autoscaler/manifests/ClusterRoleBinding-vpa-recommender-target-reader.yml new file mode 100644 index 00000000..44116f58 --- /dev/null +++ b/apps/vertical-pod-autoscaler/manifests/ClusterRoleBinding-vpa-recommender-target-reader.yml @@ -0,0 +1,20 @@ +--- +# Source: vertical-pod-autoscaler/templates/recommender-clusterrolebindings.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: vpa-recommender-target-reader + labels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: recommender + app.kubernetes.io/component-instance: vpa-recommender +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: vpa-recommender-target-reader +subjects: + - kind: ServiceAccount + name: vpa-recommender + namespace: vpa diff --git a/apps/vertical-pod-autoscaler/manifests/ClusterRoleBinding-vpa-updater-actor-binding.yml b/apps/vertical-pod-autoscaler/manifests/ClusterRoleBinding-vpa-updater-actor-binding.yml new file mode 100644 index 00000000..5f514bb7 --- /dev/null +++ b/apps/vertical-pod-autoscaler/manifests/ClusterRoleBinding-vpa-updater-actor-binding.yml @@ -0,0 +1,20 @@ +--- +# Source: vertical-pod-autoscaler/templates/updater-clusterrolebinding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: vpa-updater-actor-binding + labels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: updater + app.kubernetes.io/component-instance: vpa-updater +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: vpa-updater-actor +subjects: + - kind: ServiceAccount + name: vpa-updater + namespace: vpa diff --git a/apps/vertical-pod-autoscaler/manifests/ClusterRoleBinding-vpa-updater-evictioner-binding.yml b/apps/vertical-pod-autoscaler/manifests/ClusterRoleBinding-vpa-updater-evictioner-binding.yml new file mode 100644 index 00000000..cf2e6cb7 --- /dev/null +++ b/apps/vertical-pod-autoscaler/manifests/ClusterRoleBinding-vpa-updater-evictioner-binding.yml @@ -0,0 +1,20 @@ +--- +# Source: vertical-pod-autoscaler/templates/updater-clusterrolebinding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: vpa-updater-evictioner-binding + labels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: updater + app.kubernetes.io/component-instance: vpa-updater +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: vpa-updater-evictioner +subjects: + - kind: ServiceAccount + name: vpa-updater + namespace: vpa diff --git a/apps/vertical-pod-autoscaler/manifests/ClusterRoleBinding-vpa-updater-in-place-binding.yml b/apps/vertical-pod-autoscaler/manifests/ClusterRoleBinding-vpa-updater-in-place-binding.yml new file mode 100644 index 00000000..4d11223b --- /dev/null +++ b/apps/vertical-pod-autoscaler/manifests/ClusterRoleBinding-vpa-updater-in-place-binding.yml @@ -0,0 +1,20 @@ +--- +# Source: vertical-pod-autoscaler/templates/updater-clusterrolebinding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: vpa-updater-in-place-binding + labels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: updater + app.kubernetes.io/component-instance: vpa-updater +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: vpa-updater-in-place +subjects: + - kind: ServiceAccount + name: vpa-updater + namespace: vpa diff --git a/apps/vertical-pod-autoscaler/manifests/ClusterRoleBinding-vpa-updater-status-reader-binding.yml b/apps/vertical-pod-autoscaler/manifests/ClusterRoleBinding-vpa-updater-status-reader-binding.yml new file mode 100644 index 00000000..029d0ce3 --- /dev/null +++ b/apps/vertical-pod-autoscaler/manifests/ClusterRoleBinding-vpa-updater-status-reader-binding.yml @@ -0,0 +1,20 @@ +--- +# Source: vertical-pod-autoscaler/templates/updater-clusterrolebinding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: vpa-updater-status-reader-binding + labels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: updater + app.kubernetes.io/component-instance: vpa-updater +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: vpa-updater-status-reader +subjects: + - kind: ServiceAccount + name: vpa-updater + namespace: vpa diff --git a/apps/vertical-pod-autoscaler/manifests/ClusterRoleBinding-vpa-updater-target-reader-binding.yml b/apps/vertical-pod-autoscaler/manifests/ClusterRoleBinding-vpa-updater-target-reader-binding.yml new file mode 100644 index 00000000..eb21e66b --- /dev/null +++ b/apps/vertical-pod-autoscaler/manifests/ClusterRoleBinding-vpa-updater-target-reader-binding.yml @@ -0,0 +1,20 @@ +--- +# Source: vertical-pod-autoscaler/templates/updater-clusterrolebinding.yaml +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: vpa-updater-target-reader-binding + labels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: updater + app.kubernetes.io/component-instance: vpa-updater +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: vpa-updater-target-reader +subjects: + - kind: ServiceAccount + name: vpa-updater + namespace: vpa diff --git a/apps/vertical-pod-autoscaler/manifests/Deployment-vpa-admission-controller.yml b/apps/vertical-pod-autoscaler/manifests/Deployment-vpa-admission-controller.yml new file mode 100644 index 00000000..eef189f2 --- /dev/null +++ b/apps/vertical-pod-autoscaler/manifests/Deployment-vpa-admission-controller.yml @@ -0,0 +1,103 @@ +--- +# Source: vertical-pod-autoscaler/templates/admission-controller-deployment.yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + name: vpa-admission-controller + namespace: vpa + labels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: admission-controller + app.kubernetes.io/component-instance: vpa-admission-controller +spec: + replicas: 3 + revisionHistoryLimit: 10 + selector: + matchLabels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/component: admission-controller + template: + metadata: + labels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/component: admission-controller + spec: + serviceAccountName: vpa-admission-controller + securityContext: + runAsNonRoot: true + runAsUser: 65534 + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - podAffinityTerm: + labelSelector: + matchExpressions: + - key: app.kubernetes.io/component + operator: In + values: + - admission-controller + topologyKey: kubernetes.io/hostname + weight: 100 + priorityClassName: system-cluster-critical + containers: + - name: admission-controller + image: registry.k8s.io/autoscaling/vpa-admission-controller:1.7.1 + imagePullPolicy: IfNotPresent + env: + - name: NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + args: + - --v=4 + - --stderrthreshold=info + - --register-webhook=false + - --webhook-service=vpa-webhook + - --reload-cert=true + ports: + - containerPort: 8000 + protocol: TCP + - containerPort: 8944 + name: prometheus + protocol: TCP + livenessProbe: + httpGet: + path: /health-check + port: prometheus + scheme: HTTP + initialDelaySeconds: 5 + periodSeconds: 10 + failureThreshold: 3 + readinessProbe: + httpGet: + path: /health-check + port: prometheus + scheme: HTTP + periodSeconds: 10 + failureThreshold: 3 + volumeMounts: + - name: tls-certs + mountPath: /etc/tls-certs + readOnly: true + resources: + limits: + memory: 500Mi + requests: + cpu: 50m + memory: 500Mi + volumes: + - name: tls-certs + secret: + defaultMode: 420 + secretName: vpa-tls-certs + items: + - key: ca.crt + path: caCert.pem + - key: tls.crt + path: serverCert.pem + - key: tls.key + path: serverKey.pem diff --git a/apps/vertical-pod-autoscaler/manifests/Deployment-vpa-recommender.yml b/apps/vertical-pod-autoscaler/manifests/Deployment-vpa-recommender.yml new file mode 100644 index 00000000..f1fc6ec7 --- /dev/null +++ b/apps/vertical-pod-autoscaler/manifests/Deployment-vpa-recommender.yml @@ -0,0 +1,87 @@ +--- +# Source: vertical-pod-autoscaler/templates/recommender-deployment.yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + name: vpa-recommender + namespace: vpa + labels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: recommender + app.kubernetes.io/component-instance: vpa-recommender +spec: + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/component: recommender + template: + metadata: + labels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/component: recommender + spec: + serviceAccountName: vpa-recommender + securityContext: + runAsNonRoot: true + runAsUser: 65534 + priorityClassName: system-cluster-critical + containers: + - name: recommender + image: registry.k8s.io/autoscaling/vpa-recommender:1.7.1 + imagePullPolicy: IfNotPresent + env: + - name: NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + args: + - --v=4 + - --stderrthreshold=info + - --humanize-memory=true + - --memory-saver + - --round-memory-bytes=1 + - --pod-recommendation-min-cpu-millicores=10 + - --pod-recommendation-min-memory-mb=16 + ports: + - name: prometheus + containerPort: 8942 + protocol: TCP + livenessProbe: + httpGet: + path: /health-check + port: prometheus + scheme: HTTP + initialDelaySeconds: 5 + periodSeconds: 10 + failureThreshold: 3 + readinessProbe: + httpGet: + path: /health-check + port: prometheus + scheme: HTTP + periodSeconds: 10 + failureThreshold: 3 + resources: + limits: + memory: 500Mi + requests: + cpu: 50m + memory: 500Mi + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - podAffinityTerm: + labelSelector: + matchExpressions: + - key: app.kubernetes.io/component + operator: In + values: + - recommender + topologyKey: kubernetes.io/hostname + weight: 100 diff --git a/apps/vertical-pod-autoscaler/manifests/Deployment-vpa-updater.yml b/apps/vertical-pod-autoscaler/manifests/Deployment-vpa-updater.yml new file mode 100644 index 00000000..218cbd97 --- /dev/null +++ b/apps/vertical-pod-autoscaler/manifests/Deployment-vpa-updater.yml @@ -0,0 +1,82 @@ +--- +# Source: vertical-pod-autoscaler/templates/updater-deployment.yaml +apiVersion: apps/v1 +kind: Deployment +metadata: + name: vpa-updater + namespace: vpa + labels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: updater + app.kubernetes.io/component-instance: vpa-updater +spec: + replicas: 1 + revisionHistoryLimit: 10 + selector: + matchLabels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/component: updater + template: + metadata: + labels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/component: updater + spec: + serviceAccountName: vpa-updater + securityContext: + runAsNonRoot: true + runAsUser: 65534 + priorityClassName: system-cluster-critical + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - podAffinityTerm: + labelSelector: + matchExpressions: + - key: app.kubernetes.io/component + operator: In + values: + - updater + topologyKey: kubernetes.io/hostname + weight: 100 + containers: + - name: updater + image: registry.k8s.io/autoscaling/vpa-updater:1.7.1 + imagePullPolicy: IfNotPresent + env: + - name: NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + args: + - --v=4 + - --stderrthreshold=info + - --in-place-skip-disruption-budget=true + ports: + - name: prometheus + containerPort: 8943 + resources: + limits: + memory: 500Mi + requests: + cpu: 50m + memory: 500Mi + livenessProbe: + httpGet: + path: /health-check + port: prometheus + scheme: HTTP + initialDelaySeconds: 5 + periodSeconds: 10 + failureThreshold: 3 + readinessProbe: + httpGet: + path: /health-check + port: prometheus + scheme: HTTP + periodSeconds: 10 + failureThreshold: 3 diff --git a/apps/vertical-pod-autoscaler/manifests/Issuer-vpa-ca.yml b/apps/vertical-pod-autoscaler/manifests/Issuer-vpa-ca.yml new file mode 100644 index 00000000..37bbe48e --- /dev/null +++ b/apps/vertical-pod-autoscaler/manifests/Issuer-vpa-ca.yml @@ -0,0 +1,16 @@ +--- +# Source: vertical-pod-autoscaler/templates/admission-controller-certmanager.yaml +apiVersion: cert-manager.io/v1 +kind: Issuer +metadata: + name: vpa-ca + namespace: vpa + labels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: admission-controller + app.kubernetes.io/component-instance: vpa-admission-controller +spec: + ca: + secretName: vpa-webhook-ca diff --git a/apps/vertical-pod-autoscaler/manifests/Issuer-vpa-selfsigned.yml b/apps/vertical-pod-autoscaler/manifests/Issuer-vpa-selfsigned.yml new file mode 100644 index 00000000..58edf6ad --- /dev/null +++ b/apps/vertical-pod-autoscaler/manifests/Issuer-vpa-selfsigned.yml @@ -0,0 +1,15 @@ +--- +# Source: vertical-pod-autoscaler/templates/admission-controller-certmanager.yaml +apiVersion: cert-manager.io/v1 +kind: Issuer +metadata: + name: vpa-selfsigned + namespace: vpa + labels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: admission-controller + app.kubernetes.io/component-instance: vpa-admission-controller +spec: + selfSigned: {} diff --git a/apps/vertical-pod-autoscaler/manifests/MutatingWebhookConfiguration-vpa-webhook-config.yml b/apps/vertical-pod-autoscaler/manifests/MutatingWebhookConfiguration-vpa-webhook-config.yml new file mode 100644 index 00000000..6d41dbf9 --- /dev/null +++ b/apps/vertical-pod-autoscaler/manifests/MutatingWebhookConfiguration-vpa-webhook-config.yml @@ -0,0 +1,51 @@ +--- +# Source: vertical-pod-autoscaler/templates/admission-controller-webhook.yaml +apiVersion: admissionregistration.k8s.io/v1 +kind: MutatingWebhookConfiguration +metadata: + name: vpa-webhook-config + labels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: admission-controller + app.kubernetes.io/component-instance: vpa-admission-controller + annotations: + cert-manager.io/inject-ca-from: vpa/vpa-webhook-cert +webhooks: + - admissionReviewVersions: + - v1 + clientConfig: + # caBundle is injected by the certgen patch job (certGen mode) or by cert-manager cainjector (certManager mode) + service: + name: vpa-webhook + namespace: vpa + port: 443 + failurePolicy: Ignore + matchPolicy: Equivalent + name: vpa.k8s.io + namespaceSelector: {} + objectSelector: {} + reinvocationPolicy: Never + rules: + - apiGroups: + - "" + apiVersions: + - v1 + operations: + - CREATE + resources: + - pods + scope: '*' + - apiGroups: + - autoscaling.k8s.io + apiVersions: + - '*' + operations: + - CREATE + - UPDATE + resources: + - verticalpodautoscalers + scope: '*' + sideEffects: None + timeoutSeconds: 5 diff --git a/apps/vertical-pod-autoscaler/manifests/PodDisruptionBudget-vpa-admission-controller.yml b/apps/vertical-pod-autoscaler/manifests/PodDisruptionBudget-vpa-admission-controller.yml new file mode 100644 index 00000000..1ef15305 --- /dev/null +++ b/apps/vertical-pod-autoscaler/manifests/PodDisruptionBudget-vpa-admission-controller.yml @@ -0,0 +1,20 @@ +--- +# Source: vertical-pod-autoscaler/templates/admission-controller-pdb.yaml +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: vpa-admission-controller + namespace: vpa + labels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: admission-controller + app.kubernetes.io/component-instance: vpa-admission-controller +spec: + selector: + matchLabels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/component: admission-controller + minAvailable: 1 diff --git a/apps/vertical-pod-autoscaler/manifests/PodDisruptionBudget-vpa-recommender.yml b/apps/vertical-pod-autoscaler/manifests/PodDisruptionBudget-vpa-recommender.yml new file mode 100644 index 00000000..a558cacb --- /dev/null +++ b/apps/vertical-pod-autoscaler/manifests/PodDisruptionBudget-vpa-recommender.yml @@ -0,0 +1,20 @@ +--- +# Source: vertical-pod-autoscaler/templates/recommender-pdb.yaml +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: vpa-recommender + namespace: vpa + labels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: recommender + app.kubernetes.io/component-instance: vpa-recommender +spec: + selector: + matchLabels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/component: recommender + minAvailable: 1 diff --git a/apps/vertical-pod-autoscaler/manifests/PodDisruptionBudget-vpa-updater.yml b/apps/vertical-pod-autoscaler/manifests/PodDisruptionBudget-vpa-updater.yml new file mode 100644 index 00000000..caf080a9 --- /dev/null +++ b/apps/vertical-pod-autoscaler/manifests/PodDisruptionBudget-vpa-updater.yml @@ -0,0 +1,20 @@ +--- +# Source: vertical-pod-autoscaler/templates/updater-pdb.yaml +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: vpa-updater + namespace: vpa + labels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: updater + app.kubernetes.io/component-instance: vpa-updater +spec: + selector: + matchLabels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/component: updater + minAvailable: 1 diff --git a/apps/vertical-pod-autoscaler/manifests/Service-vpa-webhook.yml b/apps/vertical-pod-autoscaler/manifests/Service-vpa-webhook.yml new file mode 100644 index 00000000..ac1ff6cc --- /dev/null +++ b/apps/vertical-pod-autoscaler/manifests/Service-vpa-webhook.yml @@ -0,0 +1,23 @@ +--- +# Source: vertical-pod-autoscaler/templates/admission-controller-service.yaml +apiVersion: v1 +kind: Service +metadata: + name: vpa-webhook + namespace: vpa + labels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: admission-controller + app.kubernetes.io/component-instance: vpa-admission-controller +spec: + type: ClusterIP + ports: + - port: 443 + protocol: TCP + targetPort: 8000 + selector: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/component: admission-controller diff --git a/apps/vertical-pod-autoscaler/manifests/ServiceAccount-vpa-admission-controller.yml b/apps/vertical-pod-autoscaler/manifests/ServiceAccount-vpa-admission-controller.yml new file mode 100644 index 00000000..ee4bb56d --- /dev/null +++ b/apps/vertical-pod-autoscaler/manifests/ServiceAccount-vpa-admission-controller.yml @@ -0,0 +1,13 @@ +--- +# Source: vertical-pod-autoscaler/templates/admission-contoller-serviceaccount.yaml +apiVersion: v1 +kind: ServiceAccount +metadata: + name: vpa-admission-controller + namespace: vpa + labels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: admission-controller + app.kubernetes.io/component-instance: vpa-admission-controller diff --git a/apps/vertical-pod-autoscaler/manifests/ServiceAccount-vpa-recommender.yml b/apps/vertical-pod-autoscaler/manifests/ServiceAccount-vpa-recommender.yml new file mode 100644 index 00000000..8d07036f --- /dev/null +++ b/apps/vertical-pod-autoscaler/manifests/ServiceAccount-vpa-recommender.yml @@ -0,0 +1,13 @@ +--- +# Source: vertical-pod-autoscaler/templates/recommender-serviceaccount.yaml +apiVersion: v1 +kind: ServiceAccount +metadata: + name: vpa-recommender + namespace: vpa + labels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: recommender + app.kubernetes.io/component-instance: vpa-recommender diff --git a/apps/vertical-pod-autoscaler/manifests/ServiceAccount-vpa-updater.yml b/apps/vertical-pod-autoscaler/manifests/ServiceAccount-vpa-updater.yml new file mode 100644 index 00000000..b75a5190 --- /dev/null +++ b/apps/vertical-pod-autoscaler/manifests/ServiceAccount-vpa-updater.yml @@ -0,0 +1,13 @@ +--- +# Source: vertical-pod-autoscaler/templates/updater-serviceaccount.yaml +apiVersion: v1 +kind: ServiceAccount +metadata: + name: vpa-updater + namespace: vpa + labels: + app.kubernetes.io/name: vertical-pod-autoscaler + app.kubernetes.io/instance: vpa + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: updater + app.kubernetes.io/component-instance: vpa-updater diff --git a/apps/vertical-pod-autoscaler/namespace.yaml b/apps/vertical-pod-autoscaler/namespace.yaml new file mode 100644 index 00000000..cca38196 --- /dev/null +++ b/apps/vertical-pod-autoscaler/namespace.yaml @@ -0,0 +1,6 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: vpa + labels: + pod-security.kubernetes.io/enforce: baseline \ No newline at end of file diff --git a/apps/vertical-pod-autoscaler/release.yaml b/apps/vertical-pod-autoscaler/release.yaml new file mode 100644 index 00000000..66846762 --- /dev/null +++ b/apps/vertical-pod-autoscaler/release.yaml @@ -0,0 +1,63 @@ +apiVersion: helm.toolkit.fluxcd.io/v2 +kind: HelmRelease +metadata: + name: vpa + namespace: vpa +spec: + serviceAccountName: helm-controller + targetNamespace: vpa + chart: + spec: + chart: vertical-pod-autoscaler + version: 0.11.0 + sourceRef: + kind: HelmRepository + name: vpa + namespace: vpa + interval: 1m + install: + crds: Skip + values: + fullnameOverride: vpa + admissionController: + replicas: 3 + resources: + limits: + memory: 500Mi + requests: + cpu: 50m + memory: 500Mi + priorityClassName: system-cluster-critical + certGen: + enabled: false # cert-manager is used to generate the certs + certManager: + enabled: true + createSelfSignedIssuer: + enabled: true + issuerRef: + name: self-signer + kind: Issuer + recommender: + replicas: 1 + resources: + limits: + memory: 500Mi + requests: + cpu: 50m + memory: 500Mi + priorityClassName: system-cluster-critical + extraArgs: + - --humanize-memory=true + - --memory-saver + - --round-memory-bytes=1 + - --pod-recommendation-min-cpu-millicores=10 + - --pod-recommendation-min-memory-mb=16 + updater: + replicas: 1 + resources: + limits: + memory: 500Mi + requests: + cpu: 50m + memory: 500Mi + priorityClassName: system-cluster-critical \ No newline at end of file diff --git a/apps/vertical-pod-autoscaler/sources.yaml b/apps/vertical-pod-autoscaler/sources.yaml new file mode 100644 index 00000000..6b38f6b0 --- /dev/null +++ b/apps/vertical-pod-autoscaler/sources.yaml @@ -0,0 +1,8 @@ +apiVersion: source.toolkit.fluxcd.io/v1 +kind: HelmRepository +metadata: + name: vpa + namespace: vpa +spec: + interval: 1h0m0s + url: https://kubernetes.github.io/autoscaler diff --git a/apps/vertical-pod-autoscaler/vpa.yaml b/apps/vertical-pod-autoscaler/vpa.yaml new file mode 100644 index 00000000..151edd4f --- /dev/null +++ b/apps/vertical-pod-autoscaler/vpa.yaml @@ -0,0 +1,41 @@ +--- +apiVersion: autoscaling.k8s.io/v1 +kind: VerticalPodAutoscaler +metadata: + name: vpa-recommender + namespace: vpa +spec: + targetRef: + apiVersion: "apps/v1" + kind: Deployment + name: vpa-recommender + updatePolicy: + updateMode: "Off" + +--- +apiVersion: autoscaling.k8s.io/v1 +kind: VerticalPodAutoscaler +metadata: + name: vpa-admission-controller + namespace: vpa +spec: + targetRef: + apiVersion: "apps/v1" + kind: Deployment + name: vpa-admission-controller + updatePolicy: + updateMode: "Off" + +--- +apiVersion: autoscaling.k8s.io/v1 +kind: VerticalPodAutoscaler +metadata: + name: vpa-updater + namespace: vpa +spec: + targetRef: + apiVersion: "apps/v1" + kind: Deployment + name: vpa-updater + updatePolicy: + updateMode: "Off" \ No newline at end of file