Skip to content

Commit 18d927a

Browse files
authored
Merge pull request #87 from oracle-quickstart/extraenv_1.5.0
Add extraEnv to Management Agent, hostPath ownership change support, update agent image to 1.6.0, update metrics-server to 0.7.2
2 parents d0512d6 + 28c7e1a commit 18d927a

10 files changed

+65
-16
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Change Log
22

3+
## 2024-11-05
4+
### Added
5+
- Support of extraEnv for Management Agent
6+
- Option to override hostPath permission for Management Agent DaemonSet deployment
7+
### Changed
8+
- Management Agent docker image has been updated to version 1.6.0
9+
- Default metrics-server has been updated to version 0.7.2
10+
311
## 2024-09-19
412
### Changed
513
- Fluentd collector container image uptake to 1.5.0 having OS update, Ruby 3.3.1 upgrade and other dependency gem updates.

charts/mgmt-agent/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type: application
1818
# This is the chart version. This version number should be incremented each time you make changes
1919
# to the chart and its templates, including the app version.
2020
# Versions are expected to follow Semantic Versioning (https://semver.org/)
21-
version: 3.0.3
21+
version: 3.0.4
2222

2323
# This is the version number of the application being deployed. This version number should be
2424
# incremented each time you make changes to the application. Versions are not expected to

charts/mgmt-agent/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ A Helm chart for collecting Kubernetes Metrics using OCI Management Agent into O
2929
| mgmtagent.image.url | string | `nil` | Replace this value with actual docker image URL for Management Agent |
3030
| mgmtagent.installKey | string | `"resources/input.rsp"` | Copy the downloaded Management Agent Install Key file under root helm directory as resources/input.rsp |
3131
| mgmtagent.installKeyFileContent | string | `nil` | Provide the base64 encoded content of the Management Agent Install Key file (e.g. `cat input.rsp \| base64 -w 0`) |
32+
| mgmtagent.extraEnv | string | `nil` | Please specify additional environment variables in name:value pairs |
3233
| namespace | string | `"{{ .Values.global.namespace }}"` | Kubernetes namespace to create and install this helm chart in |
3334
| oci-onm-common.createNamespace | bool | `true` | If createNamespace is set to true, it tries to create the namespace defined in 'namespace' variable. |
3435
| oci-onm-common.createServiceAccount | bool | `true` | By default, a cluster role, cluster role binding and serviceaccount will be created for the monitoring pods to be able to (readonly) access various objects within the cluster, to support collection of various telemetry data. You may set this to false and provide your own serviceaccount (in the parent chart(s)) which has the necessary cluster role(s) binded to it. Refer, README for the cluster role definition and other details. |
@@ -42,6 +43,7 @@ A Helm chart for collecting Kubernetes Metrics using OCI Management Agent into O
4243
| deployment.cleanupEpochTime | integer | `nil` | Please provide the current epoch time in seconds (Eg: Executing the following command in a bash shell will provide the epoch time: "date +%s") to clean up the agent installation directory from previous deployment |
4344
| deployment.daemonSetDeployment | bool | `false` | Setting the daemonset deployment to true, will deploy the Management Agents as a daemonset in addition to deploying the Management Agent as a statefulset. This is done to to distribute the node metrics collection to agents running on the node |
4445
| deployment.daemonSet.hostPath | string | `nil` | The host path to store data, if Agent is deployed as DaemonSet. Management Agent Pod should have read-write access to it |
46+
| deployment.daemonSet.overrideOwnership | bool | `true` | Override the ownership and permissions on the hostPath. The hostPath will be owned by the runAsUser and runAsGroup provided under security context and the permission as 750. </br>Note: This requires oraclelinux:8-slim image </br></br>Setting overrideOwnership to false will disable the ownership change. |
4547
| deployment.resource.request.cpuCore | string | `200m` | Minimum CPU cores(millicore) for each agent instance |
4648
| deployment.resource.request.memory | string | `500Mi` | Minimum memory(mebibytes) for each agent instance |
4749
| deployment.resource.request.storage | string | `2Gi` | Minimum storage(gibibyte) for StatefulSet's PVC |

charts/mgmt-agent/templates/env-configmap.yaml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,3 @@ data:
1515
{{- if .Values.deployment.cleanupEpochTime }}
1616
POD_CLEANUP_ID: "{{ .Values.deployment.cleanupEpochTime }}"
1717
{{- end }}
18-
19-
# Modifiable properties
20-
# Add new or change the below existing properties as required
21-
22-
# Openjdk on RHEL with FIPS requires the default security property to be disabled,
23-
# so that Management Agent can use its own bcfips security provider.
24-
# Set this to true to disable, and pass disableJREDefaultSecurityPropertiesFile=true via the rsp file.
25-
DISABLE_JRE_DEFAULT_SECURITY_PROPERTIES_FILE: "false"

charts/mgmt-agent/templates/metric_server.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,15 +138,15 @@ spec:
138138
containers:
139139
- args:
140140
- --cert-dir=/tmp
141-
- --secure-port=4443
141+
- --secure-port=10250
142142
- --kubelet-preferred-address-types=InternalIP,ExternalIP,Hostname
143143
- --kubelet-use-node-status-port
144144
- --metric-resolution=15s
145-
image: registry.k8s.io/metrics-server/metrics-server:v0.6.3
145+
image: registry.k8s.io/metrics-server/metrics-server:v0.7.2
146146
imagePullPolicy: IfNotPresent
147147
name: metrics-server
148148
ports:
149-
- containerPort: 4443
149+
- containerPort: 10250
150150
name: https
151151
protocol: TCP
152152
resources:
@@ -155,9 +155,14 @@ spec:
155155
memory: 200Mi
156156
securityContext:
157157
allowPrivilegeEscalation: false
158+
capabilities:
159+
drop:
160+
- ALL
158161
readOnlyRootFilesystem: true
159162
runAsNonRoot: true
160163
runAsUser: 1000
164+
seccompProfile:
165+
type: RuntimeDefault
161166
volumeMounts:
162167
- mountPath: /tmp
163168
name: tmp-dir

charts/mgmt-agent/templates/mgmt-agent-daemonset.yaml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ spec:
3838
envFrom:
3939
- configMapRef:
4040
name: {{ include "mgmt-agent.resourceNamePrefix" . }}-env
41+
env:
42+
{{- if .Values.mgmtagent.extraEnv }}
43+
{{- range .Values.mgmtagent.extraEnv }}
44+
- name: {{ .name }}
45+
value: {{ .value | quote }}
46+
{{- end }}
47+
{{- end }}
4148
resources:
4249
requests:
4350
cpu: {{ .Values.deployment.resource.request.cpuCore }}
@@ -62,6 +69,18 @@ spec:
6269
securityContext:
6370
allowPrivilegeEscalation: false
6471
readOnlyRootFilesystem: true
72+
{{- if .Values.deployment.daemonSet.overrideOwnership }}
73+
initContainers:
74+
- name: change-ownership-container
75+
image: container-registry.oracle.com/os/oraclelinux:8-slim
76+
command: ["/bin/sh", "-c", "chmod 750 /opt/oracle && chown -R {{ .Values.deployment.security.runAsUser }}:{{ .Values.deployment.security.runAsGroup }} /opt/oracle"]
77+
securityContext:
78+
runAsUser: 0
79+
privileged: true
80+
volumeMounts:
81+
- name: mgmtagent-hostpath
82+
mountPath: /opt/oracle
83+
{{- end }}
6584
volumes:
6685
- name: mgmtagent-secret
6786
secret:
@@ -77,7 +96,10 @@ spec:
7796
name: {{ include "mgmt-agent.resourceNamePrefix" . }}-agent
7897
- name: mgmtagent-hostpath
7998
hostPath:
80-
path: {{ required "deployment.daemonSet.hostPath is required" .Values.deployment.daemonSet.hostPath }}
99+
path: "{{ required "deployment.daemonSet.hostPath is required" .Values.deployment.daemonSet.hostPath }}"
100+
{{- if regexMatch "^/opt/oracle/*$" .Values.deployment.daemonSet.hostPath }}
101+
{{- fail "Error: deployment.daemonSet.hostPath cannot be /opt/oracle. Please provide another location or create a sub-directory under /opt/oracle and use that as hostPath" }}
102+
{{- end }}
81103
- emptyDir: {}
82104
name: tmp
83105
{{- end }}

charts/mgmt-agent/templates/mgmt-agent-statefulset.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ spec:
3939
envFrom:
4040
- configMapRef:
4141
name: {{ include "mgmt-agent.resourceNamePrefix" . }}-env
42+
env:
43+
{{- if .Values.mgmtagent.extraEnv }}
44+
{{- range .Values.mgmtagent.extraEnv }}
45+
- name: {{ .name }}
46+
value: {{ .value | quote }}
47+
{{- end }}
48+
{{- end }}
4249
resources:
4350
requests:
4451
cpu: {{ .Values.deployment.resource.request.cpuCore }}

charts/mgmt-agent/values.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,13 @@ mgmtagent:
3232
url:
3333
# -- Image secrets to use for pulling container image (base64 encoded content of ~/.docker/config.json file)
3434
secret:
35+
# Please specify additional environment variables in name:value pairs
36+
extraEnv:
37+
# Openjdk on RHEL with FIPS requires the default security property to be disabled,
38+
# so that Management Agent can use its own bcfips security provider.
39+
# Set this to true to disable, and pass disableJREDefaultSecurityPropertiesFile=true via the rsp file.
40+
- name: DISABLE_JRE_DEFAULT_SECURITY_PROPERTIES_FILE
41+
value: "false"
3542

3643
# -- Kubernetes namespace to create and install this helm chart in
3744
namespace: "{{ .Values.global.namespace }}"
@@ -78,7 +85,13 @@ deployment:
7885

7986
daemonSet:
8087
# Provide the host path if Agent is deployed as DaemonSet. Management Agent Pod should have read-write access to it.
88+
# Note: The hostPath cannot point to /opt/oracle, please provide another location or create a sub-directory under /opt/oracle and use that as hostPath.
89+
# The Management Agent helm chart will attempt to change ownership and permissions on the host path provided here.
8190
hostPath:
91+
# Override the ownership and permissions on the hostPath. The hostPath will be owned by the runAsUser and runAsGroup provided under security context above and the permission as 750.
92+
# Note: This requires oraclelinux:8-slim image
93+
# Setting overrideOwnership to false will disable the ownership change.
94+
overrideOwnership: true
8295

8396
# Provide the agent resources as per Kubernetes resource quantity
8497
resource:

charts/oci-onm/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type: application
1818
# This is the chart version. This version number should be incremented each time you make changes
1919
# to the chart and its templates, including the app version.
2020
# Versions are expected to follow Semantic Versioning (https://semver.org/)
21-
version: 3.5.1
21+
version: 3.5.2
2222

2323
# This is the version number of the application being deployed. This version number should be
2424
# incremented each time you make changes to the application. Versions are not expected to
@@ -36,6 +36,6 @@ dependencies:
3636
repository: "file://../logan"
3737
condition: oci-onm-logan.enabled
3838
- name: oci-onm-mgmt-agent
39-
version: "3.0.3"
39+
version: "3.0.4"
4040
repository: "file://../mgmt-agent"
4141
condition: oci-onm-mgmt-agent.enabled

charts/oci-onm/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,6 @@ oci-onm-mgmt-agent:
5252
# Follow steps documented at https://github.com/oracle/docker-images/tree/main/OracleManagementAgent to build docker image.
5353
image:
5454
# Replace this value with actual docker image URL for Management Agent
55-
url: container-registry.oracle.com/oci_observability_management/oci-management-agent:1.4.0
55+
url: container-registry.oracle.com/oci_observability_management/oci-management-agent:1.6.0
5656
# Image secrets to use for pulling container image (base64 encoded content of ~/.docker/config.json file)
5757
secret:

0 commit comments

Comments
 (0)