Use the OpenShift plugin

You can use the XL Deploy OpenShift plugin to create or destroy OpenShift resources on an OpenShift server. To use the plugin:

  1. Download the XL Deploy OpenShift plugin ZIP from the distribution site.
  2. Unpack the plugin inside the XL_DEPLOY_SERVER_HOME/plugins/ directory.
  3. Restart XL Deploy.

With this plugin, types such as OpenShift cloud and tasks specific for creating or removing OpenShift resources are available to use in XL Deploy.

Note: Make sure that a compatible version of the Kubernetes plugin is also added to the XL_DEPLOY_SERVER_HOME/plugins/ directory.

Setup the OpenShift server with minishift

  1. Under Infrastructure, click New and select openshift.Server.

  2. Set up the openshift.Server authentication using one of the following methods:

    • Client Certificate Authentication. Specify the following required properties:

      • serverUrl: The URL of the OpenShift server
      • verifyCertificates: Validate the cerificates
      • caCert: Certification authority certificate for server (example .../.minishift/ca.crt)
      • tlsCert: TLS certificate for master server (example .../.minishift/apiserver.crt)
      • tlsPrivateKey: TLS private key for master server (example .../.minishift/apiserver.key)
    • Token Authentication

      • openshiftToken: Token used for authentication

Verify the OpenShift server connectivity

To verify openshift.Server connectivity go to Infrastructure, select the appropriate authentication node and click Check Connection.

Create a new OpenShift project before any resource can be deployed to it

The openshift.Project is the container for all of the openshift resources. You must have the project deployed through XL Deploy. The target project must be deployed in a separate package, different than the package containing other OpenShift resources such as pod, deployment.

  • The openshift.Project CI requires only the project name. If the project name is not specified, XL Deploy uses the CI name as project name.
  • The openshift.Project CI does not allow project name modification.

Use an existing project provided by the OpenShift server

You can use existing projects as follows:

  1. Create the openshift.Project in openshift.Server under Infrastruture.
  2. Provide the default project name when default project exists on the OpenShift server so that there is no need to have a provisioning package containing a Project.

image

Configure OpenShift resources using the YAML-based deployables

The openshift server allows you to configure the openshift resources and XL Deploy.

You can configure the YAML based openshift resources using the openshift.ResourcesFile CI. This CI requires the YAML file containing the definition of the openshift resources that will be configured on the openshift server.

Details for the deployment order of the openshift resources through multiple YAML based CI include:

  • You can have separate YAML files for openshift resource.
  • Deployment order and YAML files should be in accordance with the resources dependency.
  • Deployment order across YAML-based CI is managed by Create Order, Modify Order, and Destroy Order.

Use the CI-based deployables to configure OpenShift resources

XL Deploy also provides CIs for k8s resource deployment. For example: k8s.Pod, k8s.Deployment, openshift.Route. These CIs have some advantages over YAML-based CIs in terms of automatic deployment order. For example, you do not need to specify the order, and it also handles asynchronous create and delete operation of resources.