Skip to main content
Skip table of contents

Enable an Application per Cluster

These pages refer to DKP Enterprise and DKP Gov Advanced products.

Prerequisites

Ensure you have reviewed the prerequisites section.

Enable an Application per Cluster for the First Time

When you enable an application on a workspace, it is deployed to all clusters in the workspace by default. If you would like to only deploy it to a subset of clusters when enabling it on a workspace for the first time, you can follow the steps below:

  1. Create an AppDeployment for your application, selecting a subset of clusters within the workspace to enable it on. You can use the dkp get clusters --workspace ${WORKSPACE_NAME} command to see the list of clusters in the workspace.
    (info) The following snippet is an example. Replace the application name, version, workspace name and cluster names according to your requirements. See Components and Applications for compatible versions.

    BASH
    dkp create appdeployment kube-prometheus-stack --app kube-prometheus-stack-46.8.1 --workspace ${WORKSPACE_NAME} --clusters attached-cluster1,attached-cluster2
  2. Optional: Check the current status of the AppDeployment to see the names of the clusters where the application is currently enabled.

Enable or Disable an Application per Cluster after it has been enabled at the workspace level

You can enable or disable applications at any time. After you have enabled the application at the workspace level, the spec.clusterSelector field populates.

For clusters that are newly attached into the workspace, all applications enabled for the workspace are automatically enabled on and deployed to the new clusters.

If you want to see on what clusters your application is currently deployed, refer to the Print and Review the Current State of your AppDeployment documentation.

  1. Edit the AppDeployment YAML by adding or removing the names of the clusters where you want to enable your application in the clusterSelector section:

    (info) The following snippet is an example. Replace the application name, version, workspace name and cluster names according to your requirements. See Components and Applications for the compatible versions.

    YAML
    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-46.8.1
        kind: ClusterApp
      clusterSelector:
        matchExpressions:
        - key: kommander.d2iq.io/cluster-name
          operator: In
          values:
          - attached-cluster1
          - attached-cluster3-new
    EOF

Verify the Current Configuration of your Application

Refer to the Verify applications help to connect to the managed or attached cluster and check the status of the deployments. 

If you want to know how the AppDeployment resource is currently configured, refer to the Print and review the state of your AppDeployment section.

JavaScript errors detected

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

If this problem persists, please contact our support.