2017-08-07 17:07:38 -05:00
|
|
|
{{/*
|
2018-08-28 17:25:13 +00:00
|
|
|
Copyright 2017 The Openstack-Helm Authors.
|
2017-08-07 17:07:38 -05:00
|
|
|
|
|
|
|
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.
|
|
|
|
*/}}
|
2017-02-17 13:05:32 -05:00
|
|
|
|
2018-03-21 13:27:40 -05:00
|
|
|
{{- define "neutron.ovs_agent.daemonset" }}
|
|
|
|
{{- $daemonset := index . 0 }}
|
|
|
|
{{- $configMapName := index . 1 }}
|
|
|
|
{{- $serviceAccountName := index . 2 }}
|
2018-05-10 17:09:18 -05:00
|
|
|
{{- $envAll := index . 3 }}
|
2018-03-21 13:27:40 -05:00
|
|
|
{{- with $envAll }}
|
2017-12-20 12:21:42 -05:00
|
|
|
|
2017-07-14 10:44:35 -05:00
|
|
|
{{- $mounts_neutron_ovs_agent := .Values.pod.mounts.neutron_ovs_agent.neutron_ovs_agent }}
|
|
|
|
{{- $mounts_neutron_ovs_agent_init := .Values.pod.mounts.neutron_ovs_agent.init_container }}
|
2017-12-20 12:21:42 -05:00
|
|
|
|
2017-07-01 12:00:56 -05:00
|
|
|
---
|
2018-06-11 22:03:32 -05:00
|
|
|
apiVersion: apps/v1
|
2017-01-05 13:27:39 -08:00
|
|
|
kind: DaemonSet
|
|
|
|
metadata:
|
2017-09-04 13:58:59 +02:00
|
|
|
name: neutron-ovs-agent
|
2018-09-13 06:29:14 -05:00
|
|
|
annotations:
|
|
|
|
{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }}
|
2018-06-11 22:03:32 -05:00
|
|
|
labels:
|
|
|
|
{{ tuple $envAll "neutron" "neutron-ovs-agent" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
|
2017-01-05 13:27:39 -08:00
|
|
|
spec:
|
2018-06-11 22:03:32 -05:00
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
{{ tuple $envAll "neutron" "neutron-ovs-agent" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 6 }}
|
2017-07-05 02:34:12 -05:00
|
|
|
{{ tuple $envAll "ovs_agent" | include "helm-toolkit.snippets.kubernetes_upgrades_daemonset" | indent 2 }}
|
2017-01-05 13:27:39 -08:00
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
2017-09-04 13:58:59 +02:00
|
|
|
{{ tuple $envAll "neutron" "neutron-ovs-agent" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
|
2017-01-09 15:18:58 -08:00
|
|
|
annotations:
|
2019-02-12 12:31:27 -06:00
|
|
|
{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }}
|
2017-05-30 18:16:25 -05:00
|
|
|
configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }}
|
|
|
|
configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }}
|
2017-01-05 13:27:39 -08:00
|
|
|
spec:
|
2018-08-27 12:23:08 -05:00
|
|
|
{{ dict "envAll" $envAll "application" "neutron" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
|
2017-12-20 12:21:42 -05:00
|
|
|
serviceAccountName: {{ $serviceAccountName }}
|
2017-01-05 13:27:39 -08:00
|
|
|
nodeSelector:
|
2017-01-22 05:39:25 +00:00
|
|
|
{{ .Values.labels.ovs.node_selector_key }}: {{ .Values.labels.ovs.node_selector_value }}
|
2017-08-10 12:29:23 -05:00
|
|
|
dnsPolicy: ClusterFirstWithHostNet
|
2017-01-05 13:27:39 -08:00
|
|
|
hostNetwork: true
|
2018-06-16 14:09:32 -05:00
|
|
|
{{- if or ( gt .Capabilities.KubeVersion.Major "1" ) ( ge .Capabilities.KubeVersion.Minor "10" ) }}
|
|
|
|
shareProcessNamespace: true
|
|
|
|
{{- else }}
|
|
|
|
hostPID: true
|
|
|
|
{{- end }}
|
2017-05-15 19:18:01 +00:00
|
|
|
initContainers:
|
2018-05-10 17:09:18 -05:00
|
|
|
{{ tuple $envAll "pod_dependency" $mounts_neutron_ovs_agent_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
|
2017-10-09 19:03:05 -05:00
|
|
|
- name: neutron-openvswitch-agent-kernel-modules
|
2018-05-18 10:41:48 -05:00
|
|
|
{{ tuple $envAll "neutron_openvswitch_agent" | include "helm-toolkit.snippets.image" | indent 10 }}
|
2017-10-09 19:03:05 -05:00
|
|
|
securityContext:
|
|
|
|
capabilities:
|
|
|
|
add:
|
|
|
|
- SYS_MODULE
|
|
|
|
runAsUser: 0
|
|
|
|
command:
|
|
|
|
- /tmp/neutron-openvswitch-agent-init-modules.sh
|
|
|
|
volumeMounts:
|
|
|
|
- name: neutron-bin
|
|
|
|
mountPath: /tmp/neutron-openvswitch-agent-init-modules.sh
|
|
|
|
subPath: neutron-openvswitch-agent-init-modules.sh
|
|
|
|
readOnly: true
|
|
|
|
- name: host-rootfs
|
|
|
|
mountPath: /mnt/host-rootfs
|
|
|
|
readOnly: true
|
2017-09-04 13:58:59 +02:00
|
|
|
- name: neutron-ovs-agent-init
|
2018-05-18 10:41:48 -05:00
|
|
|
{{ tuple $envAll "neutron_openvswitch_agent" | include "helm-toolkit.snippets.image" | indent 10 }}
|
2017-07-11 13:02:23 -05:00
|
|
|
{{ tuple $envAll $envAll.Values.pod.resources.agent.ovs | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
|
2017-06-12 07:24:31 -05:00
|
|
|
securityContext:
|
|
|
|
privileged: true
|
|
|
|
runAsUser: 0
|
|
|
|
command:
|
|
|
|
- /tmp/neutron-openvswitch-agent-init.sh
|
|
|
|
volumeMounts:
|
|
|
|
- name: neutron-bin
|
|
|
|
mountPath: /tmp/neutron-openvswitch-agent-init.sh
|
|
|
|
subPath: neutron-openvswitch-agent-init.sh
|
|
|
|
readOnly: true
|
|
|
|
- name: pod-shared
|
|
|
|
mountPath: /tmp/pod-shared
|
|
|
|
- name: neutron-etc
|
|
|
|
mountPath: /etc/neutron/neutron.conf
|
|
|
|
subPath: neutron.conf
|
|
|
|
readOnly: true
|
|
|
|
- name: neutron-etc
|
|
|
|
mountPath: /etc/neutron/plugins/ml2/ml2_conf.ini
|
|
|
|
subPath: ml2_conf.ini
|
|
|
|
readOnly: true
|
|
|
|
- name: neutron-etc
|
|
|
|
mountPath: /etc/neutron/plugins/ml2/openvswitch_agent.ini
|
|
|
|
subPath: openvswitch_agent.ini
|
|
|
|
readOnly: true
|
2018-12-21 10:03:36 +09:00
|
|
|
- name: neutron-etc
|
|
|
|
mountPath: {{ .Values.conf.neutron.DEFAULT.log_config_append }}
|
|
|
|
subPath: {{ base .Values.conf.neutron.DEFAULT.log_config_append }}
|
|
|
|
readOnly: true
|
2018-08-28 14:21:29 -04:00
|
|
|
{{- if .Values.conf.plugins.taas.taas.enabled }}
|
|
|
|
- name: neutron-etc
|
|
|
|
mountPath: /etc/neutron/plugins/ml2/taas.ini
|
|
|
|
subPath: taas.ini
|
|
|
|
readOnly: true
|
|
|
|
{{- end }}
|
2017-08-22 19:57:57 -05:00
|
|
|
- name: neutron-etc
|
2017-09-06 19:19:54 +00:00
|
|
|
# NOTE (Portdirect): We mount here to override Kollas
|
|
|
|
# custom sudoers file when using Kolla images, this
|
|
|
|
# location will also work fine for other images.
|
2017-08-22 19:57:57 -05:00
|
|
|
mountPath: /etc/sudoers.d/kolla_neutron_sudoers
|
|
|
|
subPath: neutron_sudoers
|
|
|
|
readOnly: true
|
|
|
|
- name: neutron-etc
|
|
|
|
mountPath: /etc/neutron/rootwrap.conf
|
|
|
|
subPath: rootwrap.conf
|
|
|
|
readOnly: true
|
2018-03-27 11:10:50 -04:00
|
|
|
{{- range $key, $value := $envAll.Values.conf.rootwrap_filters }}
|
|
|
|
{{- if ( has "ovs_agent" $value.pods ) }}
|
2018-08-28 14:21:29 -04:00
|
|
|
{{- if and ( eq "taas" $key ) (not $envAll.Values.conf.plugins.taas.taas.enabled) }}
|
|
|
|
## if taas is not enabled, do not include taas.filters
|
|
|
|
{{- else }}
|
2018-03-27 11:10:50 -04:00
|
|
|
{{- $filePrefix := replace "_" "-" $key }}
|
|
|
|
{{- $rootwrapFile := printf "/etc/neutron/rootwrap.d/%s.filters" $filePrefix }}
|
2017-08-22 19:57:57 -05:00
|
|
|
- name: neutron-etc
|
2018-03-27 11:10:50 -04:00
|
|
|
mountPath: {{ $rootwrapFile }}
|
|
|
|
subPath: {{ base $rootwrapFile }}
|
2017-08-22 19:57:57 -05:00
|
|
|
readOnly: true
|
2018-03-27 11:10:50 -04:00
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
2018-08-28 14:21:29 -04:00
|
|
|
{{- end }}
|
2017-06-12 07:24:31 -05:00
|
|
|
- name: run
|
|
|
|
mountPath: /run
|
2017-08-24 02:54:28 -04:00
|
|
|
{{ if $mounts_neutron_ovs_agent.volumeMounts }}{{ toYaml $mounts_neutron_ovs_agent.volumeMounts | indent 12 }}{{ end }}
|
2017-01-05 13:27:39 -08:00
|
|
|
containers:
|
2017-09-04 13:58:59 +02:00
|
|
|
- name: neutron-ovs-agent
|
2018-05-18 10:41:48 -05:00
|
|
|
{{ tuple $envAll "neutron_openvswitch_agent" | include "helm-toolkit.snippets.image" | indent 10 }}
|
2017-07-11 13:02:23 -05:00
|
|
|
{{ tuple $envAll $envAll.Values.pod.resources.agent.ovs | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
|
2017-01-05 13:27:39 -08:00
|
|
|
securityContext:
|
|
|
|
privileged: true
|
2017-01-22 05:39:25 +00:00
|
|
|
command:
|
|
|
|
- /tmp/neutron-openvswitch-agent.sh
|
2017-01-05 13:27:39 -08:00
|
|
|
# ensures this container can can see a br-int
|
|
|
|
# bridge before its marked as ready
|
|
|
|
readinessProbe:
|
|
|
|
exec:
|
|
|
|
command:
|
|
|
|
- bash
|
|
|
|
- -c
|
|
|
|
- 'ovs-vsctl list-br | grep -q br-int'
|
|
|
|
volumeMounts:
|
2017-04-27 18:44:02 -05:00
|
|
|
- name: neutron-bin
|
2017-01-05 13:27:39 -08:00
|
|
|
mountPath: /tmp/neutron-openvswitch-agent.sh
|
|
|
|
subPath: neutron-openvswitch-agent.sh
|
2017-04-27 18:44:02 -05:00
|
|
|
readOnly: true
|
2017-06-12 07:24:31 -05:00
|
|
|
- name: pod-shared
|
|
|
|
mountPath: /tmp/pod-shared
|
2017-04-10 13:14:10 -07:00
|
|
|
- name: neutron-etc
|
2017-01-05 13:27:39 -08:00
|
|
|
mountPath: /etc/neutron/neutron.conf
|
|
|
|
subPath: neutron.conf
|
2017-04-27 18:44:02 -05:00
|
|
|
readOnly: true
|
2018-06-17 16:12:25 -05:00
|
|
|
- name: neutron-etc
|
|
|
|
mountPath: {{ .Values.conf.neutron.DEFAULT.log_config_append }}
|
|
|
|
subPath: {{ base .Values.conf.neutron.DEFAULT.log_config_append }}
|
|
|
|
readOnly: true
|
2017-04-10 13:14:10 -07:00
|
|
|
- name: neutron-etc
|
|
|
|
mountPath: /etc/neutron/plugins/ml2/ml2_conf.ini
|
|
|
|
subPath: ml2_conf.ini
|
2017-04-27 18:44:02 -05:00
|
|
|
readOnly: true
|
2017-04-10 13:14:10 -07:00
|
|
|
- name: neutron-etc
|
|
|
|
mountPath: /etc/neutron/plugins/ml2/openvswitch_agent.ini
|
|
|
|
subPath: openvswitch_agent.ini
|
2017-04-27 18:44:02 -05:00
|
|
|
readOnly: true
|
2018-08-28 14:21:29 -04:00
|
|
|
{{- if .Values.conf.plugins.taas.taas.enabled }}
|
|
|
|
- name: neutron-etc
|
|
|
|
mountPath: /etc/neutron/plugins/ml2/taas.ini
|
|
|
|
subPath: taas.ini
|
|
|
|
readOnly: true
|
|
|
|
{{- end }}
|
2017-08-22 19:57:57 -05:00
|
|
|
- name: neutron-etc
|
2017-09-06 19:19:54 +00:00
|
|
|
# NOTE (Portdirect): We mount here to override Kollas
|
|
|
|
# custom sudoers file when using Kolla images, this
|
|
|
|
# location will also work fine for other images.
|
2017-08-22 19:57:57 -05:00
|
|
|
mountPath: /etc/sudoers.d/kolla_neutron_sudoers
|
|
|
|
subPath: neutron_sudoers
|
|
|
|
readOnly: true
|
|
|
|
- name: neutron-etc
|
|
|
|
mountPath: /etc/neutron/rootwrap.conf
|
|
|
|
subPath: rootwrap.conf
|
|
|
|
readOnly: true
|
2018-03-27 11:10:50 -04:00
|
|
|
{{- range $key, $value := $envAll.Values.conf.rootwrap_filters }}
|
|
|
|
{{- if ( has "ovs_agent" $value.pods ) }}
|
2018-08-28 14:21:29 -04:00
|
|
|
{{- if and ( eq "taas" $key ) (not $envAll.Values.conf.plugins.taas.taas.enabled) }}
|
|
|
|
## if taas is not enabled, do not include taas.filters
|
|
|
|
{{- else }}
|
2018-03-27 11:10:50 -04:00
|
|
|
{{- $filePrefix := replace "_" "-" $key }}
|
|
|
|
{{- $rootwrapFile := printf "/etc/neutron/rootwrap.d/%s.filters" $filePrefix }}
|
2017-08-22 19:57:57 -05:00
|
|
|
- name: neutron-etc
|
2018-03-27 11:10:50 -04:00
|
|
|
mountPath: {{ $rootwrapFile }}
|
|
|
|
subPath: {{ base $rootwrapFile }}
|
2017-08-22 19:57:57 -05:00
|
|
|
readOnly: true
|
2018-03-27 11:10:50 -04:00
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
2018-08-28 14:21:29 -04:00
|
|
|
{{- end }}
|
2017-01-05 13:27:39 -08:00
|
|
|
- name: run
|
|
|
|
mountPath: /run
|
2017-08-24 02:54:28 -04:00
|
|
|
{{ if $mounts_neutron_ovs_agent.volumeMounts }}{{ toYaml $mounts_neutron_ovs_agent.volumeMounts | indent 12 }}{{ end }}
|
2017-01-05 13:27:39 -08:00
|
|
|
volumes:
|
|
|
|
- name: varlibopenvswitch
|
|
|
|
emptyDir: {}
|
2017-06-12 07:24:31 -05:00
|
|
|
- name: pod-shared
|
|
|
|
emptyDir: {}
|
2017-04-27 18:44:02 -05:00
|
|
|
- name: neutron-bin
|
2017-01-05 13:27:39 -08:00
|
|
|
configMap:
|
|
|
|
name: neutron-bin
|
2017-06-12 00:22:30 -05:00
|
|
|
defaultMode: 0555
|
2017-04-10 13:14:10 -07:00
|
|
|
- name: neutron-etc
|
2018-08-08 14:56:30 -05:00
|
|
|
secret:
|
|
|
|
secretName: {{ $configMapName }}
|
2017-06-29 14:36:44 -05:00
|
|
|
defaultMode: 0444
|
2017-01-05 13:27:39 -08:00
|
|
|
- name: run
|
|
|
|
hostPath:
|
2017-01-22 05:39:25 +00:00
|
|
|
path: /run
|
2017-10-09 19:03:05 -05:00
|
|
|
- name: host-rootfs
|
|
|
|
hostPath:
|
|
|
|
path: /
|
2017-08-24 02:54:28 -04:00
|
|
|
{{ if $mounts_neutron_ovs_agent.volumes }}{{ toYaml $mounts_neutron_ovs_agent.volumes | indent 8 }}{{ end }}
|
2017-08-07 11:37:42 -05:00
|
|
|
{{- end }}
|
2018-03-21 13:27:40 -05:00
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{- if and .Values.manifests.daemonset_ovs_agent ( has "openvswitch" .Values.network.backend ) }}
|
|
|
|
{{- $envAll := . }}
|
|
|
|
{{- $daemonset := "ovs-agent" }}
|
|
|
|
{{- $configMapName := "neutron-etc" }}
|
|
|
|
{{- $serviceAccountName := "neutron-ovs-agent" }}
|
|
|
|
{{- $dependencyOpts := dict "envAll" $envAll "dependencyMixinParam" $envAll.Values.network.backend "dependencyKey" "ovs_agent" -}}
|
2018-06-15 19:08:50 -05:00
|
|
|
{{- $_ := include "helm-toolkit.utils.dependency_resolver" $dependencyOpts | toString | fromYaml }}
|
2018-05-10 17:09:18 -05:00
|
|
|
{{ tuple $envAll "pod_dependency" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
|
|
|
|
{{- $daemonset_yaml := list $daemonset $configMapName $serviceAccountName . | include "neutron.ovs_agent.daemonset" | toString | fromYaml }}
|
2018-03-21 13:27:40 -05:00
|
|
|
{{- $configmap_yaml := "neutron.configmap.etc" }}
|
|
|
|
{{- list $daemonset $daemonset_yaml $configmap_yaml $configMapName . | include "helm-toolkit.utils.daemonset_overrides" }}
|
|
|
|
{{- end }}
|