Skip to main content
Skip table of contents

Deploy Project Platform Applications

Deploy applications to attached clusters in a project using the CLI

This topic describes how to use the CLI to deploy an application to attached clusters within a project. To use the DKP UI to deploy applications, see Deploy Applications in a Project.

See Project Platform Applications for a list of all applications and those that are enabled by default.

Prerequisites

Before you begin, you must have:

Set the WORKSPACE_NAME environment variable to the name of the workspace where the cluster is attached:

CODE
export WORKSPACE_NAME=<workspace_name>

Set the WORKSPACE_NAMESPACE environment variable to the namespace of the above workspace:

CODE
export WORKSPACE_NAMESPACE=$(kubectl get namespace --selector='workspaces.kommander.mesosphere.io/workspace-name=${WORKSPACE_NAME}' -o jsonpath='{.items[0].metadata.name}')

Set the PROJECT_NAME environment variable to the name of the project in which the cluster is included:

CODE
export PROJECT_NAME=<project_name>

Set the PROJECT_NAMESPACE environment variable to the name of the above project's namespace:

CODE
export PROJECT_NAMESPACE=$(kubectl get project ${PROJECT_NAME} -n ${WORKSPACE_NAMESPACE} -o jsonpath='{.status.namespaceRef.name}')

Deploy the Application

The list of available applications that can be deployed on the attached clusters in a project can be found in the project platform applications topic.

  1. Deploy one of the supported applications to your existing attached cluster with an AppDeployment resource. Provide the appRef and application version to specify which App is deployed:

    CODE
    dkp create appdeployment project-grafana-logging --app project-grafana-logging-6.38.1 --workspace ${WORKSPACE_NAME} --project ${PROJECT_NAME}
  2. Create the resource in the project you just created, which instructs Kommander to deploy the AppDeployment to the KommanderClusters in the same project.

  • The appRef.name must match the app name from the list of available applications.

  • Observe that the dkp create command must be run with both the --workspace and --project flags for project platform applications.

Deploy an Application with a Custom Configuration

Follow these steps:

  1. Create the AppDeployment and provide the name of a ConfigMap, which provides custom configuration on top of the default configuration:

    CODE
    dkp create appdeployment project-grafana-logging --app project-grafana-logging-6.38.1 --config-overrides project-grafana-logging-overrides --workspace ${WORKSPACE_NAME} --project ${PROJECT_NAME}
  2. Create the ConfigMap with the name provided in the step above, with the custom configuration:

    CODE
    cat <<EOF | kubectl apply -f -
    apiVersion: v1
    kind: ConfigMap
    metadata:
      namespace: ${PROJECT_NAMESPACE}
      name: project-grafana-logging-overrides
    data:
      values.yaml: |
        datasources:
          datasources.yaml:
            apiVersion: 1
            datasources:
            - name: Loki
              type: loki
              url: "http://project-grafana-loki-loki-distributed-gateway"
              access: proxy
              isDefault: false
    EOF

Kommander waits for the ConfigMap to be present before deploying the AppDeployment to the attached clusters.

Verify Applications

The applications are now enabled. Connect to the attached cluster and check the HelmReleases to verify the deployment:

CODE
kubectl get helmreleases -n ${PROJECT_NAMESPACE}
NAMESPACE               NAME                        READY   STATUS                             AGE
project-test-vjsfq      project-grafana-logging     True    Release reconciliation succeeded   7m3s

Some of the supported applications have dependencies on other applications. See Project Application Dependencies for that table.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.