This guide covers CCP specific DSL, which is used by the CCP CLI to populate k8s objects.
All application definition files should be located in the service/ directory, as a component_name.yaml file, for example:
service/keystone.yaml
All templates, such as configs, scripts, etc, which will be used for this service, should be located in service/<component_name>/files, for example:
service/files/keystone.conf.j2
All files inside this directory are Jinja2 templates. Default variables for these templates should be located in service/component_name/files/defaults.yaml inside the configs key.
There are three config locations, which the CCP CLI uses:
Before deployment, CCP will merge all these files into one dict, using the order above, so “component defaults” will override “global defaults” and “global config” will override everything.
This is project wide defaults, CCP keeps it inside fuel-ccp repository in fuel_ccp/resources/defaults.yaml file. This file defines global variables, that is variables that are not specific to any component, like eth interface names.
Each component repository could contain a service/files/defaults.yaml file with default config for this component only.
Optional config with global overrides for all services. Use it only if you need to override some defaults.
Each config could contain 3 keys:
Each key has its own purpose and isolation, so you have to add your variable to the right key to make it work.
Isolation:
Allowed content:
Example:
configs:
keystone_debug: false
So you could add “{{ keystone_debug }}” variable to you templates, which will be rendered into “false” in this case.
Isolation:
Allowed content:
For example:
versions:
influxdb_version: "0.13.0"
So you could add this to influxdb Dockerfile.j2:
curl https://dl.influxdata.com/influxdb/releases/influxdb_{{ influxdb_version }}_amd64.deb
Isolation:
Allowed content:
Remote git repository example:
sources:
openstack/keystone:
git_url: https://github.com/openstack/keystone.git
git_ref: master
Local git repository exaple:
sources:
openstack/keystone:
source_dir: /tmp/keystone
So you could add this to Dockerfile.j2:
{{ copy_sources("openstack/keystone", "/keystone") }}
CCP will use the chosen configuration, to copy git repository into Docker container, so you could use it latter.
Isolation:
Allowed content:
You could use it to get the private and public eth IP address. For example:
bind = network_topology["private"]["address"]
listen = network_topology["public"]["address"]
Isolation:
Allowed content:
Isolation:
Allowed content:
This is mainly used to pass some k8s related information to container, for example, you could use it to pass k8s node hostname to container via this variable:
Create env key:
env:
- name: CCP_NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
Use this variable in some config:
{{ CCP_NODE_NAME }}
Please refer to Application definition language for detailed description of CCP DSL syntax.