Kubernetes items

Support for Kubernetes is experimental at this time. Backwards-incompatible changes may happen at any time.

See also: Guide to Kubernetes


Manage resources in Kubernetes clusters.

k8s_namespaces = {
     "my-app": {},
     "my-previous-app": {'delete': True},
}

k8s_deployments = {
    "my-app/my-deployment": {
        'manifest': {
            ...
        },
    },
}

Note that all item names (except namespaces themselves) must be prefixed with the name of a namespace and a forward slash /. Resource items will automatically depend on their namespace if you defined it.


Resource types

Resource typeBundle attributeapiVersion
Config Mapk8s_configmapsv1
Cron Jobk8s_cronjobsbatch/v1beta1
Daemon Setk8s_daemonsetsv1
Deploymentk8s_deploymentsextensions/v1beta1
Ingressk8s_ingressesextensions/v1beta1
Namespacek8s_namespacesv1
Persistent Volume Claimk8s_pvcv1
Servicek8s_servicesv1
Secretk8s_secretsv1
StatefulSetk8s_statefulsetsapps/v1


Attribute reference

See also: The list of generic builtin item attributes


context

Only used with Mako and Jinja2 manifests (see manifest_processing below). The values of this dictionary will be available from within the template as variables named after the respective keys.


delete

Set this to True to have the resource removed.


manifest

The resource definition (as defined in the Kubernetes API) formatted as a Python dictionary (will be converted to JSON and passed to kubectl apply). Mutually exclusive with manifest_file.


manifest_file

Filename of the resource definition relative to the manifests subdirectory of your bundle. Filenames must end in .yaml, .yml, or .json to indicate file format. Mutually exclusive with manifest.


manifest_processor

Set this to jinja2 or mako if you want to use a template engine to process your manifest_file. Defaults to None.