Skip to content

Commit

Permalink
Fix DISABLE_MODULES_MANAGEMENT
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei Kvapil <[email protected]>
  • Loading branch information
kvaps committed Aug 5, 2024
1 parent ed16ce5 commit c418b3d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
4 changes: 4 additions & 0 deletions charts/kube-ovn/templates/ovncni-ds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ spec:
chown -R nobody: /var/log/kube-ovn
chmod g+r /run/xtables.lock
chmod g+w /var/run/netns
{{- if not .Values.DISABLE_MODULES_MANAGEMENT }}
iptables -V
{{- end }}
securityContext:
allowPrivilegeEscalation: true
capabilities:
Expand Down Expand Up @@ -126,7 +128,9 @@ spec:
- NET_BIND_SERVICE
- NET_RAW
- SYS_ADMIN
{{- if not .Values.DISABLE_MODULES_MANAGEMENT }}
- SYS_MODULE
{{- end }}
- SYS_NICE
env:
- name: ENABLE_SSL
Expand Down
22 changes: 10 additions & 12 deletions charts/kube-ovn/templates/ovsovn-ds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,14 @@ spec:
- -xec
- |
chown -R nobody: /var/run/ovn /var/log/ovn /etc/openvswitch /var/run/openvswitch /var/log/openvswitch
{{- if not .Values.DISABLE_MODULES_MANAGEMENT }}
iptables -V
{{- else }}
ln -s /bin/true /usr/local/sbin/iptables
ln -s /bin/true /usr/local/sbin/modprobe
ln -s /bin/true /usr/local/sbin/modinfo
ln -s /bin/true /usr/local/sbin/rmmod
{{- end }}
securityContext:
allowPrivilegeEscalation: true
capabilities:
Expand Down Expand Up @@ -81,18 +88,7 @@ spec:
{{- if .Values.DPDK }}
command: ["/kube-ovn/start-ovs-dpdk.sh"]
{{- else }}
command:
{{- if .Values.DISABLE_MODULES_MANAGEMENT }}
- /bin/sh
- -ec
- |
ln -sf /bin/true /usr/sbin/modprobe
ln -sf /bin/true /usr/sbin/modinfo
ln -sf /bin/true /usr/sbin/rmmod
exec /kube-ovn/start-ovs.sh
{{- else }}
- /kube-ovn/start-ovs.sh
{{- end }}
command: ["/kube-ovn/start-ovs.sh"]
{{- end }}
securityContext:
runAsUser: 65534
Expand All @@ -101,7 +97,9 @@ spec:
add:
- NET_ADMIN
- NET_BIND_SERVICE
{{- if not .Values.DISABLE_MODULES_MANAGEMENT }}
- SYS_MODULE
{{- end }}
- SYS_NICE
- SYS_ADMIN
env:
Expand Down

0 comments on commit c418b3d

Please sign in to comment.