title | sidebar_position |
---|---|
Multi-Chart Installations |
3 |
It is possible to combine multiple deployments in one Installation. We will demonstrate this with the blueprint in this Installation. It contains two DeployItems. Each of them deploys the hello-world Helm chart, but to two different clusters. Therefore, the Installation imports two Target objects: target-1.yaml and target-2.yaml.
For prerequisites, see here.
Suppose the second deployment must not take place until the first one has been successfully completed.
You can achieve this by defining a dependency between the two DeployItems. In the current example, we have defined that the second DeployItem depends on the first, i.e. the DeployItem with name deploy-item-2
contains a dependsOn
section as follows:
dependsOn:
- deploy-item-1
As a consequence, DeployItem deploy-item-1
will be processed first, and DeployItem deploy-item-2
afterward.
Each DeployItem can depend on several other DeployItems.
Note: Always make sure that the dependency graph does not contain cycles!
-
In the settings file, adjust the variables
RESOURCE_CLUSTER_KUBECONFIG_PATH
,TARGET_CLUSTER_KUBECONFIG_PATH_1
, andTARGET_CLUSTER_KUBECONFIG_PATH_2
. -
On the Landscaper resource cluster, create a namespace
cu-example
. -
Run script commands/deploy-k8s-resources.sh. It creates two targets based on the template target.yaml.tpl and the installation.yaml.tpl.
-
Wait until the Installation is in phase
Succeeded
. Check if both target clusters contain the hello-world Helm chart deployment. If you are fast enough, you should be able to observe that this happens one after the other in the two target clusters.
You can remove the Installation with the delete-installation script. When the Installation is gone, you can delete the Targets with the delete-other-k8s-resources script.