Creating IBM Multicloud Manager application resources
You can apply your YAML file to create the five application resources, which are defined as Application, Deployable, PlacementPolicy, DeployableOverride, or ApplicationRelationship.
Application resources are defined by community specifications from Kubernetes SIG Application CRD .
Learn how to create your application resources.
-
Choose from the following two processes to create your application resource:
-
Compose and save your YAML file with any tool, then run the following to apply it to an api-server:
kubectl apply -f <filename>
You need a Helm chart to package all the YAML files for your application.
- Replace the chart URL with a chart and update
targetCluster
with the cluster filter, this example can be used for any applications with only one Helm chart.
- Replace the chart URL with a chart and update
-
Next, verify that you created your resource by running the following command:
kubectl get <kind>
IBM Multicloud Manager specifications
Learn about the specifications for Deployable, DeployableOverride, and ApplicationRelationship. See Creating an IBM Multicloud Manager PlacementPolicy to deploy application resources to learn how to set up that resource.
- Create a Deployable
- Create a DeployableOverride
- Create an ApplicationRelationship resource
- Create a local Helm repository
Create a Deployable
You can define your deployment with the deployer
specification, such as the helm
kind, which is supported with the current version. Deploy helm
with one of the following two choices:
- Update your .yaml with
repository
,chartName
,version
. - Provide the
chartURL
directly.
You also need to specify values. Choose from one of the following procedures:
- Insert base64-encoded bytes into values.
- Provide a values URL for IBM Multicloud Manager to download.
You need to specify the namespace of the remote-cluster that you want to deploy to. See the following sample:
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
Create a DeployableOverride
You can deploy unique settings on different clusters, such as two different settings for a production and developer cluster with DeployableOverride
. This specification contains multiple overrides, each of them with two members: clusterName
and template
.
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
Create an ApplicationRelationship resource
You can define relationships among components inside Applications with ApplicationRelationship
.
For this specification, the type
is usesCreated
. You also define source
and destination
, which consists of clustername
, kind
and name
and namespace
.
See the following sample:
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
Create a local Helm repository
You can add Helm charts to the internal repository, which is provided by IBM Cloud Private. You can create an internal repository from kind: HelmRepo
.
See the following specification, where kube-system
is the targeted namespace
, but the value can be any namespace that users are assigned to, and where local-charts
is the name
, but the value can
be any repository name. The annotation
must be set to true
and you must add the spec.url:
apiVersion: mcm.ibm.com/v1alpha1
kind: HelmRepo
metadata:
namespace: kube-system
name: local-charts
annotations:
mcm.ibm.com/hub-cluster-repo: "true"
spec:
url: https://<mycluster.icp>:8443/helm-repo/charts
See Create PlacementPolicy to deploy IBM Multicloud Manager application resources to deploy a PlacementPolicy application.
See Working with IBM Multicloud Manager applications for more application topics.