Sync Configuration
  • 21 Mar 2024
  • 1 Minute to read
  • Contributors
  • Dark
    Light
  • PDF

Sync Configuration

  • Dark
    Light
  • PDF

Article summary

In addition to interactive use, the CLI supports a continuous sync mode for performing GitOps using the sync subcommand. To learn more about the Greymatter GitOps pipeline, read this article.

The CLI in sync mode is usually referred to simply as ‘Sync’ or the ‘Sync service’. Sync evaluates GSL configurations stored in a remote Git repository and applies them to the mesh. On an error, Sync will log the problem and continue to watch the repository for an eventual fix.

Empty Commits

Sometimes you need to re-trigger the GitOps pipeline without submitting another change. To do so, use an empty Git commit:

git commit --allow-empty && git push

Non-Fast Forward Updates

Non-Fast Forward updates refer to Git updates where the history has been disturbed such that a local Git tree is incompatible with the remote one (or vice versa). Although this is a feature of Git, it typically should be avoided when engaging in collaborative and GitOps work as it destroys the record of events. Sync will refuse these updates and must be restarted if they occur.

Command

Environment Variable

Description

-P, --git-password=""

GREYMATTER_GIT_PASSWORD

Password for cloning over HTTP.

-R, --git-remote=””

Required

GREYMATTER_GIT_REMOTE

URL of the Git remote repository to clone, for example, git@github.com:your-org/tenat-project.

--git-remote-ca=””

GREYMATTER_GIT_REMOTE_CA

Path to a CA certificate bundle used to validate the remote Git repository

--git-tls-skip-verify

GREYMATTER_GIT_TLS_SKIP_VERIFY

If present, Sync will skip the verification of the remote Git repository’s certificate.

-U, --git-user=""

GREYMATTER_GIT_USER

Username for Git authentication over HTTP

--redis-addr=””

Required

GREYMATTER_REDIS_ADDR

Network address of the Greymatter Redis Datastore. Must include the port. Typically: "greymatter-datastore.greymatter.svc.cluster.local:6379"

--redis-db=0

GREYMATTER_REDIS_DB

Database selector to use for storing Sync state.

--redis-passphrase=””

GREYMATTER_REDIS_PASSWORD

Password to use for a protected datastore instance.

--redis-username=””

GREYMATTER_REDIS_USERNAME

Username to use for a protected datastore instance.

--relative-path=””

GREYMATTER_RELATIVE_PATH

Path relative to the root of the repository that contains a GSL project. Use when the GSL project root is not the root of the repository.

--ssh-passphrase=””

GREYMATTER_SSH_PASSPHRASE

The password to decrypt a password-protected SSH private key.

--ssh-private-key=""

GREYMATTER_SSH_PRIVATE_KEY

Path to the SSH private key used for Git authentication (if using SSH-based authentication).


Was this article helpful?