This topic describes how to use the CLI to deploy an application to attached clusters within a workspace. To use the Kommander UI to deploy applications, see Customize a workspace’s platform applications.
See Workspace 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.
- An existing Kubernetes cluster attached to Kommander.
Set the WORKSPACE_NAMESPACE
environment variable to the name of the workspace’s namespace where the cluster is attached:
export WORKSPACE_NAMESPACE=<workspace_namespace>
Deploy the application
The list of available applications that can be deployed on the attached cluster can be found in this topic.
-
Deploy a supported application to your existing attached cluster with an
AppDeployment
resource. -
Within the
AppDeployment
, define theappRef
to specify whichApp
will be deployed:cat <<EOF | kubectl apply -f - apiVersion: apps.kommander.d2iq.io/v1alpha1 kind: AppDeployment metadata: name: cert-manager-0.2.7 namespace: ${WORKSPACE_NAMESPACE} spec: appRef: name: cert-manager-0.2.7 EOF
-
Create the resource in the workspace you just created, which instructs Kommander to deploy the
AppDeployment
to theKommanderCluster
s in the same workspace.
Deploy an application with a custom configuration
-
Provide the name of a
ConfigMap
in theAppDeployment
, which provides custom configuration on top of the default configuration:cat <<EOF | kubectl apply -f - apiVersion: apps.kommander.d2iq.io/v1alpha1 kind: AppDeployment metadata: name: metallb-0.12.2 namespace: ${WORKSPACE_NAMESPACE} spec: appRef: name: metallb-0.12.2 configOverrides: name: metallb-overrides-attached EOF
-
Create the
ConfigMap
with the name provided in the step above, with the custom configuration:cat <<EOF | kubectl apply -f - apiVersion: v1 kind: ConfigMap metadata: namespace: ${WORKSPACE_NAMESPACE} name: metallb-overrides-attached data: values.yaml: | configInline: address-pools: - name: default protocol: layer2 addresses: - 172.17.255.150-172.17.255.199 EOF
Kommander waits for the ConfigMap
to be present before deploying the AppDeployment
to the attached clusters.
Verify applications
The applications are now deployed. Connect to the attached cluster and check the HelmReleases
to verify the deployment:
kubectl get helmreleases -n ${WORKSPACE_NAMESPACE}
NAMESPACE NAME READY STATUS AGE
workspace-test-vjsfq metallb True Release reconciliation succeeded 7m3s