kolla-kubernetes/services/nova/nova-libvirt-pod.yml.j2
Kevin Fox 739646cff6 External Ceph Tools, Tests, and Docs
This PS does the following:
 * Add support for testing Cinder.
 * Fix tests for Nova/Neutron.
 * Add some Ceph more docs.
 * Add support for a second osd for testing.
 * Add a ceph-admin pod for easier Ceph admin related activities.
 * Add a ceph-rbd daemonset that that lets you use rbd with Kubernetes without
   needing to install Ceph on the host.
 * Add back missing Cinder Keystone endpoints.
 * Make storage provider filesystem type configurable.
 * Add a ton more logging to the gate job.
 * Support Ubuntu containers in the gate.

Change-Id: Ib1241ec5e997ccc6e6a9bf0cc15ed11faf3a122b
2016-10-10 08:05:29 -07:00

141 lines
4.3 KiB
Django/Jinja

{%- set resourceName = kolla_kubernetes.cli.args.resource_name %}
{%- set netHostTrue = "yes" %}
{%- import "services/common/common-lib.yml.j2" as lib with context %}
apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
name: nova-libvirt
labels:
component: nova
system: nova-libvirt
namespace: {{ kolla_kubernetes_namespace }}
spec:
template:
metadata:
labels:
component: nova
system: nova-libvirt
annotations:
pod.alpha.kubernetes.io/init-containers: '[
{
"name": "initialize-nova-libvirt",
"image": "{{ nova_libvirt_image_full }}",
"command": [
"sh",
"-xec",
"cp -a /config/..data/* /nova/;
{%- if enable_libvirt_tcp == "yes" %}
sed -i ''s|^listen_addr.*=.*|listen_addr=\"127.0.0.1\"|g'' /nova/libvirtd.conf;
{%- endif %}
{%- if enable_ceph == "yes" %}
mkdir -p /nova/secrets/;
cp -a /secret/a/..data/data /nova/secrets/{{ rbd_secret_uuid }}.xml;
cp -a /secret/b/..data/data /nova/secrets/{{ rbd_secret_uuid }}.base64;
cp -a /config2/..data/ceph.conf /nova;
{%- endif %}
"],
"volumeMounts": [
{%- if enable_ceph == "yes" %}
{
"name": "ceph-conf",
"mountPath": "/config2"
},
{
"name": "nova-libvirt-secret",
"mountPath": "/secret/a/"
},
{
"name": "nova-libvirt-bin-secret",
"mountPath": "/secret/b/"
},
{%- endif %}
{
"name": "nova-libvirt-config",
"mountPath": "/config/"
},
{
"name": "nova-config",
"mountPath": "/nova/"
}
]
}
]'
spec:
hostNetwork: True
hostPID: True
nodeSelector:
{%- set selector = kolla_kubernetes_hostlabel_compute %}
{{ selector.key }}: {{ selector.value }}
{%- if enable_libvirt_tcp != "yes" %}
hostIPC: True
{%- endif %}
containers:
- name: main
image: "{{ nova_libvirt_image_full }}"
command:
- /bin/bash
- -c
- |
cp -a {{ container_config_directory }}/secrets /etc/libvirt;
kolla_start
securityContext:
privileged: true
volumeMounts:
{{ lib.common_volume_mounts(indent=12) }}
- mountPath: {{ container_config_directory }}
name: nova-config
- mountPath: /var/lib/libvirt
name: nova-libvirt-persistent-storage
- mountPath: /var/lib/nova
name: nova-compute-persistent-storage
- mountPath: /lib/modules
name: lib-modules
- mountPath: /var/run
name: run
- mountPath: /dev
name: dev
- mountPath: /sys/fs/cgroup
name: sys-fs-cgroup
- mountPath: /nova
name: nova-config
env:
- name: KOLLA_CONFIG_STRATEGY
value: {{ config_strategy }}
{{ lib.common_containers(indent=8) }}
volumes:
{{ lib.common_volumes(indent=8) }}
- name: nova-compute-persistent-storage
hostPath:
path: /var/lib/nova
- name: nova-libvirt-config
configMap:
name: nova-libvirt
- name: nova-libvirt-persistent-storage
hostPath:
path: /var/lib/libvirt
- name: lib-modules
hostPath:
path: /lib/modules
- name: run
hostPath:
path: /var/run
- name: dev
hostPath:
path: /dev
- name: sys-fs-cgroup
hostPath:
path: /sys/fs/cgroup
- name: nova-config
emptyDir: {}
{%- if enable_ceph == "yes" %}
- name: ceph-conf
configMap:
name: ceph-conf
- name: nova-libvirt-secret
secret:
secretName: nova-libvirt
- name: nova-libvirt-bin-secret
secret:
secretName: nova-libvirt-bin
{%- endif %}