Link Search Menu Expand Document

Deploying Drawio

In this tutorial you will learn how to deploy Drawio (formerly Diagramly) which is a free online diagram software.

Drawio

Prerequirements

  • Playground tools are installed (kubectl & playground)
  • A napptive-kubeconfig file is available
$ playground login
Login success

Deploying the application

Draw.io is a simple application which is composed of a single component. Save the contents of the component and application configuration to two files in your system before proceeding.

010.drawio.component.yaml

apiVersion: core.oam.dev/v1alpha2
kind: Component
metadata:
  name: drawio
spec:
  workload:
    apiVersion: core.oam.dev/v1alpha2
    kind: ContainerizedWorkload
    metadata:
      name: drawio
    spec:
      osType: linux
      containers:
        - name: drawio
          securityContext:
            runAsUser: 1001
          image: jgraph/drawio:14.3.0
          imagePullPolicy: IfNotPresent
          resources:
            cpu:
              required: 150m
            memory:
              required: 256Mi
          ports:
            - name: http
              value: 8080
              containerPort: 8080
              type: tcp
            - name: https
              value: 8443
              containerPort: 8443
              type: tcp

020.drawio.appconfig.yaml

apiVersion: core.oam.dev/v1alpha2
kind: ApplicationConfiguration
metadata:
  name: drawio
  annotations:
    version: 14.3.0
    description: "draw.io (formerly Diagramly) is free online diagram software prueba"
spec:
  components:
    - componentName: drawio
      traits:
        - trait:
            apiVersion: core.napptive.com/v1alpha1
            kind: Ingress
            metadata:
              name: drawio-ingress
            spec:
              name: drawio
              protocol: HTTP
              port: 8080
              path: /
              rewritePath: /

After both files are saved, the simplest way to deploy the application is execute:

$ playground apps deploy <path_to_drawio_files>
c
STATUS     INFO
SUCCESS    application [drawio] deployed

CREATED
core.oam.dev/v1alpha2, Kind=Component "drawio" created
core.oam.dev/v1alpha2, Kind=ApplicationConfiguration "drawio" created

$ playground apps
NAME      STATUS
drawio    APP_OK

On the web interface, you will see the app is now ready, and you can easily explore what is doing and the cluster usage.

Drawio deployed

To connect to the web interface, check the created ingresses:

$ playground app info drawio
NAME      STATUS
drawio    APP_OK

COMPONENT    STATUS    SCOPES    TRAITS
drawio       OK                  drawio-ingress

COMPONENT    INGRESSES
drawio       drawio-<your_username>.apps.playground.napptive.dev

And connect to the ingress listed above.

Other tutorials