Creating and managing deployers
You can use the Deployer custom resource to represent your infrastructure deployers, such as Infrastructure management or Ansible. With the support for infrastructure deployers, you can create hybrid deployable resources that represent components that run on these different Deployers, such as virtual machines, cloud services, and containers.
Within your environment, you can have essential components running on different existing infrastructure systems, including Kubernetes, cloud service providers, virtual machines, and containers. As you are creating and managing applications, you
might want, or need, to include these components and the system where they need to be deployed as part of the application. The Deployer (deployers.core.hybridapp.io
) Custom Resource (CR) is introduced to identify the instances of
these essential systems.
The systems that you represent with a Deployer resource can exist on a managed cluster, such as a virtual machine, or on the hub cluster, such as Infrastructure management. When you have a deployer represented by a Deployer resource, the components that run on that deployer can have hybrid deployables created to represent them on the hub cluster. With the deployables created, you can then create the Applications to manage the collected resources.
- Create a deployer
- Update a deployer
- Delete a deployer
- View the deployer definition
- View an example deployer
Deployer sets
As you are managing deployers, you might notice the creation of a deployer set (deployersets.core.hybridapp.io
) custom resource for your managed clusters. This resource is automatically generated and is used to identify the deployers
that run on the cluster. These resources are added to the cluster namespace on the Hub cluster to represent the deployer capabilities of each managed cluster. Each managed cluster can have 1, and only 1, deployer set. As these deployer sets are
automatically generated and managed, you do not need to create, edit, or otherwise manage these resources.
Create a deployer
Note: When you install the Infrastructure management module, a deployer for Infrastructure management is created automatically. With this deployer, virtual machines (VM) that run on Infrastructure management are automatically discovered and can be used to assemble applications with the console.
-
Compose the definition YAML content for your deployer. For more information about the YAML structure, including the required fields, see deployer definition.
-
Create the deployer within IBM Cloud Pak for Multicloud Management.
To create a deployer as a separate resource, you can use the Kubernetes CLI (
kubectl
) tool, or REST API:-
To use the Kubernetes CLI tool:
-
Run the following command to apply your file to an apiserver. Replace
filename
with the name of your file:kubectl apply -f filename.yaml
-
Verify that your deployer is created, by running the following command:
kubectl get Deployer
Ensure that your new deployer is listed in the resulting output.
-
-
To use REST API, you need to use the deployer POST API.
-
Updating a deployer
To update a deployer, you can use the Kubernetes command line interface (kubectl
) tool, or REST API.
-
To use the Kubernetes CLI tool, the steps are the same as for creating a deployer.
-
To use REST API, you need to use the deployer PATCH API.
Deleting a deployer
To delete a deployer, you can use the Kubernetes command line interface (kubectl
) tool, or REST API.
-
To use the Kubernetes CLI tool, complete the following steps:
-
Run the following command to delete the deployer from a target namespace. Replace
name
andnamespace
with the name of your deployer and your target namespace:kubectl delete Deployer <name> -n <namespace>
-
Verify that your deployer resource is deleted by running the following command:
kubectl get Deployer <name>
-
-
To use REST API, you need to use the deployer DELETE API:
Deployer definition YAML structure
The following YAML structure shows the required fields for a deployer and some of the common optional fields. Your YAML structure needs to include some required fields and values. Depending on your application management requirements, you might need to include other optional fields and values. You can compose your own YAML content with any tool.
apiVersion: core.hybridapp.io/v1alpha1
kind: Deployer
metadata:
annotations:
core.hybridapp.io/deployer-in-cluster: 'true'
name:
namespace:
spec:
capabilities:
- apiGroups:
resources:
resourceNames:
nonResourceURLs:
verbs:
scope:
type:
placementTarget:
name:
version:
resource:
operatorRef:
name:
apiVersion:
kind:
namespace:
Attribute | Required | Description |
---|---|---|
apiVersion |
Y | Set the value to core.hybridapp.io/v1alpha1 . |
kind |
Y | Set the value to Deployer to indicate that the resource is a deployer. |
metadata.name |
Y | The name for identifying the deployer. |
metadata.namespace |
Y | The namespace resource to use for the deployer. |
metadata.labels |
N | The labels for the resource, such as to define the deployer-type . |
metadata.annotations |
N | Any annotations that you need to set for the deployer. |
spec.capabilities |
N | The resources and actions supported by this deployer instance. |
spec.Scope |
Y | Identifies the scope where the deployer can operate on resources, set as cluster to indicate that the deployer can operate only within the cluster where it is hosted. |
spec.type |
Y | Identifies the type of infrastructure service or the capability of the deployer. |
spec.placementTarget |
N | Defines the group-version-resource of the target resource. If this field is not specified, all Deployers with same type are considered as placementTarget. |
spec.operatorRef |
N | Point to the Kubernetes resource that represents the operator for this deployer instance so that deployer operator can get the capabilities from it. |
Example deployer YAML
The following YAML content defines an example deployer:
apiVersion: core.hybridapp.io/v1alpha1
kind: Deployer
metadata:
annotations:
core.hybridapp.io/deployer-in-cluster: 'true'
name: ibminfra
namespace: management-infrastructure-management
spec:
capabilities:
- apiGroups:
- infra.management.ibm.com
resources:
- virtualmachines
verbs:
- '*'
scope: Cluster
type: ibminfra