Understand aapctl manifest application order

After you generate manifests, apply them to your cluster using ArgoCD, Flux, or a manual staged process.

Important:

aapctl is a Technology Preview feature. Technology Preview features provide early access to upcoming product innovations, enabling you to test functionality and provide feedback during the development process. Technology Preview features are not fully supported under Red Hat production SLA and may not be functionally complete. Red Hat does not recommend using Technology Preview features in production. For more information, see Technology Preview Features Support Scope in the Additional resources section.

Understand ordering dependencies

In live mode, aapctl waits for each Operator Lifecycle Manager (OLM) operator to become ready before creating resources that depend on it. For example, aapctl waits for the automation orchestrator operator before creating the custom resource.

Running oc apply -f manifests.yaml does not enforce this ordering. If you apply all manifests at once, dependent resources may fail because their operators are not ready yet.

To handle this, apply the manifests in stages:

Table 1. Manifest application stages
Stage Resources Wait condition
1 Namespaces Namespaces exist
2 OperatorGroups and Subscriptions Operators are ready and custom resource definitions (CRDs) are registered
3 Secrets and custom resources Deployment completes

Apply aapctl manifests with ArgoCD

Use ArgoCD sync waves to enforce the stage ordering when you apply aapctl manifests to a cluster.

About this task

Important:

aapctl is a Technology Preview feature. Technology Preview features provide early access to upcoming product innovations, enabling you to test functionality and provide feedback during the development process. Technology Preview features are not fully supported under Red Hat production SLA and may not be functionally complete. Red Hat does not recommend using Technology Preview features in production. For more information on the support scope for Technology Preview features, see Technology Preview Features Support Scope.

Procedure

  1. Generate the manifests.
    $ aapctl install ao --dry-run -o yaml > manifests.yaml
  2. Split the output into separate files by resource kind and add sync-wave annotations to control the apply order.
    # stage-1-namespace.yaml
    apiVersion: v1
    kind: Namespace
    metadata:
      name: automation-orchestrator
      annotations:
        argocd.argoproj.io/sync-wave: "1"
    # stage-2-operatorgroup.yaml
    apiVersion: operators.coreos.com/v1
    kind: OperatorGroup
    metadata:
      name: automation-orchestrator-operator
      namespace: automation-orchestrator
      annotations:
        argocd.argoproj.io/sync-wave: "2"
    # stage-2-subscription.yaml
    apiVersion: operators.coreos.com/v1alpha1
    kind: Subscription
    metadata:
      name: automation-orchestrator-operator
      namespace: automation-orchestrator
      annotations:
        argocd.argoproj.io/sync-wave: "2"
    # stage-3-cr.yaml
    apiVersion: aap.ansible.com/v1alpha1
    kind: AutomationOrchestrator
    metadata:
      name: automation-orchestrator
      namespace: automation-orchestrator
      annotations:
        argocd.argoproj.io/sync-wave: "3"
  3. Commit the annotated manifests to your GitOps repository.
  4. Create an ArgoCD Application that points to the manifest directory.

    ArgoCD applies resources in sync-wave order and waits for each wave to succeed before proceeding.

Apply aapctl manifests manually

If you do not use ArgoCD or Flux, apply the manifests in stages with manual waits between each stage.

About this task

Important:

aapctl is a Technology Preview feature. Technology Preview features provide early access to upcoming product innovations, enabling you to test functionality and provide feedback during the development process. Technology Preview features are not fully supported under Red Hat production SLA and may not be functionally complete. Red Hat does not recommend using Technology Preview features in production. For more information on the support scope for Technology Preview features, see Technology Preview Features Support Scope.

Procedure

  1. Generate the manifests.
    $ aapctl install ao --dry-run -o yaml > manifests.yaml
  2. Split the output into separate files by resource kind.

    Separate the output into stage-1-namespace.yaml (Namespaces), stage-2-operatorgroup.yaml and stage-2-subscription.yaml (Operator Lifecycle Manager resources), and stage-3-cr.yaml (Secrets and custom resources). See Understand aapctl manifest application order for the staging order.

  3. Apply namespaces.
    $ oc apply -f stage-1-namespace.yaml
  4. Apply Operator Lifecycle Manager (OLM) resources and wait for the operator custom resource definition (CRD) to register.
    $ oc apply -f stage-2-operatorgroup.yaml -f stage-2-subscription.yaml
    $ oc wait --for=condition=Established crd/automationorchestrators.aap.ansible.com --timeout=10m
  5. Verify that the operator pod is running.
    $ oc get pods -n automation-orchestrator
  6. Apply the custom resource.
    $ oc apply -f stage-3-cr.yaml
  7. Monitor the deployment.
    $ aapctl status ao