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.

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.

  1. Compose the definition YAML content for your deployer. For more information about the YAML structure, including the required fields, see deployer definition.

  2. 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:

      1. Run the following command to apply your file to an apiserver. Replace filename with the name of your file:

        kubectl apply -f filename.yaml
        
      2. 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.

Deleting a deployer

To delete a deployer, you can use the Kubernetes command line interface (kubectl) tool, or REST 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