Registering Policies with Your Kubernetes Cluster

Describes how to register policies with a Kubernetes cluster.

Prerequisites

Required access rights: Platform Administrator or Cluster Administrator

About this task

Before you can use a policy, you must register it with your cluster. You can register policies during cluster creation or after the cluster is created. Also, any policies that you want to register with a cluster must first be added to the policy list, as described in Adding a Policy for Centralized Policy Management.

The following procedure assumes that the cluster has already been created.

Procedure

  1. Click the icon to edit the Kubernetes cluster, and navigate to the Application Configurations page.
  2. In the Policy Settings box, click Add Policy or Add Another Policy. A new policy field appears.
    For example:Associate Policy
  3. Specify the desired values for the policy.
    The following table describes each field:
    Field Description
    Policy Displays the policies that have been added to the policy list. Click the drop-down arrow to select the policy that you want to register with the cluster.
    Synchronization Controls the automatic synchronization of policies. Possible values are Auto and Manual. Select Auto to configure the auto-sync feature. If you select Auto, ArgoCD synchronizes the policy with the cluster as soon as the policy is registered with the cluster. If you select Manual, the policy is in ArgoCD, but it is not applied to the cluster.
    Prune Specifies if resources should be pruned during auto-syncing. With Prune specified, if the objects in a policy are deleted from the policy directory, the corresponding objects are deleted from the cluster.
    Reconcile Drift Activates drift detection. Specifies if partial app sync should be executed when resources are changed only in the target Kubernetes cluster and no git change is detected. When the feature is selected and ArgoCD detects a change in the policy, the policy is reverted back to the state before the change.
    Auto Create Namespace Controls the namespace in which the policy objects are created. The default namespace is hpecp. When this box is checked, if the namespace doesn't exist, it is created automatically.
    Namespace Specifies the namespace to be created by the Auto Create Namespace option.
  4. After policies are registered with the cluster, you can use the Policy Viewer link, as described in Logging in to the Argo CD Server.