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

helm: adding resources override for the operator manager controller #83

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
## Checklist:
<!-- Please check applicable options. -->

- [ ] Add changelog entry following the [contributing guide](../CONTRIBUTING.md#pull-requests)
- [ ] Add changelog entry following the [contributing guide](https://github.com/newrelic/newrelic-k8s-operator/blob/main/CONTRIBUTING.md#pull-requests)
- [ ] Documentation has been updated
- [ ] This change requires changes in testing:
- [ ] unit tests
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## Unreleased

## v0.7.0 - 2024-02-26

### 🚀 Enhancements
- Add configuration overrides for the operator pod's resources
- Add the use of `common-library` Helm chart of Newrelic
- Add override options for `tolerations` and `affinity` to the Operator `Deployment`

## v0.6.1 - 2023-12-11

### ⛓️ Dependencies
Expand Down
6 changes: 5 additions & 1 deletion charts/newrelic-k8s-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ version: 0.6.0
# application. Versions are not expected to follow Semantic Versioning.
# They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.6.0"
appVersion: "0.7.0"
maintainers:
- name: aimichelle
url: https://github.com/aimichelle
Expand All @@ -38,3 +38,7 @@ keywords:
- infrastructure
- newrelic
- monitoring
dependencies:
- name: common-library
version: 1.1.1
repository: "https://helm-charts.newrelic.com"
2 changes: 1 addition & 1 deletion charts/newrelic-k8s-operator/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# newrelic-k8s-operator

![Version: 0.6.0](https://img.shields.io/badge/Version-0.6.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.6.0](https://img.shields.io/badge/AppVersion-0.6.0-informational?style=flat-square)
![Version: 0.7.0](https://img.shields.io/badge/Version-0.7.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.7.0](https://img.shields.io/badge/AppVersion-0.7.0-informational?style=flat-square)

A Helm chart for New Relic's Kubernetes operator.

Expand Down
2 changes: 1 addition & 1 deletion charts/newrelic-k8s-operator/templates/nribundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ spec:
global:
{{ toYaml $global | indent 4 }}
{{- end }}
{{- $values := omit .Values "global" "newRelicLicenseKey" }}
{{- $values := omit .Values "global" "newRelicLicenseKey" "controller" }}
{{ toYaml $values | indent 2 }}
47 changes: 23 additions & 24 deletions charts/newrelic-k8s-operator/templates/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -415,21 +415,26 @@ spec:
control-plane: controller-manager
spec:
affinity:
{{- $affinity := include "newrelic.common.affinity" . }}
{{- if not $affinity }}
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/arch
operator: In
values:
- amd64
- arm64
- ppc64le
- s390x
- key: kubernetes.io/os
operator: In
values:
- linux
- matchExpressions:
- key: kubernetes.io/arch
operator: In
values:
- amd64
- arm64
- ppc64le
- s390x
- key: kubernetes.io/os
operator: In
values:
- linux
{{- else }}
{{- $affinity | nindent 8 }}
{{- end }}
containers:
- args:
- --secure-listen-address=0.0.0.0:8443
Expand All @@ -443,12 +448,7 @@ spec:
name: https
protocol: TCP
resources:
limits:
cpu: 500m
memory: 128Mi
requests:
cpu: 5m
memory: 64Mi
{{- toYaml .Values.controller.rbacProxy.resources | nindent 10}}
securityContext:
allowPrivilegeEscalation: false
capabilities:
Expand All @@ -474,12 +474,7 @@ spec:
initialDelaySeconds: 5
periodSeconds: 10
resources:
limits:
cpu: 500m
memory: 512Mi
requests:
cpu: 10m
memory: 256Mi
{{- toYaml .Values.controller.manager.resources | nindent 10}}
securityContext:
allowPrivilegeEscalation: false
capabilities:
Expand All @@ -490,3 +485,7 @@ spec:
runAsUser: 1000
serviceAccountName: newrelic-k8s-operator-controller-manager
terminationGracePeriodSeconds: 10
{{- with include "newrelic.common.tolerations" . }}
tolerations:
{{- . | nindent 8 }}
{{- end }}
43 changes: 43 additions & 0 deletions charts/newrelic-k8s-operator/values.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,48 @@
version: ""
newRelicLicenseKey: ""
# -- change the operator controller configurations.
# @default -- See [`values.yaml`](values.yaml)
controller:
# -- change the operator controller's pod manager container configurations.
# @default -- See [`values.yaml`](values.yaml)
manager:
# -- change the operator controller's pod manager container resources configurations.
# @default -- See [`values.yaml`](values.yaml)
resources:
limits:
# -- (string) Sets manager container in the controller's CPU resource limits
# @default -- 500m
cpu: 500m
# -- (string) Sets manager container in the controller's Memory resource limits
# @default -- 512Mi
memory: 512Mi
requests:
# -- (string) Sets manager container in the controller's CPU resource requests
# @default -- 10m
cpu: 10m
# -- (string) Sets manager container in the controller's Memory resource requests
# @default -- 256Mi
memory: 256Mi
# -- change the operator controller's pod kube-rbac-proxy container configurations.
# @default -- See [`values.yaml`](values.yaml)
rbacProxy:
# -- change the operator controller's pod pod kube-rbac-proxy container resources configurations.
# @default -- See [`values.yaml`](values.yaml)
resources:
limits:
# -- (string) Sets kube-rbac-proxy container in the controller's CPU resource limits
# @default -- 500m
cpu: 500m
# -- (string) Sets kube-rbac-proxy container in the controller's Memory resource limits
# @default -- 128Mi
memory: 128Mi
requests:
# -- (string) Sets kube-rbac-proxy container in the controller's CPU resource requests
# @default -- 5m
cpu: 5m
# -- (string) Sets kube-rbac-proxy container in the controller's Memory resource requests
# @default -- 64Mi
memory: 64Mi
newrelic-infrastructure:
# newrelic-infrastructure.enabled -- Install the [`newrelic-infrastructure` chart](https://github.com/newrelic/nri-kubernetes/tree/main/charts/newrelic-infrastructure)
enabled: true
Expand Down