diff --git a/config/crd/bases/config.nri_nriplugindeployments.yaml b/config/crd/bases/config.nri_nriplugindeployments.yaml index b2f178ac4..abaf54033 100644 --- a/config/crd/bases/config.nri_nriplugindeployments.yaml +++ b/config/crd/bases/config.nri_nriplugindeployments.yaml @@ -66,8 +66,6 @@ spec: type: string description: Define which Nodes the Pods are scheduled on. type: object - hostPort: - type: integer nri: type: object properties: diff --git a/deployment/helm/balloons/README.md b/deployment/helm/balloons/README.md index 95fb5b1e2..8a2b4d7bc 100644 --- a/deployment/helm/balloons/README.md +++ b/deployment/helm/balloons/README.md @@ -99,7 +99,6 @@ customize with their own values, along with the default values. | `resources.cpu` | 500m | cpu resources for the Pod | | `resources.memory` | 512Mi | memory qouta for the Pod | | `extraEnv` | {} | extra environment variables to inject (string map) | -| `hostPort` | 8891 | metrics port to expose on the host | | `config` | see [helm chart values](tree:/deployment/helm/balloons/values.yaml) for the default configuration | plugin configuration data | | `configGroupLabel` | config.nri/group | node label for grouping configuration | | `nri.runtime.config.pluginRegistrationTimeout` | "" | set NRI plugin registration timeout in NRI config of containerd or CRI-O | @@ -114,3 +113,4 @@ customize with their own values, along with the default values. | `affinity` | [] | specify node affinity | | `nodeSelector` | [] | specify node selector labels | | `podPriorityClassNodeCritical` | true | enable [marking Pod as node critical](https://kubernetes.io/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/#marking-pod-as-critical) | +| `ports` | [] | extra ports to expose to the host | diff --git a/deployment/helm/balloons/templates/daemonset.yaml b/deployment/helm/balloons/templates/daemonset.yaml index fb4fdff34..df2d05a0c 100644 --- a/deployment/helm/balloons/templates/daemonset.yaml +++ b/deployment/helm/balloons/templates/daemonset.yaml @@ -75,11 +75,14 @@ spec: - --config-group-label - {{ .Values.configGroupLabel }} {{- end }} + {{- if (not (eq .Values.ports nil)) }} ports: - - containerPort: 8891 - protocol: TCP - hostPort: {{ .Values.hostPort }} - name: metrics + {{- range $port := .Values.ports }} + - name: {{ $port.name }} + containerPort: {{ $port.container }} + hostPort: {{ $port.host }} + {{- end }} + {{- end }} env: - name: NODE_NAME valueFrom: diff --git a/deployment/helm/balloons/values.schema.json b/deployment/helm/balloons/values.schema.json index f2a0e68b6..d948d9342 100644 --- a/deployment/helm/balloons/values.schema.json +++ b/deployment/helm/balloons/values.schema.json @@ -2,7 +2,6 @@ "$schema": "http://json-schema.org/schema#", "required": [ "image", - "hostPort", "resources" ], "properties": { @@ -114,11 +113,34 @@ } } }, - "hostPort": { - "type": "integer" - }, "podPriorityClassNodeCritical": { "type": "boolean" + }, + "ports": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name", + "container", + "host" + ], + "properties": { + "name": { + "type": "string" + }, + "container": { + "type": "integer", + "minimum": 1, + "maximum": 65535 + }, + "host": { + "type": "integer", + "minimum": 1, + "maximum": 65535 + } + } + } } } } diff --git a/deployment/helm/balloons/values.yaml b/deployment/helm/balloons/values.yaml index 54465b3f8..82812eb91 100644 --- a/deployment/helm/balloons/values.yaml +++ b/deployment/helm/balloons/values.yaml @@ -56,8 +56,6 @@ config: plugin-test: enableAPIs: false -hostPort: 8891 - resources: cpu: 500m memory: 512Mi @@ -117,3 +115,13 @@ nodeSelector: [] # autoscaling enough new nodes are brought up to leave room for the # plugin on each new node. podPriorityClassNodeCritical: true + +# extra ports to expose to the host +# +# Example +# +# # Note: This is not necessary for collecting metrics. +# ports: +# - name: metrics +# container: 8891 +# host: 8891 diff --git a/deployment/helm/template/README.md b/deployment/helm/template/README.md index a70ab04ac..ad4607b98 100644 --- a/deployment/helm/template/README.md +++ b/deployment/helm/template/README.md @@ -99,7 +99,6 @@ customize with their own values, along with the default values. | `resources.cpu` | 500m | cpu resources for the Pod | | `resources.memory` | 512Mi | memory qouta for the Pod | | `extraEnv` | {} | extra environment variables to inject (string map) | -| `hostPort` | 8891 | metrics port to expose on the host | | `config` | see [helm chart values](tree:/deployment/helm/template/values.yaml) for the default configuration | plugin configuration data | | `configGroupLabel` | config.nri/group | node label for grouping configuration | | `nri.runtime.config.pluginRegistrationTimeout` | "" | set NRI plugin registration timeout in NRI config of containerd or CRI-O | @@ -112,3 +111,4 @@ customize with their own values, along with the default values. | `initImage.pullPolicy` | Always | init container image pull policy | | `tolerations` | [] | specify taint toleration key, operator and effect | | `podPriorityClassNodeCritical` | true | enable [marking Pod as node critical](https://kubernetes.io/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/#marking-pod-as-critical) | +| `ports` | [] | extra ports to expose to the host | diff --git a/deployment/helm/template/templates/daemonset.yaml b/deployment/helm/template/templates/daemonset.yaml index 3d8a6d628..f34c84bce 100644 --- a/deployment/helm/template/templates/daemonset.yaml +++ b/deployment/helm/template/templates/daemonset.yaml @@ -68,11 +68,14 @@ spec: - --config-group-label - {{ .Values.configGroupLabel }} {{- end }} + {{- if (not (eq .Values.ports nil)) }} ports: - - containerPort: 8891 - protocol: TCP - hostPort: {{ .Values.hostPort }} - name: metrics + {{- range $port := .Values.ports }} + - name: {{ $port.name }} + containerPort: {{ $port.container }} + hostPort: {{ $port.host }} + {{- end }} + {{- end }} env: - name: NODE_NAME valueFrom: diff --git a/deployment/helm/template/values.schema.json b/deployment/helm/template/values.schema.json index f2a0e68b6..d948d9342 100644 --- a/deployment/helm/template/values.schema.json +++ b/deployment/helm/template/values.schema.json @@ -2,7 +2,6 @@ "$schema": "http://json-schema.org/schema#", "required": [ "image", - "hostPort", "resources" ], "properties": { @@ -114,11 +113,34 @@ } } }, - "hostPort": { - "type": "integer" - }, "podPriorityClassNodeCritical": { "type": "boolean" + }, + "ports": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name", + "container", + "host" + ], + "properties": { + "name": { + "type": "string" + }, + "container": { + "type": "integer", + "minimum": 1, + "maximum": 65535 + }, + "host": { + "type": "integer", + "minimum": 1, + "maximum": 65535 + } + } + } } } } diff --git a/deployment/helm/template/values.yaml b/deployment/helm/template/values.yaml index 321d46a5e..66f9e2187 100644 --- a/deployment/helm/template/values.yaml +++ b/deployment/helm/template/values.yaml @@ -31,8 +31,6 @@ config: plugin-test: enableAPIs: false -hostPort: 8891 - resources: cpu: 500m memory: 512Mi @@ -71,3 +69,13 @@ tolerations: [] # autoscaling enough new nodes are brought up to leave room for the # plugin on each new node. podPriorityClassNodeCritical: true + +# extra ports to expose to the host +# +# Example +# +# # Note: This is not necessary for collecting metrics. +# ports: +# - name: metrics +# container: 8891 +# host: 8891 diff --git a/deployment/helm/topology-aware/README.md b/deployment/helm/topology-aware/README.md index 41df43705..17eb13243 100644 --- a/deployment/helm/topology-aware/README.md +++ b/deployment/helm/topology-aware/README.md @@ -100,7 +100,6 @@ customize with their own values, along with the default values. | `resources.cpu` | 500m | cpu resources for the Pod | | `resources.memory` | 512Mi | memory qouta for the Pod | | `extraEnv` | {} | extra environment variables to inject (string map) | -| `hostPort` | 8891 | metrics port to expose on the host | | `config` | see [helm chart values](tree:/deployment/helm/topology-aware/values.yaml) for the default configuration | plugin configuration data | | `configGroupLabel` | config.nri/group | node label for grouping configuration | | `nri.runtime.config.pluginRegistrationTimeout` | "" | set NRI plugin registration timeout in NRI config of containerd or CRI-O | @@ -115,3 +114,4 @@ customize with their own values, along with the default values. | `affinity` | [] | specify node affinity | | `nodeSelector` | [] | specify node selector labels | | `podPriorityClassNodeCritical` | true | enable [marking Pod as node critical](https://kubernetes.io/docs/tasks/administer-cluster/guaranteed-scheduling-critical-addon-pods/#marking-pod-as-critical) | +| `ports` | [] | extra ports to expose to the host | diff --git a/deployment/helm/topology-aware/templates/daemonset.yaml b/deployment/helm/topology-aware/templates/daemonset.yaml index b012026b8..2108cf388 100644 --- a/deployment/helm/topology-aware/templates/daemonset.yaml +++ b/deployment/helm/topology-aware/templates/daemonset.yaml @@ -75,11 +75,14 @@ spec: - --config-group-label - {{ .Values.configGroupLabel }} {{- end }} + {{- if (not (eq .Values.ports nil)) }} ports: - - containerPort: 8891 - protocol: TCP - hostPort: {{ .Values.hostPort }} - name: metrics + {{- range $port := .Values.ports }} + - name: {{ $port.name }} + containerPort: {{ $port.container }} + hostPort: {{ $port.host }} + {{- end }} + {{- end }} env: - name: NODE_NAME valueFrom: diff --git a/deployment/helm/topology-aware/values.schema.json b/deployment/helm/topology-aware/values.schema.json index f2a0e68b6..d948d9342 100644 --- a/deployment/helm/topology-aware/values.schema.json +++ b/deployment/helm/topology-aware/values.schema.json @@ -2,7 +2,6 @@ "$schema": "http://json-schema.org/schema#", "required": [ "image", - "hostPort", "resources" ], "properties": { @@ -114,11 +113,34 @@ } } }, - "hostPort": { - "type": "integer" - }, "podPriorityClassNodeCritical": { "type": "boolean" + }, + "ports": { + "type": "array", + "items": { + "type": "object", + "required": [ + "name", + "container", + "host" + ], + "properties": { + "name": { + "type": "string" + }, + "container": { + "type": "integer", + "minimum": 1, + "maximum": 65535 + }, + "host": { + "type": "integer", + "minimum": 1, + "maximum": 65535 + } + } + } } } } diff --git a/deployment/helm/topology-aware/values.yaml b/deployment/helm/topology-aware/values.yaml index 751d28698..0a83c17f3 100644 --- a/deployment/helm/topology-aware/values.yaml +++ b/deployment/helm/topology-aware/values.yaml @@ -31,8 +31,6 @@ config: plugin-test: enableAPIs: false -hostPort: 8891 - resources: cpu: 500m memory: 512Mi @@ -92,3 +90,13 @@ nodeSelector: [] # autoscaling enough new nodes are brought up to leave room for the # plugin on each new node. podPriorityClassNodeCritical: true + +# extra ports to expose to the host +# +# Example +# +# # Note: This is not necessary for collecting metrics. +# ports: +# - name: metrics +# container: 8891 +# host: 8891