IBM Multicloud Manager application resource overview
An IBM Multicloud Manager application consists of five application resources, which are defined as Application, Deployable, PlacementPolicy, DeployableOverride, and ApplicationRelationship.
Application specification
A cluster application is defined with the Kubernetes SIG Application CRD community specification. A multi-cluster application uses the same Kubernetes specification, but with additional automation of the deployment and life-cycle management of resources to individual clusters.
Application resource examples
View and deploy applications with the five resources. Your Application is used to only view your resource, while the other four application resource examples are for deployment.
Application resource
View your resource with an Application resource. See the following example of the definition for an Application.
Edit the spec
section of your YAML to define your application with labels. The Application spec
groups resources in componentKinds
based on the selector
. See the following sample, where Service,
Deployment and Statefulset, with the app: details
label are grouped into the Application details-app
:
apiVersion: mcm.ibm.com/v1alpha1
kind: Application
metadata:
name: details-app
labels:
app: details
spec:
selector:
matchLabels:
app: details
componentKinds:
- group: core
kind: Service
- group: apps
kind: Deployment
- group: apps
kind: StatefulSet
Deployable
A Deployable resource deploys your Helm chart.
Edit the spec
section of your YAML to define your application. See the following sample Deployable spec
, which defines the Helm chart as a deployable resource. Here, chartName
, nginx-lego
, and
chartVersion
, 0.3.1
, are in the google
repository. The placementPolicy
defines the deployment criteria.
apiVersion: mcm.ibm.com/v1alpha1
kind: Deployable
metadata:
name: trader
labels:
serviceKind: ApplicationService
name: trader
placementPolicy: "trader"
spec:
deployer:
kind: helm
helm:
repository: google
chartName: nginx-lego
chartVersion: 0.3.1
PlacementPolicy
PlacementPolicy defines the criteria to find cluster(s) to place or deploy workloads. For example, if you create a PlacementPolicy, add or remove a cluster, or if your cluster compliance changes, IBM Multicloud Manager generates a new list
of target clusters based on those changes. If more than one cluster matches that criteria, then IBM Multicloud Manager uses resourceHint
as criteria, then deletes what is no longer valid.
Edit the spec
section of your YAML to define your PlacementPolicy. See the following sample PlacementPolicy that defines a cluster with purpose
as prod
, and resourceHint
defined as cpu
so that IBM Multicloud Manager chooses the cluster with the most available CPU cores.
apiVersion: mcm.ibm.com/v1alpha1
kind: PlacementPolicy
metadata:
name: trader
spec:
replicas: 1
clusterLabels:
matchLabels:
purpose: prod
resourceHint:
type: cpu
order: desc
DeployableOverride
DeployableOverride is used to define different values from the original Deployable and override a deployment.
Edit the spec
section of your YAML to define your DeployableOverride. Any value in the spec
template
can be different from the original Deployable.
See the following sample, where deployer
is defined for production cluster
and for test cluster
. The sample file contains the same Helm chartName
and chartVersion
, but different repository
values to deploy to a cluster.
apiVersion: mcm.ibm.com/v1alpha1
kind: DeployableOverride
metadata:
name: trader
spec:
overrides:
- clustername: productioncluster
namespace: default
template:
deployer:
kind: helm
helm:
repository: production-repo
chartName: app-chart
chartVersion: 0.11.0
values: somevalues
- clustername: testcluster
namespace: default
template:
deployer:
kind: helm
helm:
repository: test-repo
chartName: app-chart
chartVersion: 0.11.0
values: someothervalues
ApplicationRelationship
ApplicationRelationship deploys an application on another application based on the source
and destination
values.
Edit the spec
section of your YAML to define your application. The following sample shows the definition for the details of the ApplicationRelationship, where Deployable
product-app
depends on Deployable
details-app
, and the two are deployed together.
apiVersion: mcm.ibm.com/v1alpha1
kind: ApplicationRelationship
metadata:
name: product-to-details
labels:
app: productpage
spec:
type: usesCreated
source:
clustername: crucial-owl
kind: Deployable
name: product-app
namespace: default
destination:
kind: Deployable
name: details-app
clustername: crucial-owl
namespace: default
See Creating IBM Multicloud Manager application resources to learn how to create application resources.
Then, see Working with IBM Multicloud Manager applications for more application topics.