zun/template/capsule/capsule.yaml
Kevin Zhao d4a5f9c5e9 Add detailed parameters for Capsule create
Currently we don't have detailed parameters checking
when creating a capsule, this patch add the volume
parameters type checking and several test cases.

Also modify the related template file and design document.
Change some parameters in the template to Kubernetes
friendly.

Modify the field check from "spec" to "template" in
check_capsule_template, since there already a low level spec
field in capsule yaml. Will also modify the python-zunclient.

Part of blueprint introduce-compose

Change-Id: I88c1c248d83d0a27f5a291fcf9d952bb70234dff
Signed-off-by: Kevin Zhao <kevin.zhao@arm.com>
2018-01-12 10:10:36 +08:00

71 lines
1.4 KiB
YAML

# use "-" because that the fields have many items
capsuleVersion: beta
kind: capsule
metadata:
name: capsule-example
labels:
app: web
app1: web1
restartPolicy: always
spec:
containers:
- image: ubuntu
command:
- "/bin/bash"
imagePullPolicy: ifnotpresent
workDir: /root
ports:
- name: nginx-port
containerPort: 80
hostPort: 80
protocol: TCP
resources:
requests:
cpu: 1
memory: 1024
env:
ENV1: /usr/local/bin
volumeMounts:
- name: volume1
mountPath: /data1
readOnly: True
- image: centos
command:
- "echo"
args:
- "Hello"
- "World"
imagePullPolicy: ifnotpresent
workDir: /root
ports:
- name: nginx-port
containerPort: 80
hostPort: 80
protocol: TCP
- name: mysql-port
containerPort: 3306
hostPort: 3306
protocol: TCP
resources:
requests:
cpu: 1
memory: 1024
env:
ENV2: /usr/bin/
volumeMounts:
- name: volume2
mountPath: /data2
- name: volume3
mountPath: /data3
volumes:
- name: volume1
cinder:
size: 5
autoRemove: True
- name: volume2
cinder:
volumeID: 473e4a6a-99f2-4b42-88ce-5ab03a00b756
- name: volume3
cinder:
volumeID: f4246aa1-1c87-479c-a2ab-4dbaf0c3c7bb