Use AppDeployments to deploy, and customize platform, DKP catalog, and custom applications in your environment

An AppDeployment is a Custom Resource created by DKP with the purpose of deploying applications (platform, DKP catalog and custom applications) in the management cluster, managed clusters, or both. Customers of both Essential and Enterprise products use AppDeployments, regardless of their setup (networked, air-gapped, etc.), and their infrastructure provider.

When installing DKP, an AppDeployment resource is created for each enabled Platform Application. This AppDeployment resource references a ClusterApp, which then references the repository that contains a concrete declarative and preconfigured setup of an application, usually in the form of a HelmRelease. ClusterApps are cluster-scoped so that these platform applications are deployable to all workspaces or projects.

In the case of DKP catalog and custom applications, the AppDeployment references an App instead of a ClusterApp, which also references the repository containing the installation and deployment information. Apps are namespace-scoped and are meant to only be deployable to the workspace or project in which they have been created.

For example, this is the default AppDeployment for the Kube Prometheus Stack platform application:

apiVersion: apps.kommander.d2iq.io/v1alpha3
kind: AppDeployment
metadata:
  name: kube-prometheus-stack
  namespace: ${WORKSPACE_NAMESPACE}
spec:
  appRef:
    name: kube-prometheus-stack-40.0.0
    kind: ClusterApp
CODE

Customization

Prerequisites

Set the WORKSPACE_NAMESPACE environment variable to the name of the workspace’s namespace where the cluster is attached:

export WORKSPACE_NAMESPACE=<your_workspace_namespace>
CODE

You are now able to copy the following commands without having to replace the placeholder with your workspace namespace every time you run a command.

Customize Your Application

If you want to customize an application, or change how a specific app is deployed, you can create a ConfigMap to change or add values to the information that is stored in the HelmRelease. Override the default configuration of an application by setting the configOverrides field on the AppDeployment to that ConfigMap. This overrides the configuration of the app for all clusters within the workspace.

For workspace applications, you can also enable and customize them on a per-cluster basis. Refer to the cluster-scoped configuration page for instructions on how to enable and customize an application per cluster in a given workspace.

This is an example, of how to customize the AppDeployment of Kube Prometheus Stack:

  1. Provide the name of a ConfigMap with the custom configuration in the AppDeployment:

    cat <<EOF | kubectl apply -f -
    apiVersion: apps.kommander.d2iq.io/v1alpha3
    kind: AppDeployment
    metadata:
      name: kube-prometheus-stack
      namespace: ${WORKSPACE_NAMESPACE}
    spec:
      appRef:
        name: kube-prometheus-stack-40.0.0
        kind: ClusterApp
      configOverrides:
        name: kube-prometheus-stack-overrides-attached
    EOF
    CODE
  2. Create the ConfigMap with the name provided in the previous step, which provides the custom configuration on top of the default configuration:

    cat <<EOF | kubectl apply -f -
    apiVersion: v1
    kind: ConfigMap
    metadata:
      namespace: ${WORKSPACE_NAMESPACE}
      name: kube-prometheus-stack-overrides-attached
    data:
      values.yaml: |
        prometheus:
          prometheusSpec:
            storageSpec:
              volumeClaimTemplate:
                spec:
                  resources:
                    requests:
                      storage: 150Gi
    EOF
    CODE

Print and Review the Current State of an AppDeployment Resource

If you want to know how the AppDeployment resource is currently configured, use the commands below to print a table of the declared information. If the AppDeployment is configured for several clusters in a workspace, a column will display a list of the clusters.

Review all AppDeployments in a workspace

To review the state of the AppDeployment resource for a specific workspace, run the get command with the name of your workspace, as in this example:

dkp get appdeployments -w kommander-workspace
CODE

The output should contain a list of all your applications, here is an example:

NAME APP CLUSTERS
[...]
kube-oidc-proxy                 kube-oidc-proxy-0.3.2           host-cluster
kube-prometheus-stack           kube-prometheus-stack-40.0.0    host-cluster
kubecost                        kubecost-0.28.0                 host-cluster
[...]
CODE

Review a specific AppDeployment of an application in a workspace

To review the state of a specific AppDeployment of an application, run the get command with the name of the application and your workspace, as in this example:

dkp get appdeployment kube-prometheus-stack -w kommander-workspace
CODE

The output should look similar to this:

NAME APP CLUSTERS
kube-prometheus-stack kube-prometheus-stack-40.0.0 host-cluster
CODE

Deployment Scope

In a single-cluster environment with an Essential license, AppDeployments enable customizing any platform application.

In a multi-cluster environment with an Enterprise license, AppDeployments enable workspace-level, project-level, and per-cluster deployment and customization of workspace applications.

More Information

Refer to the CLI documentation for more information on how to create, or get an AppDeployment.