Timoni offers a declarative way of managing the delivery of applications across environments.
The Timoni Runtime allows defining groups of clusters where apps are being deployed.
The Timoni Bundle supports customising the apps configuration based on the target
environment (group of clusters) and even for a specific cluster in a group.
When applying a Bundle to multiple clusters, Timoni iterates over the clusters
in the order defined in the Runtime definition.
It connects to each cluster, deploys the app changes, runs health checks,
and end-to-end tests before moving to the next cluster.
Multi-clusters definitions
Runtime definition
The following is an example of a Runtime definition containing a list of clusters:
A cluster entry is composed of:
- The name of the cluster, used to unique identify a Kubernetes cluster.
- The group, used to denote the environment a cluster belongs to.
- The kubeContext, used to select a context from the kubeconfig file.
kubeconfigNote that all clusters defined in the Runtime file must have a
corresponding context in the kubeconfig file.
By default, Timoni looks for a file named config in the $HOME/.kube directory.
You can specify other kubeconfig file by setting the KUBECONFIG environment
variable or by setting the --kubeconfig flag.
The values list can be used to query each cluster to extract values needed to
configure Ingress, TLS, auth, etc, during the app deployment. For more information
on how to query a cluster, please see the runtime values doc.
Bundle definition
The following is an example of a Bundle definition that uses the cluster attributes
to set the number of replicas to different values for staging and production:
The cluster name and group, are mapped to fields in a Bundle using the following attributes:
@timoni(runtime:string:TIMONI_CLUSTER_NAME)
@timoni(runtime:string:TIMONI_CLUSTER_GROUP)
Multi-cluster operations
Validation
Build the Runtime definition to verify the connectivity to each cluster:
Print the Bundle variants to verify the final values used for each cluster:
Perform a dry-run apply of the Bundle to review the changes across clusters:
Install and Upgrade
To install or upgrade the instances defined in the Bundle to all clusters:
Note that Timoni deploys the app instances to all the clusters, in the order
defined in the Runtime. If the apply fails on a staging cluster,
Timoni will stop the execution and not continue with production.
After editing a bundle file, to review the changes that will
be made on all clusters:
Status
To list the current status of the deployed apps on all clusters:
Or using the bundle name:
Uninstall
To delete all deployed apps on all clusters:
Or using the bundle name:
Cluster filtering
To perform an apply only on a group of clusters:
To perform an apply only on a cluster:
Note that all timoni bundle commands support filtering by cluster name and group.