kolla-kubernetes/services/ceph/ceph-bootstrap-osd.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

115 lines
3.8 KiB
Django/Jinja

{%- set podTypeBootstrap = "yes" %}
{%- set resourceName = kolla_kubernetes.cli.args.resource_name %}
{%- set index = kolla_kubernetes.template.vars.index %}
{%- import "services/common/common-lib.yml.j2" as lib with context %}
apiVersion: v1
kind: Pod
metadata:
name: ceph-bootstrap-osd{{ index }}
namespace: {{ kolla_kubernetes_namespace }}
annotations:
#FIXME Once out of alpha, this should be converted to yaml.
pod.alpha.kubernetes.io/init-containers: '[
{
"name": "update-config",
"image": "{{ kolla_toolbox_image_full }}",
"command": [
"/bin/sh",
"-c",
"cp -a /srv/configmap/..data/* /srv/pod-main-config/;
STORAGE_INTERFACE={{ storage_interface }};
F=/var/lib/kolla-kubernetes/ceph-osd/storage_interface;
[ -f $F ] && STORAGE_INTERFACE=$(<$F) || true;
IP=$(ip addr list {{ storage_interface }} | grep ''inet '' |cut -d'' '' -f6|cut -d/ -f1);
CONF=/srv/pod-main-config/ceph.conf;
sed -i ''/^mon host.*/d;/^mon host/d;/^mon addr/d'' $CONF;
sed -i ''/^\\[global\\]/a mon host = ''$IP $CONF;
sed -i ''/^\\[global\\]/a mon addr = ''$IP'':6789'' $CONF;
sed -i ''/^\\[global\\]/a mon initial members = {{ storage_ceph.initial_mon }}'' $CONF;"
],
"volumeMounts": [
{
"name": "ceph-osd-config",
"mountPath": "/srv/configmap"
},
{
"name": "pod-main-config",
"mountPath": "/srv/pod-main-config"
},
{
"name": "ceph-osd",
"mountPath": "/var/lib/ceph/osd"
}
]
}
]'
spec:
hostNetwork: True
hostPID: True
nodeSelector:
kubernetes.io/hostname: {{ storage_ceph.initial_mon }}
restartPolicy: Never
containers:
- image: "{{ ceph_osd_image_full }}"
name: main
securityContext:
privileged: true
env:
- name: KOLLA_BOOTSTRAP
value: ""
- name: KOLLA_CONFIG_STRATEGY
value: "{{ config_strategy }}"
- name: USE_EXTERNAL_JOURNAL
value: "True"
- name: JOURNAL_DEV
value: "/dev/loop{{ index }}"
- name: JOURNAL_PARTITION_NUM
value: "1"
- name: JOURNAL_PARTITION
value: "/dev/loop{{ index }}p1"
- name: OSD_DEV
value: "/dev/loop{{ index }}"
- name: OSD_PARTITION_NUM
value: "2"
- name: OSD_PARTITION
value: "/dev/loop{{ index }}p2"
- name: OSD_INITIAL_WEIGHT
value: "1"
- name: OSD_FILESYSTEM
value: "xfs"
- name: HOSTNAME
value: {{ storage_ceph.initial_mon }}
volumeMounts:
{{ lib.common_volume_mounts(indent=8) }}
- mountPath: {{ container_config_directory }}/ceph.conf
name: pod-main-config
readOnly: true
subPath: ceph.conf
- mountPath: {{ container_config_directory }}/config.json
name: pod-main-config
readOnly: true
subPath: config.json
- mountPath: /var/lib/ceph
name: ceph-osd
- mountPath: {{ container_config_directory }}/ceph.client.admin.keyring
subPath: data
name: ceph-client-admin-keyring
- mountPath: /dev
name: host-dev
volumes:
{{ lib.common_volumes(indent=4) }}
- name: pod-main-config
emptyDir: {}
- name: ceph-osd-config
configMap:
name: ceph-osd
- name: ceph-osd
hostPath:
path: /var/lib/kolla/volumes/ceph-osd
- name: host-dev
hostPath:
path: /dev
- name: ceph-client-admin-keyring
secret:
secretName: ceph-client-admin-keyring