Applications Deployment in a Workspace
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
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-46.8.0 host-cluster
kubecost kubecost-0.35.1 host-cluster
[...]
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
The output should look similar to this:
NAME APP CLUSTERS
kube-prometheus-stack kube-prometheus-stack-46.8.0 host-cluster
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.
Use Case Example
As a user, I have multiple clusters in a Workspace. I want to enable an application into some, but not all clusters in that workspace. I also want to enable a custom configuration.
To define which cluster should have an Application deployed onto them, use the AppDeployment’s spec.clusterSelector field.
The user can edit the AppDeployment at any time to add or remove clusters from the spec.
Enable Workspace Applications for a subset of clusters and custom configurations for each cluster:
Create an AppDeployment using
dkp create appdeploymentto enable and disable clusters, and set cluster config overrides per cluster:CODEdkp create appdeploymentUse the code editor to directly edit the AppDeployment spec to:
Enable or disable clusters
Add or remove cluster config overrides for clusters
CODEdkp edit appdeployment APPDEPLOYMENT_NAME -n NAMESPACEEX:
dkp edit appdeployment kube-oidc-proxy -n kommander
NAMESPACE is the namespace in which the AppDeployment resides - this can be a Workspace or a Project Namespace. To list all available workspace namespaces, run kubectl get workspaces.
TROUBLESHOOT: For up-to-date status on which clusters an application has been enabled, or what configuration overrides have been applied to each cluster, check the AppDeployment status:
CODEdkp get appdeploymentUse to get the entire YAML object, including cluster config overrides that might be set on a cluster - similar to
kubectl get appdeployment.CODEdkp get appdeployment --output yamlExample Output:
CODEapiversion: apps.kommander.d2iq.io/v1alpha3 kind: AppDeployment metadata: generation: 1 # this means there is only one instance of the application, must match with the number of instances you expect to see name: kube-oidc-proxy # APP ID of the application as displayed in the Release Notes namespace: kommander # equal to the workspace namespace of the workspace where the app is deployed spec: appRef: kind: ClusterApp name: kube-oidc-proxy-0.3.2 # APP ID with the app version as displayed in the Release Notes clusterConfigOverrides: # present only for apps with custom configurations - clusterSelector: # present only for workspaces with several clusters matchLabels: kommander.d2iq.io/cluster-name: host-cluster # cluster name where app is deployed configMapName: kube-oidc-proxy-host-cluster # name of the ConfigMap file that contains the Overrides with the custom configuration for this specific cluster clusterSelector: matchExpressions: - key: kommander.d2iq.io/cluster-name operator: In values: - host-cluster # cluster name where app is deployed status: clusters: - clusterConfigOverridesRef: name: kube-oidc-proxy-host-cluster # name of the ConfigMap file that contains the Overrides with the custom configuration for this specific cluster conditions: - status: "True" # must be True for app to be deployed successfully type: AppDeploymentEnabled name: host-cluster observedGeneration: 1
Verify Applications
The applications are now enabled. Connect to the attached cluster and check the HelmReleases to verify the deployment:
kubectl get helmreleases -n ${WORKSPACE_NAMESPACE}
The output looks similar to this:
NAMESPACE NAME READY STATUS AGE
workspace-test-vjsfq kafka-operator True Release reconciliation succeeded 7m3s