Skip to main content
Skip table of contents

Disable a Custom Configuration of an Application for a Cluster

Enabled customizations are defined in a ConfigMap, which, in turn, is referenced in the spec.clusterConfigOverrides object of your AppDeployment.

  1. Review your current configuration to establish what you want to remove:

    BASH
    kubectl get appdeployment -n ${WORKSPACE_NAMESPACE} kube-prometheus-stack -o yaml

    The output looks similar to this:

    YAML
    apiVersion: apps.kommander.d2iq.io/v1alpha3
    kind: AppDeployment
    metadata:
      name: kube-prometheus-stack
      namespace: ${WORKSPACE_NAMESPACE}
    spec:
      appRef:
        name: kube-prometheus-stack-44.2.1
        kind: ClusterApp
      configOverrides:
        name: kube-prometheus-stack-overrides-attached
      clusterSelector:
        matchExpressions:
        - key: kommander.d2iq.io/cluster-name
          operator: In
          values:
          - attached-cluster1
          - attached-cluster2
      clusterConfigOverrides:
        - configMapName: kps-cluster1-overrides
          clusterSelector:
            matchExpressions:
            - key: kommander.d2iq.io/cluster-name
              operator: In
              values:
              - attached-cluster1
        - configMapName: kps-cluster2-overrides
          clusterSelector:
            matchExpressions:
            - key: kommander.d2iq.io/cluster-name
              operator: In
              values:
              - attached-cluster2

    Here you can see that kube-prometheus-stack has been enabled for the attached-cluster1 and attached-cluster2. There is also a custom configuration for each of the clusters: kps-cluster1-overrides and kps-cluster2-overrides.

  2. Edit the file by deleting the configMapName entry of the cluster for which you would like to delete the customization. This is located under the clusterConfigOverrides:

    YAML
    cat <<EOF | kubectl apply -f -
    apiVersion: apps.kommander.d2iq.io/v1alpha3
    kind: AppDeployment
    metadata:
      name: kube-prometheus-stack
      namespace: ${WORKSPACE_NAMESPACE}
    spec:
      appRef:
        kind: ClusterApp
        name: kube-prometheus-stack-44.2.1
      configOverrides:
        name: kube-prometheus-stack-ws-overrides
      clusterSelector:
        matchExpressions:
          - key: kommander.d2iq.io/cluster-name
            operator: In
            values:
            - attached-cluster1
      clusterConfigOverrides:
        - configMapName: kps-cluster1-overrides
          clusterSelector:
            matchExpressions:
            - key: kommander.d2iq.io/cluster-name
              operator: In
              values:
              - attached-cluster1
    EOF

    Compare steps one and two for a reference of how an entry should be deleted.

  3. Before deleting a ConfigMap that contains your customization, ensure you will NOT require it at a later time. It is not possible to restore a deleted ConfigMap.
    If you choose to delete it, run:

BASH
kubectl delete configmap <name_configmap> -n ${WORKSPACE_NAMESPACE} 

It is NOT possible to delete a ConfigMap that is being actively used and referenced in the configOverride of any AppDeployment.

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.