-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow deploying additional VPA recommenders
- Loading branch information
Showing
28 changed files
with
2,039 additions
and
22 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
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
6 changes: 6 additions & 0 deletions
6
fleetshard/pkg/central/charts/data/rhacs-vertical-pod-autoscaling/Chart.yaml
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,6 @@ | ||
apiVersion: v2 | ||
name: rhacs-vertical-pod-autoscaling | ||
description: A Helm chart for Kubernetes | ||
type: application | ||
version: 0.0.0 | ||
appVersion: "0.0.0" |
181 changes: 181 additions & 0 deletions
181
.../central/charts/data/rhacs-vertical-pod-autoscaling/templates/recommender-deployment.yaml
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,181 @@ | ||
{{- range .Values.recommenders }} | ||
apiVersion: apps/v1 | ||
kind: Deployment | ||
metadata: | ||
labels: | ||
app.kubernetes.io/name: "rhacs-vpa-recommender" | ||
app.kubernetes.io/instance: {{ $.Release.Name | quote }} | ||
app.kubernetes.io/version: {{ $.Chart.AppVersion | quote }} | ||
app.kubernetes.io/managed-by: {{ $.Release.Service | quote }} | ||
helm.sh/chart: "{{ $.Chart.Name }}-{{ $.Chart.Version | replace "+" "_"}}" | ||
meta.helm.sh/release-name: {{ $.Release.Name | quote }} | ||
meta.helm.sh/release-namespace: {{ $.Release.Namespace | quote }} | ||
name: {{ .name | quote }} | ||
namespace: {{ $.Release.Namespace | quote }} | ||
spec: | ||
replicas: 1 | ||
selector: | ||
matchLabels: | ||
app: vpa-recommender | ||
vertical-pod-autoscaler: {{ .name | quote }} | ||
template: | ||
metadata: | ||
labels: | ||
app: vpa-recommender | ||
vertical-pod-autoscaler: {{ .name | quote }} | ||
spec: | ||
nodeSelector: | ||
beta.kubernetes.io/os: linux | ||
node-role.kubernetes.io/control-plane: '' | ||
serviceAccountName: rhacs-vpa-recommender | ||
terminationGracePeriodSeconds: 30 | ||
tolerations: | ||
- key: CriticalAddonsOnly | ||
operator: Exists | ||
- key: node-role.kubernetes.io/master | ||
operator: Exists | ||
effect: NoSchedule | ||
priorityClassName: system-cluster-critical | ||
{{ if .imagePullSecrets }} | ||
imagePullSecrets: {{ toYaml .imagePullSecrets | nindent 8 }} | ||
{{- end }} | ||
containers: | ||
- name: recommender | ||
image: {{ .image | quote }} | ||
imagePullPolicy: Always | ||
securityContext: | ||
runAsNonRoot: true | ||
allowPrivilegeEscalation: false | ||
runAsUser: 1001080000 | ||
seccompProfile: | ||
type: RuntimeDefault | ||
capabilities: | ||
drop: [ALL] | ||
{{ if .resources }} | ||
resources: {{ toYaml .resources | nindent 12 }} | ||
{{- end }} | ||
command: | ||
- recommender | ||
args: | ||
- --recommender-name={{ .name }} | ||
- --logtostderr | ||
- --v=1 | ||
{{- if .recommendationMarginFraction }} | ||
- --recommendation-margin-fraction={{ .recommendationMarginFraction }} | ||
{{- end }} | ||
{{- if .podRecommendationMinCpuMillicores }} | ||
- --pod-recommendation-min-cpu-millicores={{ .podRecommendationMinCpuMillicores }} | ||
{{- end }} | ||
{{- if .podRecommendationMinMemoryMb }} | ||
- --pod-recommendation-min-memory-mb={{ .podRecommendationMinMemoryMb }} | ||
{{- end }} | ||
{{- if .targetCpuPercentile }} | ||
- --target-cpu-percentile={{ .targetCpuPercentile }} | ||
{{- end }} | ||
{{- if .recommendationLowerBoundCpuPercentile }} | ||
- --recommendation-lower-bound-cpu-percentile={{ .recommendationLowerBoundCpuPercentile }} | ||
{{- end }} | ||
{{- if .recommendationUpperBoundCpuPercentile }} | ||
- --recommendation-upper-bound-cpu-percentile={{ .recommendationUpperBoundCpuPercentile }} | ||
{{- end }} | ||
{{- if .targetMemoryPercentile }} | ||
- --target-memory-percentile={{ .targetMemoryPercentile }} | ||
{{- end }} | ||
{{- if .recommendationLowerBoundMemoryPercentile }} | ||
- --recommendation-lower-bound-memory-percentile={{ .recommendationLowerBoundMemoryPercentile }} | ||
{{- end }} | ||
{{- if .recommendationUpperBoundMemoryPercentile }} | ||
- --recommendation-upper-bound-memory-percentile={{ .recommendationUpperBoundMemoryPercentile }} | ||
{{- end }} | ||
{{- if .checkpointsTimeout }} | ||
- --checkpoints-timeout={{ .checkpointsTimeout }} | ||
{{- end }} | ||
{{- if .minCheckpoints }} | ||
- --min-checkpoints={{ .minCheckpoints }} | ||
{{- end }} | ||
{{- if .memorySaver }} | ||
- --memory-saver | ||
{{- end }} | ||
{{- if .recommenderInterval }} | ||
- --recommender-interval={{ .recommenderInterval }} | ||
{{- end }} | ||
{{- if .checkpointsGcInterval }} | ||
- --checkpoints-gc-interval={{ .checkpointsGcInterval }} | ||
{{- end }} | ||
{{- if .prometheusAddress }} | ||
- --prometheus-address={{ .prometheusAddress }} | ||
{{- end }} | ||
{{- if .prometheusCadvisorJobName }} | ||
- --prometheus-cadvisor-job-name={{ .prometheusCadvisorJobName }} | ||
{{- end }} | ||
{{- if .address }} | ||
- --address={{ .address }} | ||
{{- end }} | ||
{{- if .kubeconfig }} | ||
- --kubeconfig={{ .kubeconfig }} | ||
{{- end }} | ||
{{- if .kubeApiQps }} | ||
- --kube-api-qps={{ .kubeApiQps }} | ||
{{- end }} | ||
{{- if .kubeApiBurst }} | ||
- --kube-api-burst={{ .kubeApiBurst }} | ||
{{- end }} | ||
{{- if .storage }} | ||
- --storage={{ .storage }} | ||
{{- end }} | ||
{{- if .historyLength }} | ||
- --history-length={{ .historyLength }} | ||
{{- end }} | ||
{{- if .historyResolution }} | ||
- --history-resolution={{ .historyResolution }} | ||
{{- end }} | ||
{{- if .prometheusQueryTimeout }} | ||
- --prometheus-query-timeout={{ .prometheusQueryTimeout }} | ||
{{- end }} | ||
{{- if .podLabelPrefix }} | ||
- --pod-label-prefix={{ .podLabelPrefix }} | ||
{{- end }} | ||
{{- if .metricForPodLabels }} | ||
- --metric-for-pod-labels={{ .metricForPodLabels }} | ||
{{- end }} | ||
{{- if .podNamespaceLabel }} | ||
- --pod-namespace-label={{ .podNamespaceLabel }} | ||
{{- end }} | ||
{{- if .podNameLabel }} | ||
- --pod-name-label={{ .podNameLabel }} | ||
{{- end }} | ||
{{- if .containerNamespaceLabel }} | ||
- --container-namespace-label={{ .containerNamespaceLabel }} | ||
{{- end }} | ||
{{- if .containerPodNameLabel }} | ||
- --container-pod-name-label={{ .containerPodNameLabel }} | ||
{{- end }} | ||
{{- if .containerNameLabel }} | ||
- --container-name-label={{ .containerNameLabel }} | ||
{{- end }} | ||
{{- if .vpaObjectNamespace }} | ||
- --vpa-object-namespace={{ .vpaObjectNamespace }} | ||
{{- end }} | ||
{{- if .memoryAggregationInterval }} | ||
- --memory-aggregation-interval={{ .memoryAggregationInterval }} | ||
{{- end }} | ||
{{- if .memoryAggregationIntervalCount }} | ||
- --memory-aggregation-interval-count={{ .memoryAggregationIntervalCount }} | ||
{{- end }} | ||
{{- if .memoryHistogramDecayHalfLife }} | ||
- --memory-histogram-decay-half-life={{ .memoryHistogramDecayHalfLife }} | ||
{{- end }} | ||
{{- if .cpuHistogramDecayHalfLife }} | ||
- --cpu-histogram-decay-half-life={{ .cpuHistogramDecayHalfLife }} | ||
{{- end }} | ||
{{- if .cpuIntegerPostProcessorEnabled }} | ||
- --cpu-integer-post-processor-enabled={{ .cpuIntegerPostProcessorEnabled }} | ||
{{- end }} | ||
env: | ||
- name: NAMESPACE | ||
valueFrom: | ||
fieldRef: | ||
apiVersion: v1 | ||
fieldPath: metadata.namespace | ||
--- | ||
{{- end }} |
87 changes: 87 additions & 0 deletions
87
...rd/pkg/central/charts/data/rhacs-vertical-pod-autoscaling/templates/recommender-rbac.yaml
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,87 @@ | ||
apiVersion: v1 | ||
kind: ServiceAccount | ||
metadata: | ||
name: rhacs-vpa-recommender | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
app.kubernetes.io/name: "rhacs-vpa-recommender" | ||
app.kubernetes.io/instance: {{ $.Release.Name | quote }} | ||
app.kubernetes.io/version: {{ $.Chart.AppVersion | quote }} | ||
app.kubernetes.io/managed-by: {{ $.Release.Service | quote }} | ||
helm.sh/chart: "{{ $.Chart.Name }}-{{ $.Chart.Version | replace "+" "_"}}" | ||
meta.helm.sh/release-name: {{ $.Release.Name | quote }} | ||
meta.helm.sh/release-namespace: {{ $.Release.Namespace | quote }} | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRole | ||
metadata: | ||
name: rhacs-vpa-recommender | ||
labels: | ||
app.kubernetes.io/name: "rhacs-vpa-recommender" | ||
app.kubernetes.io/instance: {{ $.Release.Name | quote }} | ||
app.kubernetes.io/version: {{ $.Chart.AppVersion | quote }} | ||
app.kubernetes.io/managed-by: {{ $.Release.Service | quote }} | ||
helm.sh/chart: "{{ $.Chart.Name }}-{{ $.Chart.Version | replace "+" "_"}}" | ||
meta.helm.sh/release-name: {{ $.Release.Name | quote }} | ||
meta.helm.sh/release-namespace: {{ $.Release.Namespace | quote }} | ||
rules: | ||
- apiGroups: ["autoscaling.k8s.io"] | ||
resources: ["verticalpodautoscalers"] | ||
verbs: ["get", "list", "watch", "patch"] | ||
|
||
- apiGroups: ["autoscaling.k8s.io"] | ||
resources: ["verticalpodautoscalercheckpoints"] | ||
verbs: ["get", "list", "watch", "patch", "create"] | ||
|
||
- apiGroups: ["apps.openshift.io"] | ||
resources: ["scale", "deploymentconfigs"] | ||
verbs: ["get", "list", "watch"] | ||
|
||
- apiGroups: ["apps"] | ||
resources: ["statefulsets", "replicasets", "deployments", "daemonsets"] | ||
verbs: ["get", "list", "watch"] | ||
|
||
- apiGroups: ["*"] | ||
resources: ["scale"] | ||
verbs: ["get", "watch"] | ||
|
||
- apiGroups: [""] | ||
resources: ["replicationcontrollers", "pods", "nodes", "limitranges"] | ||
verbs: ["get", "list", "watch"] | ||
|
||
- apiGroups: [""] | ||
resources: ["namespaces"] | ||
verbs: ["get", "list"] | ||
|
||
- apiGroups: [""] | ||
resources: ["events"] | ||
verbs: ["get", "list", "watch", "create"] | ||
|
||
- apiGroups: ["metrics.k8s.io"] | ||
resources: ["pods"] | ||
verbs: ["get", "list"] | ||
|
||
- apiGroups: ["batch"] | ||
resources: ["jobs", "cronjobs"] | ||
verbs: ["get", "list", "watch"] | ||
--- | ||
apiVersion: rbac.authorization.k8s.io/v1 | ||
kind: ClusterRoleBinding | ||
metadata: | ||
name: rhacs-vpa-recommender | ||
labels: | ||
app.kubernetes.io/name: "rhacs-vpa-recommender" | ||
app.kubernetes.io/instance: {{ $.Release.Name | quote }} | ||
app.kubernetes.io/version: {{ $.Chart.AppVersion | quote }} | ||
app.kubernetes.io/managed-by: {{ $.Release.Service | quote }} | ||
helm.sh/chart: "{{ $.Chart.Name }}-{{ $.Chart.Version | replace "+" "_"}}" | ||
meta.helm.sh/release-name: {{ $.Release.Name | quote }} | ||
meta.helm.sh/release-namespace: {{ $.Release.Namespace | quote }} | ||
roleRef: | ||
apiGroup: rbac.authorization.k8s.io | ||
kind: ClusterRole | ||
name: rhacs-vpa-recommender | ||
subjects: | ||
- kind: ServiceAccount | ||
name: rhacs-vpa-recommender | ||
namespace: {{ .Release.Namespace }} |
1 change: 1 addition & 0 deletions
1
fleetshard/pkg/central/charts/data/rhacs-vertical-pod-autoscaling/values.yaml
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 @@ | ||
recommenders: [] |
Oops, something went wrong.