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>.ymlin 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.ymlandcloud/<cloudname>/<regionname>.yml.File cloud/<cloudname>/params.ymlmay exist already if you’re adding a region to an existing cloud. -
If the file
cloud/<cloudname>.ymlhas keysparametersorapplications, move those keys and their contents tocloud/<cloudname>/params.yml. -
Ensure that the file
cloud/<cloudname>.ymlhas 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>.ymlin 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>.ymlhas 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 applicationsarray 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
classesarray, its configuration will override configurations in the other classes. -
Move any
parametersconfiguration intodistribution/<distributionname>/params.ymlConsider splitting out large component configurations from the
params.ymlfile.Always split out configurations of a single component and move them into a class named
distribution/<distributionname>/<component-name>.ymland 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>/cloudand create a file<cloudname>.ymlfor 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