Skip to main content
Skip table of contents

Enable an Application per Cluster

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.

    BASH
    dkp create appdeployment kube-prometheus-stack --app kube-prometheus-stack-34.9.3 --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. Once you have enabled the application at the workspace level, the spec.clusterSelector field will be populated.

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 which 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:

    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-34.9.3
        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.