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 anAPI object
inJSON
orYAML
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 Kubernetescluster
.
Charts
- A
chart
represents a collection of files that describe a related set of KubernetesAPI 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 deploymentname
→ represents a uniquename
of the defined templatestatus
→ template status, any value from an allowed list of valuesactive
→ production readyinactive
→ in development
owner
: theuser
which created the templatepublic
→ boolean value, true if the template should be:public
→ endpoint exposed in the publictemplates
listprivate
→templates
are exposed internal only
manifest
→ the Kubernetes manifest which will be created by the deployment action, not required if achart
template is addedchart
→ the chart template which will be created by the deployment action, not required if a Kubernetesmanifest
is addeddefault_time
→ represents the default time until anenvironment_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, etcadditional_time
→ represents an additional time when the default time is reached, this is used as a failsafe mechanism before triggering theenvironment_action
grace_time
→ represents the grace period before the environment isdeleted
orterminated
environment_action
→ business logic for environments lifecycleterminate
→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 argumentsextra_args
→ additional arguments added intemplate
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
}
Last modified 1yr ago