Links
Comment on page

Templates

On the Templates Page you can specify two types of Templates:
  • Manifests (YAML or JSON format)
    • A Kubernetes manifests represents the specification of an API object in JSON or YAML format. In a manifest you can specify a desired state of an object that Kubernetes will create and maintain when the manifest is applied to the specific Kubernetes cluster.
  • Charts
    • A chart represents a collection of files that describe a related set of Kubernetes API objects or resources. The template language of a chart is implemented in typed Go programming language.
The Templates is composed by two different objects types.
  • Arguments that are mandatory to define a functional deployment
    • name → represents a unique name of the defined template
    • status → template status, any value from an allowed list of values
      • active production ready
      • inactive → in development
    • owner: the user which created the template
    • public → boolean value, true if the template should be:
      • public endpoint exposed in the public templates list
      • private templates are exposed internal only
    • manifest → the Kubernetes manifest which will be created by the deployment action, not required if a chart template is added
    • chart → the chart template which will be created by the deployment action, not required if a Kubernetes manifest is added
    • default_time → represents the default time until an environment_action is triggered, the logic behind this parameters is that we want on-demand disposable containers triggered by external or internal actions like paying an invoice, closing or opening a contract, etc
    • additional_time → represents an additional time when the default time is reached, this is used as a failsafe mechanism before triggering the environment_action
    • grace_time → represents the grace period before the environment is deleted or terminated
    • environment_action business logic for environments lifecycle
      • terminate →the env is terminated when the default_time, addition_time and grace_time are reaching 0 seconds.
      • manual manual trigger.
      • stop downscale to 0 all the resources that can be scaled to 0(Deployments, StatefulSets, ReplicaSets, etc)
    • details → represents the description about the current defined template

  • Extra-Arguments that are designed to encapsulate dynamic or specific template arguments
    • extra_args → additional arguments added in template in order to deploy the defined solution and achieve a desired state
      • example: if you need to deploy a web service solution with an ingress and an different ingress endpoint for each deployment is required, here you will define an argument with a default value which can be overridden at the deployment step
    • form_params: extra arguments which are mapped with "extra_args" values and can be public.
      • In form_params you can define how the public form can be shown on the external lading page integrated with KubeArk Platform
        • example: let's take an ingress.hostname parameter, we will define ingress.hostname as an parent key and the values contained represents a set of key-value pairs defining an html input form. All the HTML valid forms are accepted as key-value pairs.)
Example of a Template payload:
{
"name":"wordpress",
"status": "active",
"owner":"need_to_add_an_account",
"public": true,
"manifest": {},
"chart": {
"name": "wordpress",
"repo": "bitnami",
"repo_url": "https://charts.bitnami.com/bitnami",
"path": ""
},
"extra_args": {
"ingress.enabled": "False",
"ingress.ingressClassName": "nginx",
"ingress.hostname": "your_ingress_hostname",
"persistence.enabled": "false",
"persistence.size": "1Gi",
"mariadb.primary.persistence.enabled": "false",
"wordpressPassword": "your_wordpress_password",
"mariadb.auth.rootPassword": "your_mariadb_rootpassword",
"mariadb.auth.password": "your_mariadb_password",
"test_empty_arg": "empty"
},
"form_params": {
"ingress.hostname": {
"input_type": "text",
"default_value": "your_ingress_default_value",
"value": "",
"label": "Website hostname",
"required": true,
"id": "hostname",
"name": "DNS name",
"minlength": 4,
"maxlength": 12,
"size": 10,
"pattern": "[A-Za-z].[A-Za-z]{12}",
"title": "12 alpha characters."
},
"wordpressPassword": {
"input_type": "password",
"default_value": "",
"value": "",
"label": "Website password",
"id": "wordpressPassword",
"name": "Admin password"
}
},
"details": "details about your template",
"default_time": 30,
"additional_time":15,
"environment_action": "terminate",
"grace_time": 20
}