Skip to content

Commit 0bc03aa

Browse files
committed
add chown and chmod to hostPath
1 parent 1776c5b commit 0bc03aa

File tree

5 files changed

+30
-12
lines changed

5 files changed

+30
-12
lines changed

CHANGELOG.md

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

3-
## 2024-08-23
4-
### Changed
5-
- Management Agent docker image has been updated to version 1.5.0
6-
- Extra environment (extraEnv) added to Management Agent.
7-
83
## 2024-07-08
94
### Added
105
- Option to disable JRE default security property for Agent.

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: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,18 @@ spec:
6969
securityContext:
7070
allowPrivilegeEscalation: false
7171
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 }}
7284
volumes:
7385
- name: mgmtagent-secret
7486
secret:
@@ -84,7 +96,7 @@ spec:
8496
name: {{ include "mgmt-agent.resourceNamePrefix" . }}-agent
8597
- name: mgmtagent-hostpath
8698
hostPath:
87-
path: {{ required "deployment.daemonSet.hostPath is required" .Values.deployment.daemonSet.hostPath }}
99+
path: "{{ required "deployment.daemonSet.hostPath is required" .Values.deployment.daemonSet.hostPath }}/daemonset-mgmtagent-container"
88100
- emptyDir: {}
89101
name: tmp
90102
{{- end }}

charts/mgmt-agent/values.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,14 @@ deployment:
8484
daemonSetDeployment: false
8585

8686
daemonSet:
87-
# Provide the host path if Agent is deployed as DaemonSet. Management Agent Pod should have read-write access to it.
88-
hostPath:
87+
# Provide the host path (defaults to /opt/oracle, please change if required) if Agent is deployed as DaemonSet. Management Agent Pod should have read-write access to it.
88+
# The host path needs to be owned by runAsUser and runAsGroup, provided under security context above.
89+
# Note: The deployment will create a sub directory i.e. daemonset-mgmtagent-container under the the provided hostPath.
90+
hostPath: /opt/oracle
91+
# Override the ownership and permissions on the hostPath, to 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
8995

9096
# Provide the agent resources as per Kubernetes resource quantity
9197
resource:

charts/oci-onm/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.4.5
21+
version: 3.4.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

0 commit comments

Comments
 (0)