Deploying application resources

You can deploy application resources, such as Kubernetes deployable objects or Helm charts to a cluster to update existing applications or to add applications. IBM Cloud Pak for Multicloud Management supports multiple options for the deployment of deployable objects.

Within the IBM Cloud Pak for Multicloud Management application model, you use deployables (Deployable.app.ibm.com), which are Kubernetes resources that contain templates to wrap other Kubernetes resources or represent Helm releases for deployment. Deployables are used to wrap other resources to prevent actions from being run against the resources by Kubernetes and other controllers before the resources are placed on target clusters. For more information about deployables, see Application resources.

When you are preparing to deploy, the deployment option that you can use can depend on the following requirement:

In general, if you plan to use a continuous delivery model for developing your applications, use a combination of channels, subscriptions, and placement rules.

Channels, subscriptions, and placement rules can help you to unify and simplify your continuous deliveries that involve frequent updates and deployments to multiple clusters. Use a combination of these resources when you need to make deploy to multiple clusters, deploy frequent updates, and share deployment settings across multiple deployables.

If you need to specify placement settings for specific clusters, you can still use shared placement rules and include placement overrides for the deployables that need some different settings. For instance, if you use a placement rule with a deployable that you need to deploy to multiple clusters, you can include overrides for any single cluster than requires some different settings.

If you need to deploy a Kubernetes resource or Helm chart to only a single cluster with infrequent updates, you can use just a placement rule. You can define the placement rule as a separate resource or as part of the definition for the deployable.

Based on your deployment requirements, review the details and process for the following deployment options:

Deploy by using channels, subscriptions, and placement rules

Diagram that shows relationship between deployables, channel, subscription, and placement rule.

To set up and use channels, subscriptions, and placement rules for deployments, complete the following procedure:

  1. If the channel for representing the object store, Kubernetes namespace, or Helm repository does not exist, create the channel. Ensure that you define any labels or annotations that deployables must have before they can be promoted to the channel. For more information, see Creating and managing channels.

  2. If your deployables do not exist, create your deployables. For more information, see Creating and managing deployables.

  3. If your target cluster or clusters are not subscribed to the channel, create the subscription. For more information, see Creating and managing subscriptions.

  4. Define the placement rule for the deployables that are to be deployed from the channel. For more information, see Creating and managing placement rules.

    A placement rule can be defined for a subscription and for deployables. Define the placement rule or reference to the placement rule in the subscription definition to have the rule apply to multiple deployables and clusters. Define the placement rule or reference to the rule in the deployables definitions when you do not want to have the same settings apply to all deployables for the subscription or when you want to override a subscription-level placement rule. If you are referencing a placement rule, you can also include override settings for a deployable to override some placement rule values with values specific to the deployable.

  5. Optional. If you created the placement rule as a stand-alone resource, edit the definition for your subscription or deployables to reference your placement rule.

  6. Edit the definition for your deployables and your channel to ensure that deployables are promoted to the channel. For more information, see Promote a deployable to a channel.

  7. Use the console to monitor the status of the deployment to the target cluster or clusters for the channel.

Scheduling a deployment

If you need to deploy new or changed Helm charts or other resources during only specific times, you can define subscriptions for those resources to begin deployments during only those specific times. Alternatively, you can restrict deployments from beginning during specific time windows, such as to avoid unexpected deployments during peak business hours.

For more information, see Scheduling resource deployments for a subscription.

Promote a deployable to a channel

To promote a deployable to a channel, you can use any of the following methods:

Deploy with a rolling update

If you want to roll out a deployment to your target managed clusters instead of deploying to all target cluster, you can configure the deployment of a deployable or chart to only a percentage of your managed clusters at a time. For instance, you might want to roll out a deployment when you need to deploy an update but you do not want to affect all clusters at once. When the deployment is successful on a cluster, the deployment is rolled out to another cluster.

For more information, see Deploying application resources with rolling update.

Deploy by using only placement rules

If you do not want or need to use channels and subscriptions, you can still use placement rules. When you are deploying a deployable by using only a placement rule, the deployable definition can include a reference to a stand-alone placement rule resource as shown in the following image:

Diagram that shows relationship between deployables and placement rule.

In this scenario, the placement rule defines how to deploy the deployable on target clusters. This placement rule can also be referenced by other deployables so that those deployables are handled with the same deployment settings.

Alternatively, a deployable can include a placement rule definition within the deployable definition. In this scenario, the deployable does not reference any stand-alone placement rule. The placement rule definition that is defined within a deployable is not referenced and shared by other deployables. The following image shows this relationship:

Diagram that shows relationship between deployables and application.

To deploy by using a placement rule, define the placement rule for the deployable either as a stand-alone placement rule resource or as part of the deployable definition. If you define the rule as a separate resource, include the placementRef field in the definition for the deployable to point to the placement rule.

For more information about defining a placement rule, see Creating and managing placement rules.