Introduces new approach in starting OVS in Kube
Due to certain limitations and encountered instabilities while deploying OVS components (ovsdb and vswitchd), this PS introduces a different appraoch of starting these services. TrivialFix Change-Id: Id10f77a3951e81155470a0194e75fe3c1a7cd09f
This commit is contained in:
parent
01f0ab6b53
commit
37112c3151
|
@ -0,0 +1,93 @@
|
|||
apiVersion: extensions/v1beta1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
name: openvswitch-db
|
||||
labels:
|
||||
component: openvswitch
|
||||
system: openvswitch-db
|
||||
namespace: default
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
name: openvswitch-db
|
||||
labels:
|
||||
component: openvswitch
|
||||
system: openvswitch-db
|
||||
namespace: default
|
||||
annotations:
|
||||
pod.alpha.kubernetes.io/init-containers: '[
|
||||
{
|
||||
"name": "initialize-ovs-db",
|
||||
"image": "{{ openvswitch_db_image_full }}",
|
||||
"command": [
|
||||
"sh",
|
||||
"-c",
|
||||
"mkdir -p /var/log/kolla/openvswitch;
|
||||
DB=/etc/openvswitch/conf.db;
|
||||
/usr/bin/ovsdb-tool create $DB;
|
||||
echo $(date) >> /var/log/kolla/db-create.log;" ],
|
||||
"volumeMounts": [
|
||||
{
|
||||
"name": "openvswitch-db",
|
||||
"mountPath": "/etc/openvswitch/"
|
||||
},
|
||||
{
|
||||
"name": "kolla-logs",
|
||||
"mountPath": "/var/log/kolla/"
|
||||
}
|
||||
]
|
||||
}
|
||||
]'
|
||||
spec:
|
||||
hostNetwork: True
|
||||
hostIPC: True
|
||||
containers:
|
||||
- image: "{{ openvswitch_db_image_full }}"
|
||||
name: openvswitch-db-server
|
||||
securityContext:
|
||||
privileged: true
|
||||
env:
|
||||
- name: KOLLA_CONFIG_STRATEGY
|
||||
value: {{ config_strategy }}
|
||||
volumeMounts:
|
||||
- mountPath: {{ container_config_directory }}
|
||||
name: openvswitch-db-config
|
||||
readOnly: true
|
||||
- mountPath: /etc/openvswitch
|
||||
name: openvswitch-db
|
||||
- mountPath: /var/run/openvswitch
|
||||
name: openvswitch-run
|
||||
- mountPath: /dev
|
||||
name: host-dev
|
||||
- mountPath: /etc/localtime
|
||||
name: host-etc-localtime
|
||||
readOnly: true
|
||||
- mountPath: /var/log/kolla
|
||||
name: kolla-logs
|
||||
command: ["sh", "-c"]
|
||||
args:
|
||||
- /usr/sbin/ovsdb-server
|
||||
/etc/openvswitch/conf.db
|
||||
-vconsole:emer
|
||||
-vsyslog:err
|
||||
-vfile:info
|
||||
--remote=punix:/var/run/openvswitch/db.sock
|
||||
--remote=ptcp:6640:0.0.0.0
|
||||
--log-file=/var/log/kolla/openvswitch/ovsdb-server.log
|
||||
volumes:
|
||||
- name: openvswitch-db-config
|
||||
configMap:
|
||||
name: openvswitch-db-server-configmap
|
||||
- name: openvswitch-db
|
||||
emptyDir: {}
|
||||
- name: openvswitch-run
|
||||
hostPath:
|
||||
path: /var/run/openvswitch
|
||||
- name: host-dev
|
||||
hostPath:
|
||||
path: /dev
|
||||
- name: host-etc-localtime
|
||||
hostPath:
|
||||
path: /etc/localtime
|
||||
- name: kolla-logs
|
||||
emptyDir: {}
|
|
@ -0,0 +1,95 @@
|
|||
apiVersion: extensions/v1beta1
|
||||
kind: DaemonSet
|
||||
metadata:
|
||||
name: openvswitch-vswitchd
|
||||
labels:
|
||||
component: openvswitch
|
||||
system: openvswitch-vswitchd
|
||||
namespace: default
|
||||
spec:
|
||||
template:
|
||||
metadata:
|
||||
name: openvswitch-vswitchd
|
||||
labels:
|
||||
component: openvswitch
|
||||
system: openvswitch-vswitchd
|
||||
namespace: default
|
||||
annotations:
|
||||
pod.alpha.kubernetes.io/init-containers: '[
|
||||
{
|
||||
"name": "initialize-ovs-vswitchd",
|
||||
"image": "{{ openvswitch_vswitchd_image_full }}",
|
||||
"command": [
|
||||
"sh",
|
||||
"-c",
|
||||
"mkdir -p /var/log/kolla/openvswitch;
|
||||
ovs-vsctl --no-wait --db=unix:/var/run/openvswitch/db.sock add-br {{ neutron_bridge_name }} ;
|
||||
ovs-vsctl --no-wait --db=unix:/var/run/openvswitch/db.sock add-port {{ neutron_bridge_name }} {{ neutron_external_interface }};
|
||||
echo $(date) >> /var/log/kolla/vswitchd-init.log;" ],
|
||||
"volumeMounts": [
|
||||
{
|
||||
"name": "kolla-logs",
|
||||
"mountPath": "/var/log/kolla/"
|
||||
},
|
||||
{
|
||||
"name": "openvswitch-run",
|
||||
"mountPath": "/var/run/openvswitch/"
|
||||
}
|
||||
]
|
||||
}
|
||||
]'
|
||||
spec:
|
||||
hostNetwork: True
|
||||
hostIPC: True
|
||||
containers:
|
||||
- image: "{{ openvswitch_vswitchd_image_full }}"
|
||||
name: openvswitch-vswitchd
|
||||
securityContext:
|
||||
privileged: true
|
||||
env:
|
||||
- name: KOLLA_CONFIG_STRATEGY
|
||||
value: {{ config_strategy }}
|
||||
volumeMounts:
|
||||
- mountPath: {{ container_config_directory }}
|
||||
name: openvswitch-vswitchd-config
|
||||
readOnly: true
|
||||
- mountPath: /var/run/openvswitch
|
||||
name: openvswitch-run
|
||||
- mountPath: /dev
|
||||
name: host-dev
|
||||
- mountPath: /etc/localtime
|
||||
name: host-etc-localtime
|
||||
readOnly: true
|
||||
- mountPath: /lib/modules
|
||||
name: host-lib-modules
|
||||
readOnly: true
|
||||
- mountPath: /var/log/kolla
|
||||
name: kolla-logs
|
||||
command: ["sh", "-c"]
|
||||
args:
|
||||
- modprobe openvswitch;
|
||||
/usr/sbin/ovs-vswitchd
|
||||
unix:/var/run/openvswitch/db.sock
|
||||
-vconsole:emer
|
||||
-vsyslog:err
|
||||
-vfile:info
|
||||
--mlockall
|
||||
--log-file=/var/log/kolla/openvswitch/ovs-vswitchd.log
|
||||
volumes:
|
||||
- name: openvswitch-vswitchd-config
|
||||
configMap:
|
||||
name: openvswitch-vswitchd-configmap
|
||||
- name: openvswitch-run
|
||||
hostPath:
|
||||
path: /var/run/openvswitch
|
||||
- name: host-dev
|
||||
hostPath:
|
||||
path: /dev
|
||||
- name: host-etc-localtime
|
||||
hostPath:
|
||||
path: /etc/localtime
|
||||
- name: host-lib-modules
|
||||
hostPath:
|
||||
path: /lib/modules
|
||||
- name: kolla-logs
|
||||
emptyDir: {}
|
Loading…
Reference in New Issue