Skip to content

Commit b4fe562

Browse files
authored
Merge pull request #22 from prasebha/feature/prasebha/v2.0.1
Resource limit
2 parents 9b9b109 + cc39ddd commit b4fe562

File tree

4 files changed

+128
-17
lines changed

4 files changed

+128
-17
lines changed

kubernetes-monitoring/mgmtagent_helm/Chart.yaml

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

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

kubernetes-monitoring/mgmtagent_helm/templates/mgmtagent_statefulset.yaml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,23 @@ spec:
1717
app: mgmtagent
1818
spec:
1919
securityContext:
20-
runAsUser: {{ default 0 .Values.mgmtagent.runAsUser }}
21-
runAsGroup: {{ default 0 .Values.mgmtagent.runAsGroup }}
22-
fsGroup: {{ default 0 .Values.mgmtagent.fsGroup }}
20+
runAsUser: {{ default 0 .Values.deployment.security.runAsUser }}
21+
runAsGroup: {{ default 0 .Values.deployment.security.runAsGroup }}
22+
fsGroup: {{ default 0 .Values.deployment.security.fsGroup }}
2323
serviceAccountName: mgmtagent-serviceaccount
2424
imagePullSecrets:
2525
- name: mgmtagent-container-registry-key
2626
restartPolicy: Always
2727
containers:
2828
- name: mgmtagent
2929
image: {{ .Values.mgmtagent.image.url }}
30+
resources:
31+
requests:
32+
cpu: {{ .Values.deployment.resource.request.cpuCore }}
33+
memory: {{ .Values.deployment.resource.request.memory }}
34+
limits:
35+
cpu: {{ .Values.deployment.resource.limit.cpuCore }}
36+
memory: {{ .Values.deployment.resource.limit.memory }}
3037
volumeMounts:
3138
- name: mgmtagent-secret
3239
mountPath: /opt/oracle/mgmtagent_secret
@@ -54,9 +61,9 @@ spec:
5461
name: mgmtagent-pvc
5562
spec:
5663
accessModes: [ "ReadWriteOnce" ]
57-
{{- if .Values.kubernetesCluster.storageClass }}
58-
storageClassName: {{ .Values.kubernetesCluster.storageClass }}
64+
{{- if .Values.deployment.storageClass }}
65+
storageClassName: {{ .Values.deployment.storageClass }}
5966
{{- end }}
6067
resources:
6168
requests:
62-
storage: 2Gi
69+
storage: {{ .Values.deployment.resource.request.storage }}

kubernetes-monitoring/mgmtagent_helm/values.schema.json

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,91 @@
106106
"name",
107107
"namespace"
108108
]
109+
},
110+
"deployment":
111+
{
112+
"properties":
113+
{
114+
"security":
115+
{
116+
"properties":
117+
{
118+
"runAsUser":
119+
{
120+
"type":
121+
[
122+
"integer",
123+
"null"
124+
]
125+
},
126+
"runAsGroup":
127+
{
128+
"type":
129+
[
130+
"integer",
131+
"null"
132+
]
133+
},
134+
"fsGroup":
135+
{
136+
"type":
137+
[
138+
"integer",
139+
"null"
140+
]
141+
}
142+
}
143+
},
144+
"resource":
145+
{
146+
"properties":
147+
{
148+
"request":
149+
{
150+
"properties":
151+
{
152+
"cpuCore":
153+
{
154+
"type": "string"
155+
},
156+
"memory":
157+
{
158+
"type": "string"
159+
},
160+
"storage":
161+
{
162+
"type": "string"
163+
}
164+
},
165+
"required":
166+
[
167+
"cpuCore",
168+
"memory",
169+
"storage"
170+
]
171+
},
172+
"limit":
173+
{
174+
"properties":
175+
{
176+
"cpuCore":
177+
{
178+
"type": "string"
179+
},
180+
"memory":
181+
{
182+
"type": "string"
183+
}
184+
},
185+
"required":
186+
[
187+
"cpuCore",
188+
"memory"
189+
]
190+
}
191+
}
192+
}
193+
}
109194
}
110195
},
111196
"required":

kubernetes-monitoring/mgmtagent_helm/values.yaml

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
11
mgmtagent:
2-
# Processes in the Container will run as user ID 1000, replace it with a different value if desired
3-
runAsUser: 1000
4-
# Processes in the Container will use group ID 2000, replace it with a different value if desired
5-
runAsGroup: 2000
6-
# Files created in the Container will use group ID 2000, replace it with a different value if desired
7-
fsGroup: 2000
8-
92
# Provide either installKeyFileContent or installKey as an install key. If both provided then installKeyFileContent will take higher precedence.
103
# Provide the base64 encoded content of the Management Agent Install Key file
114
installKeyFileContent:
@@ -29,9 +22,6 @@ namespace: mgmtagent
2922
# By default, metric server will be deployed and used by Management Agent to collect metrics. You can set this to false if you already have metric server installed on your cluster
3023
deployMetricServer: true
3124

32-
# Provide the storage class for StatefulSet's PVC. If not provided then the Cluster's default storage class will be used.
33-
storageClass:
34-
3525
# Kubernetes Cluster details to monitor
3626
kubernetesCluster:
3727
# OCI Compartment Id to push Kubernetes Monitoring metrics. If not specified default is same as Agent compartment
@@ -40,3 +30,32 @@ kubernetesCluster:
4030
name:
4131
# Kubernetes cluster namespace(s) to monitor. This can be a comma-separated list of namespaces or '*' to monitor all the namespaces
4232
namespace: '*'
33+
34+
deployment:
35+
security:
36+
# Processes in the Container will run as user ID 1000, replace it with a different value if desired
37+
runAsUser: 1000
38+
# Processes in the Container will use group ID 2000, replace it with a different value if desired
39+
runAsGroup: 2000
40+
# Files created in the Container will use group ID 2000, replace it with a different value if desired
41+
fsGroup: 2000
42+
43+
# Provide the agent resources as per Kubernetes resource quantity
44+
resource:
45+
# Provide the minimum required resources
46+
request:
47+
# specify the cpu cores
48+
cpuCore: 100m
49+
# specify the memory
50+
memory: 500Mi
51+
# specify the storage capacity for StatefulSet's PVC
52+
storage: 2Gi
53+
# Provide the maximum limit for resources
54+
limit:
55+
# specify the cpu cores
56+
cpuCore: 500m
57+
# specify the memory
58+
memory: 1Gi
59+
60+
# Provide the storage class for StatefulSet's PVC. If not provided then the Cluster's default storage class will be used.
61+
storageClass:

0 commit comments

Comments
 (0)