Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Introduction


Environment Templates allow you to extend creating a blank environment and associate creating and deploying several components along with the environment itself.

In addition, environment templates also assist you in importing and exporting configuration to your core database such as: Catalog Deployment Recipes, Continuous Integration Recipes, endpoints ... etc







1- Template Structure


Templates are defined by a JSON Schema, and contains instructions about what to import to the database and what to create and deploy while creating an environment.

Basic Information:

Property NameData TypeMandatoryDefault ValueDescription
namestringyesN/AUnique template name
descriptionstringyesN/ATemplate description
reusablebooleannofalseWhether the template can be used to create multiple environments from it or it should be disabled if there is at least 1 environment created from it.
restrictionobjectnoN/ADepicts which infrastructure providers and/or container/vm technologies that can be used with this template.
contentobjectyesN/AThe content of the template which refers to the components that should be imported and/or created & deployed when using this template.
deployobjectyesN/AIf there are any components to be deployed, which stage and in what order should these components be deployed.
Root Level Template Sample
{ 
    "name" : "My Template", 
    "description" : "Template Description", 
    "reusable" : true, 
    "restriction" : { /* ... */ }, 
    "content" : { /* ... */ }, 
    "deploy" : { /* ... */ }
}

Template Restriction:

This part of the template defines if the template has a certain restriction meaning it can only be used with the following infra cloud provider or the following technology.

The below snippet states that this template is restricted to use container technology and support both docker and kubernetes drivers as well as AWS and Google Cloud as Infra Cloud Providers.

Template Restriction Example
"restriction": {
    "deployment": [
      "container"
    ],
    "driver": [
      "container.docker",
      "container.kubernetes"
    ],
    "infra": [
      "aws",
      "google"
    ]
}


Template Content:

This part of the template contains the content which gets imported upon importing the template or created & deployed while creating a new environment from this template.

Property NameData TypeMandatoryDefault ValueProcessedRestrictionDescription
recipesobjectnoN/AImportNone

Contains 2 types of recipes: catalog deployments - continuous integration.

All Recipes regardless of their type are imported upon importing a template.

endpointsobjectnoN/AImportNone

Contains the list of endpoints that should be created.

All endpoints are created upon importing a template.

custom_registryobjectnoN/ACreate EnvironmentNoneContains the list of custom registry that should be created whenever this template is used to create an environment.
productizationobjectnoN/ACreate EnvironmentNoneContains the list of productized packages that should be created OR updated whenever this template is used to create a new environment.
tenantobjectnoN/ACreate EnvironmentNoneContains the list of tenants, applications and tenant configuration that should be created OR updated whenever this template is used to create a new environment.
secretsobjectnoN/ACreate EnvironmentContainerContains the list of secrets that should be created whenever this template is used to create a new environment
deploymentsobjectnoN/ACreate EnvironmentContainer / VM

Contains the list of source code & resources that should be created whenever this template is used to create a new environment.

Root Level Template Content
{ 
    "recipes" : {
		"ci": [], 			//array of continuous integration recipes
		"deployment": [],	//array of catalog deployment recipes
	}, 
    "endpoints" : {
		"data": []			//array of endpoint entries 
	},		
    "custom_registry" : {
		"data": []			//array of custom registry entries 
	}, 
    "productization" : {
		"data": []			//array of productized packages entries 
	}, 
    "tenant" : {
		"data": []			//array of tenant entries 
	}, 
    "secrets" : {
		"data": []			//array of secrets entries 
	},
	"deployments": {
		"repo": {},			//object where each entry represents one source code deployment configuration
		"resources": {}		//object where each entry represents one resource deployment configuration
	}
}

Template Deploy:

This part of the template depicts the stages and the order of deployment for all template components.

Property NameData TypeMandatoryDefault ValueProcessedRestrictionDescription
databaseobjectnoN/ACreate EnvironmentNone

Contains the list of template content entries that should be created OR update in the database.

This stage runs before the deployments stage and only handles database execution operations.

deploymentsobjectnoN/ACreate EnvironmentContainer / VM

Contains the list of template content entries that should be deployed in containers, virtual machines or even infra setup.

This stage runs after the database stage and does not handle any database execution operations.

Template Deployments Example
{ 
    "database" : {
		"pre": {
			"custom_registry": {} //example
		},
		"steps": {
			"productization": {} //example
		},
		"post": {
			"tenant": {} //example
		}
	}, 
    "deployments" : {
		"pre": {
			"secrets.[%name%]": {} //example
		},
		"steps": {
			"deployments.repo.[%name%]": {} //example
		},
		"post": {
			"deployments.resources.[%name%]": {} //example
		}
	}
}

Each entry under the deployment stage is noted by specifying the relative path under template content to the configuration that dictates how it should be created or deployed.

Ex:

If the template contains a secret that should be created upon creating an environment, you will see something like this:

{ 
    "content": {
		"secrets": {
     		 "data": [
        		{
		          "name": "mysecret"
       			}
      		]
    	}
	},
	"deployments" : {
		"steps": {
			"secrets.mysecret": {} //specify the path to where mysecret is located under content
		}
	}
}




2- Managing Templates



Coming Soon




3- Importing Templates



Coming Soon




4- Exporting Templates



Coming Soon




5- Examples





  • No labels