Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add containerSecurityContext for addonResizer #1369

Merged
merged 1 commit into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions charts/metrics-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ The following table lists the configurable parameters of the _Metrics Server_ ch
| `service.annotations` | Annotations to add to the service. | `{}` |
| `service.labels` | Labels to add to the service. | `{}` |
| `addonResizer.enabled` | If `true`, run the addon-resizer as a sidecar to automatically scale resource requests with cluster size. | `false` |
| `addonResizer.securityContext` | Security context for the _metrics_server_container. | _See values.yaml |
| `addonResizer.image.repository` | addon-resizer image repository | `registry.k8s.io/autoscaling/addon-resizer` |
| `addonResizer.image.tag` | addon-resizer image tag | `1.8.19` |
| `addonResizer.resources` | Resource requests and limits for the _nanny_ container. | `{ requests: { cpu: 40m, memory: 25Mi }, limits: { cpu: 40m, memory: 25Mi } }` |
Expand Down
4 changes: 4 additions & 0 deletions charts/metrics-server/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ spec:
{{- end }}
{{- if .Values.addonResizer.enabled }}
- name: metrics-server-nanny
{{- with .Values.addonResizer.securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
image: {{ include "metrics-server.addonResizer.image" . }}
env:
- name: MY_POD_NAME
Expand Down
10 changes: 10 additions & 0 deletions charts/metrics-server/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,16 @@ addonResizer:
image:
repository: registry.k8s.io/autoscaling/addon-resizer
tag: 1.8.19
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 1000
seccompProfile:
type: RuntimeDefault
capabilities:
drop:
- ALL
resources:
requests:
cpu: 40m
Expand Down
10 changes: 10 additions & 0 deletions manifests/components/autoscale/patch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ spec:
resources:
$patch: delete
- name: metrics-server-nanny
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 1000
seccompProfile:
type: RuntimeDefault
capabilities:
drop:
- ALL
image: registry.k8s.io/autoscaling/addon-resizer:1.8.19
resources:
limits:
Expand Down