Project Platform Application Deployment
![](../../__attachments/89360826/Enterprise_50%25.png?inst-v=fbc98f0a-f9ae-4d4c-828f-dc0defe966ca)
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:
A running cluster with Kommander installed.
Set the WORKSPACE_NAME
environment variable to the name of the workspace where the cluster is attached:
export WORKSPACE_NAME=<workspace_name>
Set the WORKSPACE_NAMESPACE
environment variable to the namespace of the above workspace:
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:
export PROJECT_NAME=<project_name>
Set the PROJECT_NAMESPACE
environment variable to the name of the above project's namespace:
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.
Deploy one of the supported applications to your existing attached cluster with an
AppDeployment
resource. Provide theappRef
and application version to specify whichApp
is deployed:CODEdkp create appdeployment project-grafana-logging --app project-grafana-logging-6.28.0 --workspace ${WORKSPACE_NAME} --project ${PROJECT_NAME}
Create the resource in the project you just created, which instructs Kommander to deploy the
AppDeployment
to theKommanderClusters
in the same project.
The
appRef.name
must match the appname
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:
Create the
AppDeployment
and provide the name of aConfigMap
, which provides custom configuration on top of the default configuration:CODEdkp create appdeployment project-grafana-logging --app project-grafana-logging-6.28.0 --config-overrides project-grafana-logging-overrides --workspace ${WORKSPACE_NAME} --project ${PROJECT_NAME}
Create the
ConfigMap
with the name provided in the step above, with the custom configuration:CODEcat <<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:
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.