Skip to content

Commit ad122cf

Browse files
committed
security: specify a storage limit for containers (#6259)
Signed-off-by: zhangzujian <zhangzujian.7@gmail.com>
1 parent 810fb83 commit ad122cf

File tree

13 files changed

+45
-0
lines changed

13 files changed

+45
-0
lines changed

charts/kube-ovn-v2/templates/hooks/post-delete-hook.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,14 @@ spec:
120120
- sh
121121
- -c
122122
- /kube-ovn/remove-finalizer.sh 2>&1 | tee -a /var/log/kube-ovn/remove-finalizer.log
123+
resources:
124+
requests:
125+
cpu: 100m
126+
memory: 200Mi
127+
limits:
128+
cpu: 1
129+
memory: 500Mi
130+
ephemeral-storage: 1Gi
123131
volumeMounts:
124132
- mountPath: /var/log/kube-ovn
125133
name: kube-ovn-log

charts/kube-ovn-v2/templates/ic/ic-controller-deploy.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ spec:
103103
limits:
104104
cpu: 3
105105
memory: 1Gi
106+
ephemeral-storage: 1Gi
106107
volumeMounts:
107108
- mountPath: /var/run/ovn
108109
name: host-run-ovn

charts/kube-ovn-v2/values.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ ovsOvn:
375375
limits:
376376
cpu: "2"
377377
memory: "1000Mi"
378+
ephemeral-storage: 1Gi
378379

379380
# -- ovs-ovn DaemonSet update strategy.
380381
# ref: https://kubernetes.io/docs/tasks/manage-daemon/update-daemon-set/#daemonset-update-strategy
@@ -427,6 +428,7 @@ ovsOvn:
427428
hugepages-2Mi: 1Gi
428429
cpu: "2"
429430
memory: "1000Mi"
431+
ephemeral-storage: 1Gi
430432

431433
# -- Configuration for kube-ovn-speaker, the BGP speaker announcing routes to the external world.
432434
# @section -- BGP speaker configuration
@@ -509,6 +511,7 @@ pinger:
509511
limits:
510512
cpu: "200m"
511513
memory: "400Mi"
514+
ephemeral-storage: 1Gi
512515

513516
# -- kube-ovn-pinger metrics configuration.
514517
# @section -- Ping daemon configuration
@@ -577,6 +580,7 @@ monitor:
577580
limits:
578581
cpu: "200m"
579582
memory: "200Mi"
583+
ephemeral-storage: 1Gi
580584

581585
# -- kube-ovn-monitor metrics configuration.
582586
# @section -- OVN monitoring daemon configuration
@@ -619,6 +623,7 @@ controller:
619623
limits:
620624
cpu: "1000m"
621625
memory: "1Gi"
626+
ephemeral-storage: 1Gi
622627

623628
# -- Controller metrics configuration.
624629
# @section -- Kube-OVN controller configuration
@@ -661,6 +666,7 @@ central:
661666
limits:
662667
cpu: "3"
663668
memory: "4Gi"
669+
ephemeral-storage: 1Gi
664670

665671
# -- ""
666672
# @section -- OVN-central daemon configuration.
@@ -738,6 +744,7 @@ agent:
738744
limits:
739745
cpu: "1000m"
740746
memory: "1Gi"
747+
ephemeral-storage: 1Gi
741748

742749
# -- Agent metrics configuration.
743750
# @section -- CNI agent configuration

charts/kube-ovn/templates/central-deploy.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ spec:
122122
limits:
123123
cpu: {{ index .Values "ovn-central" "limits" "cpu" }}
124124
memory: {{ index .Values "ovn-central" "limits" "memory" }}
125+
ephemeral-storage: {{ index .Values "ovn-central" "limits" "ephemeral-storage" }}
125126
volumeMounts:
126127
- mountPath: /var/run/ovn
127128
name: host-run-ovn

charts/kube-ovn/templates/controller-deploy.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,7 @@ spec:
218218
limits:
219219
cpu: {{ index .Values "kube-ovn-controller" "limits" "cpu" }}
220220
memory: {{ index .Values "kube-ovn-controller" "limits" "memory" }}
221+
ephemeral-storage: {{ index .Values "kube-ovn-controller" "limits" "ephemeral-storage" }}
221222
nodeSelector:
222223
kubernetes.io/os: "linux"
223224
volumes:

charts/kube-ovn/templates/ic-controller-deploy.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ spec:
100100
limits:
101101
cpu: 3
102102
memory: 1Gi
103+
ephemeral-storage: 1Gi
103104
volumeMounts:
104105
- mountPath: /var/run/ovn
105106
name: host-run-ovn

charts/kube-ovn/templates/monitor-deploy.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ spec:
110110
limits:
111111
cpu: {{ index .Values "kube-ovn-monitor" "limits" "cpu" }}
112112
memory: {{ index .Values "kube-ovn-monitor" "limits" "memory" }}
113+
ephemeral-storage: {{ index .Values "kube-ovn-monitor" "limits" "ephemeral-storage" }}
113114
volumeMounts:
114115
- mountPath: /var/run/ovn
115116
name: host-run-ovn

charts/kube-ovn/templates/ovncni-ds.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ spec:
227227
limits:
228228
cpu: {{ index .Values "kube-ovn-cni" "limits" "cpu" }}
229229
memory: {{ index .Values "kube-ovn-cni" "limits" "memory" }}
230+
ephemeral-storage: {{ index .Values "kube-ovn-cni" "limits" "ephemeral-storage" }}
230231
nodeSelector:
231232
kubernetes.io/os: "linux"
232233
volumes:

charts/kube-ovn/templates/ovsovn-ds.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ spec:
173173
limits:
174174
cpu: {{ index .Values "ovs-ovn" "limits" "cpu" }}
175175
memory: {{ index .Values "ovs-ovn" "limits" "memory" }}
176+
ephemeral-storage: {{ index .Values "ovs-ovn" "limits" "ephemeral-storage" }}
176177
nodeSelector:
177178
kubernetes.io/os: "linux"
178179
volumes:

charts/kube-ovn/templates/pinger-ds.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ spec:
133133
limits:
134134
cpu: {{ index .Values "kube-ovn-pinger" "limits" "cpu" }}
135135
memory: {{ index .Values "kube-ovn-pinger" "limits" "memory" }}
136+
ephemeral-storage: {{ index .Values "kube-ovn-pinger" "limits" "ephemeral-storage" }}
136137
livenessProbe:
137138
httpGet:
138139
path: /metrics

0 commit comments

Comments
 (0)