Nova: remove requirement for NET_ADMIN capability for Nova Metadata
This PS removes the requirement for the Nova Metadata API to run with NET_ADMIN capabilities, and also enables lightwight images without iptables present to be used. This has no effect on operation if Neutron is used for networking. Change-Id: Ie69c74240ca7fd054e3c897c2bf8ebc8ec5c1377
This commit is contained in:
parent
9b8f6aef88
commit
d8e4890772
17
nova/templates/bin/_fake-iptables.sh.tpl
Normal file
17
nova/templates/bin/_fake-iptables.sh.tpl
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Copyright 2017 The Openstack-Helm Authors.
|
||||||
|
#
|
||||||
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
# you may not use this file except in compliance with the License.
|
||||||
|
# You may obtain a copy of the License at
|
||||||
|
#
|
||||||
|
# http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
#
|
||||||
|
# Unless required by applicable law or agreed to in writing, software
|
||||||
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
# See the License for the specific language governing permissions and
|
||||||
|
# limitations under the License.
|
||||||
|
|
||||||
|
exit 0
|
@ -47,3 +47,5 @@ data:
|
|||||||
{{ tuple "bin/_nova-consoleauth.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
|
{{ tuple "bin/_nova-consoleauth.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
|
||||||
nova-scheduler.sh: |
|
nova-scheduler.sh: |
|
||||||
{{ tuple "bin/_nova-scheduler.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
|
{{ tuple "bin/_nova-scheduler.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
|
||||||
|
fake-iptables.sh: |
|
||||||
|
{{ tuple "bin/_fake-iptables.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
|
||||||
|
@ -56,12 +56,6 @@ spec:
|
|||||||
memory: {{ .Values.resources.nova_api_metadata.limits.memory | quote }}
|
memory: {{ .Values.resources.nova_api_metadata.limits.memory | quote }}
|
||||||
cpu: {{ .Values.resources.nova_api_metadata.limits.cpu | quote }}
|
cpu: {{ .Values.resources.nova_api_metadata.limits.cpu | quote }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
# NOTE(portdirect): NET_ADMIN is needed as the api-metadata service
|
|
||||||
# expects to run some iptables commands, even when neutron is used.
|
|
||||||
securityContext:
|
|
||||||
capabilities:
|
|
||||||
add:
|
|
||||||
- NET_ADMIN
|
|
||||||
command:
|
command:
|
||||||
- bash
|
- bash
|
||||||
- /tmp/nova-api-metadata.sh
|
- /tmp/nova-api-metadata.sh
|
||||||
@ -83,6 +77,18 @@ spec:
|
|||||||
mountPath: /tmp/nova-api-metadata.sh
|
mountPath: /tmp/nova-api-metadata.sh
|
||||||
subPath: nova-api-metadata.sh
|
subPath: nova-api-metadata.sh
|
||||||
readOnly: true
|
readOnly: true
|
||||||
|
- name: nova-bin
|
||||||
|
mountPath: /sbin/iptables
|
||||||
|
subPath: fake-iptables.sh
|
||||||
|
readOnly: true
|
||||||
|
- name: nova-bin
|
||||||
|
mountPath: /sbin/iptables-restore
|
||||||
|
subPath: fake-iptables.sh
|
||||||
|
readOnly: true
|
||||||
|
- name: nova-bin
|
||||||
|
mountPath: /sbin/iptables-save
|
||||||
|
subPath: fake-iptables.sh
|
||||||
|
readOnly: true
|
||||||
- name: nova-etc
|
- name: nova-etc
|
||||||
mountPath: /etc/nova/nova.conf
|
mountPath: /etc/nova/nova.conf
|
||||||
subPath: nova.conf
|
subPath: nova.conf
|
||||||
@ -96,6 +102,7 @@ spec:
|
|||||||
- name: nova-bin
|
- name: nova-bin
|
||||||
configMap:
|
configMap:
|
||||||
name: nova-bin
|
name: nova-bin
|
||||||
|
defaultMode: 0555
|
||||||
- name: nova-etc
|
- name: nova-etc
|
||||||
configMap:
|
configMap:
|
||||||
name: nova-etc
|
name: nova-etc
|
||||||
|
Loading…
x
Reference in New Issue
Block a user