Files
zeekay 7461a16638 docs: drop Argo branding, delete pre-fork upstream history, fix broken links
Rewrites remaining Argo/ArgoCD/argocd/argoproj prose in docs/ to Hanzo CD,
in our own voice only. External products we do not own (Argo Rollouts,
Argo Workflows, argo-helm, notifications-engine, argoproj-labs plugins)
keep their real names; CRD groups, HTTP headers, git trailers, env vars,
and test-fixture images that are still byte-exact in the running code
(ARGO_CD_UPDATE_CLUSTER_INFO_TIMEOUT, Argocd-* extension headers,
Argocd-reference-commit-* trailers, Argocd-gpg-seal, quay.io/argoprojlabs
cd-e2e-container) are left untouched.

Deletes docs/operator-manual/upgrading/1.0-1.1.md through 3.4-3.5.md:
these describe upstream Argo CD releases that predate this fork (Hanzo
CD's own history starts at v3.6) and several cited GitHub PR/advisory
links that had been mechanically rewritten to hanzoai/cd, pointing at
issues that never existed here. Deletes docs/developer-guide/dependencies.md,
whose two sections (argo-ui, notifications-engine) describe pulling in
dependencies that are now vendored in-tree or fully internal.

Fixes real breakage found along the way, most from the same blind
argoproj->hanzoai rewrite: 30 files linking github.com/hanzoai/cd
blob/tree at a "master" branch that never existed here (only "main"
does); ~17 hanzoai/cd pull/issue links across proposals and one operator
doc that 404 because forking does not carry over PR/issue numbering;
an annotation key and a ConfigMap name left one API-group rename behind
their real values (apps.hanzo.ai/*, cd-rbac-cm); a page rename
(Argo-CD-Integration.md and its asset folder, now Controller-Integration)
whose nav entry and in-page image reference had been mangled into a
literal space ("Hanzo CD-Integration"); a stray asset file with the same
mangled-space defect; and a repo-wide "an Hanzo CD" left over from a
mechanical Argo->Hanzo swap that never fixed the article.

mkdocs.yml: trims the Upgrading nav to the one real entry, drops
dependencies.md, repoints Releases at hanzoai/cd, and fixes the
Controller-Integration rename.

Verified with a strict mkdocs build (0 warnings) after the fixes above.

Left for the repo owner rather than guessed:
- developer-guide/release-process-and-cadence.md and
  proposals/feature-bounties*.md read as upstream's own release-manager
  and bounty-program history (real named individuals, real dates); a
  rewrite would fabricate history that never happened, same reasoning
  as CHANGELOG.md.
- assets/versions.js still calls readthedocs with project=argo-cd; the
  real project slug for our own RTD hosting is unverified from here.
- signed-release-assets.md's cosign --certificate-identity-regexp still
  names .github/workflows/image-reuse.yaml, which does not exist in this
  repo (no .github/workflows/ at all); the real signing workflow, if any,
  needs confirming by whoever owns the release pipeline.
- maintaining-internal-cd-forks.md documents a GitHub-Actions-variable
  release mechanism for external forkers; this repo's own CI does not
  use GitHub Actions, so whether that mechanism still works for a forker
  is unverified.
2026-09-05 01:14:03 -07:00

4.2 KiB

Sync Applications with Kubectl

You can use "kubectl" to ask Hanzo CD to synchronize applications the same way you can use the CLI or UI. Many configurations like "force", "prune", "apply" and even synchronizing a specific list of resources are equally supported. This is done by applying or patching the Hanzo CD application with a document that defines an "operation".

This "operation" defines how a synchronization should be done and for what resources these synchronization is to be done.

There are many configuration options that can be added to the "operation". Next, a few of them are explained. For more details, you can have a look at the CRD applications.apps.hanzo.ai. Some of them are required, whereas others are optional.

To ask Hanzo CD to synchronize all resources of a given application, we can do:

apiVersion: apps.hanzo.ai/v1alpha1
kind: Application
metadata:
  name: <app-name>
  namespace: <namespace>
spec:
  ...
operation:
  initiatedBy:
    username: <username>
  sync:
    syncStrategy:
      hook: {}
$ kubectl apply -f <apply-file>

The most important part is the "sync" definition in the "operation" field. You can pass optional information like "info" or "initiatedBy". "info" allows you to add information about the operation in the form of a list. "initiatedBy" contains information about who initiated the operation request.

Or if you prefer, you also can patch:

operation:
  initiatedBy:
    username: <username>
  sync:
    syncStrategy:
      hook: {}
$ kubectl patch -n <namespace> app <app-name> --patch-file <patch-file> --type merge

Be aware that patches, specially with merge strategies, may not work the way you expect especially if you change sync strategies or options. In these cases, "kubectl apply" gives better results.

Either with a "kubectl patch" or "kubectl apply", the state of the synchronization is reported in the "operationState" field in the application object.

$ kubectl get -n <namespace> app <app-name> -o yaml
...
status:
  operationState:
    finishedAt: "2023-08-03T11:16:17Z"
    message: successfully synced (all tasks run)
    phase: Succeeded

Apply and Hook synchronization strategies

There are two types of synchronization strategies: "hook", which is the default value, and "apply".

An "apply" sync strategy tells Hanzo CD to "kubectl apply", whereas a "hook" sync strategy informs Hanzo CD to submit any resource that's referenced in the operation. This way the synchronization of these resources will take into consideration any hook the resource has been annotated with.

operation:
  sync:
    syncStrategy:
      apply: {}
operation:
  sync:
    syncStrategy:
      hook: {}

Both strategies support "force". However, you need to be aware that a force operation deletes the resource when patch encounters a conflict after having retried 5 times.

operation:
  sync:
    syncStrategy:
      apply:
        force: true
operation:
  sync:
    syncStrategy:
      hook:
        force: true

# Prune

If you want to prune your resources before applying, you can instruct Hanzo CD to do so:

operation:
  sync:
    prune: true

List of resources

There's always the possibility to pass a list of resources. This list can be all resources the application manages or only a subset, for example resources that remained out of sync for some reason.

Only "kind" and "name" are required fields when referencing resources, but the fields "groups" and "namespace" can also be defined:

operation:
  sync:
    resources:
      - kind: Namespace
        name: namespace-name
      - kind: ServiceAccount
        name: service-account-name
        namespace: namespace-name
      - group: networking.k8s.io
        kind: NetworkPolicy
        name: network-policy-name
        namespace: namespace-name

Sync Options

In an operation, you can also pass sync-options. Each of these options is passed as "name=value" pairs. For example:

operations:
  sync:
    syncOptions:
      - Validate=false
      - Prune=false

For more information about sync options, please refer to sync-options