Skip to content

Commit

Permalink
Merge pull request #1228 from stevehipwell/helm-chart-release-v3.9.0
Browse files Browse the repository at this point in the history
Helm chart release v3.9.0
  • Loading branch information
k8s-ci-robot authored Mar 28, 2023
2 parents a938798 + d32d0c9 commit 5748099
Show file tree
Hide file tree
Showing 11 changed files with 229 additions and 61 deletions.
10 changes: 7 additions & 3 deletions charts/metrics-server/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: metrics-server
description: Metrics Server is a scalable, efficient source of container resource metrics for Kubernetes built-in autoscaling pipelines.
type: application
version: 3.8.4
appVersion: 0.6.2
version: 3.9.0
appVersion: 0.6.3
keywords:
- kubernetes
- metrics-server
Expand All @@ -21,5 +21,9 @@ maintainers:
url: https://github.com/endrec
annotations:
artifacthub.io/changes: |
- kind: added
description: "Added autoscaling support via the addon-resizer."
- kind: changed
description: "Changed the image registry location to registry.k8s.io."
description: "Updated the Metrics Server OCI image to v0.6.3."
- kind: fixed
description: "Fixed service labels/annotations."
121 changes: 66 additions & 55 deletions charts/metrics-server/README.md

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions charts/metrics-server/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ The image to use
{{- printf "%s:%s" .Values.image.repository (default (printf "v%s" .Chart.AppVersion) .Values.image.tag) }}
{{- end }}

{{/*
The image to use for the addon resizer
*/}}
{{- define "metrics-server.addonResizer.image" -}}
{{- printf "%s:%s" .Values.addonResizer.image.repository .Values.addonResizer.image.tag }}
{{- end }}

{{/* Get PodDisruptionBudget API Version */}}
{{- define "metrics-server.pdb.apiVersion" -}}
{{- if and (.Capabilities.APIVersions.Has "policy/v1") (semverCompare ">= 1.21-0" .Capabilities.KubeVersion.Version) -}}
Expand Down
13 changes: 13 additions & 0 deletions charts/metrics-server/templates/clusterrole-nanny.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{{- if and .Values.rbac.create .Values.addonResizer.enabled -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ printf "system:%s-nanny" (include "metrics-server.fullname" .) }}
labels:
{{- include "metrics-server.labels" . | nindent 4 }}
rules:
- nonResourceURLs:
- /metrics
verbs:
- get
{{- end -}}
18 changes: 18 additions & 0 deletions charts/metrics-server/templates/clusterrolebinding-nanny.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{- if .Values.rbac.create -}}
{{- if .Values.addonResizer.enabled -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ printf "system:%s-nanny" (include "metrics-server.fullname" .) }}
labels:
{{- include "metrics-server.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: system:{{ template "metrics-server.fullname" . }}-nanny
subjects:
- kind: ServiceAccount
name: {{ include "metrics-server.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end -}}
{{- end -}}
17 changes: 17 additions & 0 deletions charts/metrics-server/templates/configmaps-nanny.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{- if .Values.addonResizer.enabled -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "metrics-server.fullname" .}}-nanny-config
namespace: {{ .Release.Namespace }}
labels:
{{- include "metrics-server.labels" . | nindent 4 }}
data:
NannyConfiguration: |-
apiVersion: nannyconfig/v1alpha1
kind: NannyConfiguration
baseCPU: {{ .Values.addonResizer.nanny.cpu }}
cpuPerNode: {{ .Values.addonResizer.nanny.extraCpu }}
baseMemory: {{ .Values.addonResizer.nanny.memory }}
memoryPerNode: {{ .Values.addonResizer.nanny.extraMemory }}
{{- end -}}
31 changes: 31 additions & 0 deletions charts/metrics-server/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,37 @@ spec:
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if .Values.addonResizer.enabled }}
- name: metrics-server-nanny
image: {{ include "metrics-server.addonResizer.image" . }}
env:
- name: MY_POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: MY_POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
command:
- /pod_nanny
- --config-dir=/etc/config
- --deployment={{ include "metrics-server.fullname" . }}
- --threshold={{ .Values.addonResizer.nanny.threshold }}
- --deployment={{ include "metrics-server.fullname" . }}
- --container=metrics-server
- --poll-period={{ .Values.addonResizer.nanny.pollPeriod }}
- --estimator=exponential
- --minClusterSize={{ .Values.addonResizer.nanny.minClusterSize }}
- --use-metrics=true
volumeMounts:
- name: nanny-config-volume
mountPath: /etc/config
{{- with .Values.addonResizer.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
volumes:
- name: tmp
emptyDir: {}
Expand Down
27 changes: 27 additions & 0 deletions charts/metrics-server/templates/role-nanny.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{- if .Values.rbac.create -}}
{{- if .Values.addonResizer.enabled -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ printf "system:%s-nanny" (include "metrics-server.fullname" .) }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "metrics-server.labels" . | nindent 4 }}
rules:
- apiGroups:
- ""
resources:
- pods
verbs:
- get
- apiGroups:
- apps
resources:
- deployments
resourceNames:
- metrics-server
verbs:
- get
- patch
{{- end -}}
{{- end -}}
19 changes: 19 additions & 0 deletions charts/metrics-server/templates/rolebinding-nanny.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{- if .Values.rbac.create -}}
{{- if .Values.addonResizer.enabled -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ printf "%s-nanny" (include "metrics-server.fullname" .) }}
namespace: kube-system
labels:
{{- include "metrics-server.labels" . | nindent 4 }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: metrics-server-nanny
subjects:
- kind: ServiceAccount
name: {{ include "metrics-server.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end -}}
{{- end -}}
6 changes: 3 additions & 3 deletions charts/metrics-server/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ metadata:
namespace: {{ .Release.Namespace }}
labels:
{{- include "metrics-server.labels" . | nindent 4 }}
{{- with .Values.service.annotations }}
annotations:
{{- with .Values.service.labels -}}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.service.labels -}}
{{- with .Values.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
Expand Down
21 changes: 21 additions & 0 deletions charts/metrics-server/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,27 @@ service:
# kubernetes.io/cluster-service: "true"
# kubernetes.io/name: "Metrics-server"

addonResizer:
enabled: false
image:
repository: registry.k8s.io/autoscaling/addon-resizer
tag: 1.8.14
resources:
limits:
cpu: 40m
memory: 25Mi
requests:
cpu: 40m
memory: 25Mi
nanny:
cpu: 20m
extraCpu: 1m
extraMemory: 2Mi
memory: 15Mi
minClusterSize: 10
pollPeriod: 300000
threshold: 5

metrics:
enabled: false

Expand Down

0 comments on commit 5748099

Please sign in to comment.