Skip to Content
Technical Articles
Author's profile photo Yordan Pavlov

How to deploy Eclipse Dirigible in the SAP Cloud Platform Kyma environment

Overview


Eclipse Dirigible is an open-source cloud development platform that provides capabilities for end-to-end development processes from database modeling and management, through RESTful services using server-side JavaScript, to pattern-based user interface generation, role-based security, external services integration, testing, debugging, operations and monitoring.

Some of the unique features include:

The platform aims to unify open-source business services by providing software developers with a convenient set of tools for building, running, and operating business applications in the Cloud. Dirigible is also part of the Eclipse Cloud Development top-level project.

Setup


Starting with the Eclipse Dirigible 5.0 release (and more specifically with the 5.3 version), there is a built-in integration with the SAP Cloud Platform Kyma environment. To deploy Eclipse Dirigible in your Kyma cluster, follow these steps:

(Kyma Environment)

  • Once enabled, log in to the Kyma dashboard.
  • Copy and save (e.g. dirigible-kyma.yaml) on your desktop the following YAML definition:
    • Deployment – creates a Kubernetes Deployment controller
    • Service – creates a Kubernetes Service network
    • dirigiblelabs/dirigible-sap-kyma – the Kyma tailored Dirigible docker image
    • DIRIGIBLE_THEME_DEFAULT – an environment variable for the Dirigible theming (e.g. “fiori”)
      apiVersion: apps/v1
      kind: Deployment
      metadata:
        name: dirigible
        namespace: default
      spec:
        replicas: 1
        selector:
          matchLabels:
            app: dirigible
        template:
          metadata:
            labels:
              app: dirigible
          spec:
            containers:
              - name: dirigible
                image: dirigiblelabs/dirigible-sap-kyma:latest
                ports:
                  - containerPort: 8080
                    name: dirigible
                env:
                  - name: DIRIGIBLE_THEME_DEFAULT
                    value: "fiori"
      ---
      apiVersion: v1
      kind: Service
      metadata:
        name: dirigible
        namespace: default
        labels:
          app: dirigible
      spec:
        ports:
        - port: 8080
          name: dirigible
        selector:
          app: dirigible

(Dirigible Deployment Descriptor – e.g. dirigible-kyma.yaml)

  • Go to the default namespace:

    (Kyma Dashboard)

  • Click the Deploy new resource button:

(Kyma Deploy New Resource)

  • Provide the saved YAML definition (e.g. dirigible-kyma.yaml).
  • Once deployed, the Workloads chart will update to 1/1 Deployments and 1/1 Pods.

(Kyma Workloads)

  • Go to Discovery and Network -> API Rules.
  • Click on the Create API Rule button.
    • Provide a value for the API Rule Name (e.g. dirigible).
    • Provide a value for the API Rule Hostname (e.g. dirigible).
    • Select dirigible (port: 8080) service from the API Rule Service dropdown.
    • Leave the default access strategy.
    • Click the Create button.

(Kyma Create API Rule)

  • Copy the newly created API Rule Host and save it for later:

(Kyma API Rules)

  • Go to the Service Management -> Catalog section.
  • Search for the Authorization & Trust Management service.

(Kyma Service Catalog)

  • Create a new service instance:
    • Provide a value for the service instance Name (e.g. xsuaa-dirigible).
    • Set the service instance Plan to application.
    • Provide additional parameters as a JSON:
      {
         "xsappname": "dirigible-xsuaa",
         "oauth2-configuration": {
            "token-validity": 7200,
            "redirect-uris": [
               "https://<api-rule-hostname>.<cluster-id>.<kyma-region>.k8s-hana.ondemand.com"
            ]
         },
         "scopes": [
            {
               "name": "$XSAPPNAME.Developer",
               "description": "Developer scope"
            },
            {
               "name": "$XSAPPNAME.Operator",
               "description": "Operator scope"
            }
         ],
         "role-templates": [
            {
               "name": "Developer",
               "description": "Developer related roles",
               "scope-references": [
                  "$XSAPPNAME.Developer"
               ]
            },
            {
               "name": "Operator",
               "description": "Operator related roles",
               "scope-references": [
                  "$XSAPPNAME.Operator"
               ]
            }
         ],
         "role-collections": [
            {
               "name": "dirigible",
               "description": "Dirigible Developer",
               "role-template-references": [ 
                  "$XSAPPNAME.Developer",
                  "$XSAPPNAME.Operator"
               ]
            }
         ]	
      }

(Authorization & Trust Management Service Instance Additional Parameters)

    • For more information about the XSUAA configurations go here.
    • NOTE: It’s important to replace the redirect-uris value with the previously created API Rule Host (e.g. https://dirigible.c-71b4221.kyma.shoot.live.k8s-hana.ondemand.com)

(Authorization & Trust Management Service Instance Additional Parameters)

  • Once the service instance is in Running status, it’s time to bind it to the Dirigible application.
  • Click on the Bind Application button and select the Dirigible deployment (e.g. dirigible) form the dropdown:

(Authorization & Trust Management Service Application Binding)

  • We are almost ready to run Dirigible on Kyma. The last step is to provide one additional environment variable to the Dirigible Deployment:
    • Navigate to the Workloads -> Deployments section.
    • Edit the Dirigible deployment (e.g. dirigible).
    • Find the DIRIGIBLE_THEME_DEFAULT environment variable and add a new one:
      {
          "name": "DIRIGIBLE_HOST",
          "value": "https://<api-rule-hostname>.<cluster-id>.<kyma-region>.k8s-hana.ondemand.com"
      }​

       

    • NOTE: It’s important to replace the DIRIGIBLE_HOST value with the previously created API Rule Host (e.g. https://dirigible.c-71b4221.kyma.shoot.live.k8s-hana.ondemand.com)

(Dirigible Deployment Environment Variables)

  • Last but not least, we need to assign the required roles:
    • Go back to the SAP Cloud Platform cockpit and go to Security -> Trust Configuration.
    • Then, select the sap.default trust configuration:
    • Search for your username (your email) and assign the dirigible role collection:

 

  • To access the Eclipse Dirigible instance, go to Configuration -> API Rules, and open the Dirigible URL (e.g. https://dirigible.<cluster-id>.<kyma-region>.k8s-hana.ondemand.com).
  • Once started, you can begin developing your next business application with Eclipse Dirigible:

 

Notes


Next, you can visit the Samples section to master some of the basic Eclipse Dirigible functionalities, explore the Enterprise JavaScript APIs, check out the YouTube channel for video content, or simply visit the official site for news and updates.

Assigned Tags

      Be the first to leave a comment
      You must be Logged on to comment or reply to a post.