Create missing cloud, region, or distribution
This how-to gives instructions on how to add a missing cloud, cloud region or K8s distribution in the Commodore defaults repo.
Create a missing cloud
If the cloud on which your cluster runs doesn’t exist yet in the Commodore defaults repo, you can create it as follows:
-
Create file
cloud/<cloudname>.yml
in the repo -
Add the new cloud to all cloud-aware distributions
cloud=<cloudname> for dist in distribution/*.yml; do d=${dist#distribution\/} d=${d%.yml} dist_cloud="distribution/${d%.yml}/cloud" if [ -d "${dist_cloud}" ]; then echo "Adding cloud to distribution ${d}" touch "${dist_cloud}/${cloud}.yml" fi done
-
If the cloud has multiple regions, continue with [_creating_a_missing_region]
Create a missing region
If the cloud region on which your cluster runs doesn’t exist yet in the Commodore defaults repo, you can create it as follows:
-
If the cloud on which your cluster runs doesn’t exist either, go to creating a missing cloud, follow the steps there and come back here.
-
Create files
cloud/<cloudname>/params.yml
andcloud/<cloudname>/<regionname>.yml
.File cloud/<cloudname>/params.yml
may exist already if you’re adding a region to an existing cloud. -
If the file
cloud/<cloudname>.yml
has keysparameters
orapplications
, move those keys and their contents tocloud/<cloudname>/params.yml
. -
Ensure that the file
cloud/<cloudname>.yml
has exactly the following contents:cloud/<cloudname>.ymlclasses: - global.cloud.<cloudname>.params - global.cloud.<cloudname>.${facts:region}
Create a missing distribution
If the distribution don’t exist yet in the Commodore defaults repo, you can create it as follows:
-
Create file
distribution/<distributionname>.yml
in the repo.
Make a distribution cloud-aware
If you foresee — or currently have — the need to be able to provide cloud-specific configurations for a distribution, you can make the distribution cloud-aware.
-
If the distribution doesn’t exist yet, create it
-
Ensure that the file
distribution/<distributionname>.yml
has the following class includes:distribution/<distributionname>.ymlclasses: - global.distribution.<distributionname>.params - global.distribution.<distributionname>.cloud.${facts:cloud}
It’s perfectly acceptable to have entries in the applications
array in this file.It’s fine to include additional classes in this file. Remember that class includes are processed top-to-bottom. This means that if you include a class at the end of the
classes
array, its configuration will override configurations in the other classes. -
Move any
parameters
configuration intodistribution/<distributionname>/params.yml
Consider splitting out large component configurations from the
params.yml
file.Always split out configurations of a single component and move them into a class named
distribution/<distributionname>/<component-name>.yml
and include that class indistribution/<distributionname>/params.yml
.We recommend splitting out component configurations if they consist of 30+ lines of YAML.
-
Create folder
distribution/<distributionname>/cloud
and create a file<cloudname>.yml
for each cloud that the distribution needs to support.If you’re not sure which clouds the distribution needs to support, create files for all clouds which are defined in the configuration with
distname=<distributionname> for cloud in cloud/*.yml; do touch distribution/${distname}/${cloud} done