Clone GitOps Repository

In this guide you will clone the Arrikto GitOps repository inside your management environment to take full control of your deployment in a reproducible manner.

Arrikto maintains this repository and provides customers with manifests necessary for their enterprise deployment.

Choose one of the following options to clone the Arrikto GitOps repository:

Option 1: Clone GitOps Repository Automatically (preferred)

Clone the Arrikto GitOps repository by following the on-screen instructions on the rok-deploy user interface.

If rok-deploy is not already running, start it with:

root@rok-tools:~# rok-deploy --run-from clone
../../_images/clone.png

Proceed to the Summary section.

Option 2: Clone GitOps Repository Manually

If you want to clone the Arrikto GitOps repository manually, follow the instructions below.

Procedure

  1. Run keychain to start the SSH agent and use your SSH identity:

    root@rok-tools:~# eval "$(keychain --eval id_rsa)" * keychain 2.8.2 ~ http://www.funtoo.org * Starting ssh-agent... * Adding 1 ssh key(s): /root/.ssh/id_rsa * ssh-add: Identities added: /root/.ssh/id_rsa

    Troubleshooting

    can’t find id_rsa

    If the above command shows the following warning message:

    Warning: can't find id_rsa; skipping

    it means that keychain could not find the file ~/.ssh/id_rsa, which normally contains your private SSH key.

    To proceed, follow the Configure Git guide to configure your private SSH key.

  2. Create a new directory and go inside it:

    root@rok-tools:~# mkdir -p ~/ops && cd ~/ops
  3. Clone the GitOps repository:

    root@rok-tools:~/ops# git -c core.sshCommand="ssh -o BatchMode=yes" \ > clone git@github.com:arrikto/deployments Cloning into 'deployments'... ...

    Troubleshooting

    Permission denied

    If the above command fails with the following error message:

    Permission denied (publickey)

    it means that you do not have access to the Arrikto GitOps repository.

    To proceed, follow the Configure Git guide to configure your SSH identity.

    destination path ‘deployments’ already exists

    If the above command fails with the following error message:

    fatal: destination path 'deployments' already exists and is not an empty directory.

    it means that you have already cloned the GitOps repository. You may proceed to the Verify section.

  4. Change your current directory to the GitOps directory:

    root@rok-tools:~/ops# cd deployments
  5. Set appropriate SSH command options for the GitOps repository:

    root@rok-tools:~/ops/deployments# git config core.sshCommand "ssh -o BatchMode=yes"
  6. Checkout the upstream branch:

    root@rok-tools:~/ops/deployments# git checkout release-2.0

    Troubleshooting

    pathspec ‘release-2.0’ did not match any file(s) known to git

    If the above command fails with the following error message:

    error: pathspec 'release-2.0' did not match any file(s) known to git.

    it means that the branch release-2.0 does not exist in your GitOps repository.

    To proceed, fetch the latest updates from the Arrikto remote and re-run this step. You can fetch the latest updates with the following command:

    root@rok-tools:~/ops/deployments# git fetch origin

Verify

  1. Go to your GitOps repository, inside your rok-tools management environment:

    root@rok-tools:~# cd ~/ops/deployments
  2. Verify that the Arrikto remote is origin and it has the correct URL:

    root@rok-tools:~/ops/deployments# git remote -v | grep origin origin git@github.com:arrikto/deployments (fetch) origin git@github.com:arrikto/deployments (push)
  3. Verify you can access the Arrikto remote:

    root@rok-tools:~/ops/deployments# git fetch origin

    Troubleshooting

    Permission denied

    If the above command fails with the following error message:

    Permission denied (publickey)

    ensure that you have run keychain as specified in the Procedure or the Fast-Forward section of this guide.

    If the error persists, it means that you do not have access to the Arrikto GitOps repository. To proceed, follow the Configure Git guide to configure your SSH identity.

  4. Get the current status of your GitOps repository:

    root@rok-tools:~/ops/deployments# git status
    1. Verify the local branch you have checked out is release-2.0.

    2. Verify that the local branch is tracking remote branch origin/release-2.0.

    3. Verify your repository is clean:

      nothing to commit, working tree clean

Summary

You have successfully cloned Arrikto’s GitOps repository inside your management environment.

What’s Next

The next step is to configure the CLI tool for your cloud provider in your management environment.

See also

You can add an internal GitHub repository as an additional Git remote to your clone of the Arritko GitOps repository: