Files
openstack-operator/openstack_operator/templates/neutron/daemonset.yml.j2
Mohammed Naser f2f13f9098 Migrate neutron-server to Kubernetes
Depends-On: https://review.opendev.org/746820
Change-Id: Ifcacea22a259134ffde03d2d8ca510f57dbe626d
2020-08-18 20:45:39 -04:00

114 lines
3.0 KiB
Django/Jinja

---
# Copyright 2020 VEXXHOST, Inc.
#
# 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.
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: neutron
namespace: openstack
labels:
{{ labels("neutron") | indent(4) }}
spec:
updateStrategy:
rollingUpdate:
maxUnavailable: 1
type: RollingUpdate
selector:
matchLabels:
{{ labels("neutron") | indent(6) }}
template:
metadata:
labels:
{{ labels("neutron") | indent(8) }}
spec:
automountServiceAccountToken: false
initContainers:
- name: db-sync
image: vexxhost/neutron-rpc-server:latest
imagePullPolicy: Always
command:
- neutron-db-manage
- upgrade
- heads
volumeMounts:
- name: config
mountPath: /etc/neutron
- name: ml2-config
mountPath: /etc/neutron/plugins/ml2
containers:
- name: rpc-server
image: vexxhost/neutron-rpc-server:latest
imagePullPolicy: Always
env:
{% if 'sentryDSN' in spec %}
- name: SENTRY_DSN
value: {{ spec.sentryDSN }}
{% endif %}
securityContext:
runAsUser: 1001
volumeMounts:
- name: config
mountPath: /etc/neutron
- name: ml2-config
mountPath: /etc/neutron/plugins/ml2
- name: api
image: vexxhost/neutron-api:latest
imagePullPolicy: Always
env:
{% if 'sentryDSN' in spec %}
- name: SENTRY_DSN
value: {{ spec.sentryDSN }}
{% endif %}
ports:
- name: neutron
protocol: TCP
containerPort: 9696
livenessProbe:
tcpSocket:
port: neutron
readinessProbe:
tcpSocket:
port: neutron
securityContext:
runAsUser: 1001
volumeMounts:
- name: config
mountPath: /etc/neutron
- name: ml2-config
mountPath: /etc/neutron/plugins/ml2
- name: uwsgi-config
mountPath: /etc/uwsgi
volumes:
- name: config
secret:
secretName: neutron-config
- name: ml2-config
secret:
secretName: neutron-ml2-config
- name: uwsgi-config
configMap:
defaultMode: 420
name: uwsgi-default
nodeSelector:
node-role.kubernetes.io/master: ""
tolerations:
- key: node-role.kubernetes.io/master
effect: NoSchedule
{% if 'hostAliases' in spec %}
hostAliases:
{{ spec.hostAliases | to_yaml | indent(8) }}
{% endif %}