diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 4ea5071..5527f36 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -12,7 +12,7 @@ ## Checklist: -- [ ] 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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 73a1b71..4f83395 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/charts/newrelic-k8s-operator/Chart.yaml b/charts/newrelic-k8s-operator/Chart.yaml index 9dfb246..d66b591 100644 --- a/charts/newrelic-k8s-operator/Chart.yaml +++ b/charts/newrelic-k8s-operator/Chart.yaml @@ -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 @@ -38,3 +38,7 @@ keywords: - infrastructure - newrelic - monitoring +dependencies: + - name: common-library + version: 1.1.1 + repository: "https://helm-charts.newrelic.com" diff --git a/charts/newrelic-k8s-operator/README.md b/charts/newrelic-k8s-operator/README.md index 543d3c5..5f37ee9 100644 --- a/charts/newrelic-k8s-operator/README.md +++ b/charts/newrelic-k8s-operator/README.md @@ -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. diff --git a/charts/newrelic-k8s-operator/templates/nribundle.yaml b/charts/newrelic-k8s-operator/templates/nribundle.yaml index 4b29376..e3f8d6e 100644 --- a/charts/newrelic-k8s-operator/templates/nribundle.yaml +++ b/charts/newrelic-k8s-operator/templates/nribundle.yaml @@ -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 }} diff --git a/charts/newrelic-k8s-operator/templates/operator.yaml b/charts/newrelic-k8s-operator/templates/operator.yaml index cc22ad6..aa2c78d 100644 --- a/charts/newrelic-k8s-operator/templates/operator.yaml +++ b/charts/newrelic-k8s-operator/templates/operator.yaml @@ -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 @@ -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: @@ -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: @@ -490,3 +485,7 @@ spec: runAsUser: 1000 serviceAccountName: newrelic-k8s-operator-controller-manager terminationGracePeriodSeconds: 10 + {{- with include "newrelic.common.tolerations" . }} + tolerations: + {{- . | nindent 8 }} + {{- end }} diff --git a/charts/newrelic-k8s-operator/values.yaml b/charts/newrelic-k8s-operator/values.yaml index 1165de6..1359ec6 100644 --- a/charts/newrelic-k8s-operator/values.yaml +++ b/charts/newrelic-k8s-operator/values.yaml @@ -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