Ninja Docs Help

Bootstrap

Revision

Date

Description

1.0

24.07.2024

Init Changelog

Introduction

This article explains how to bootstrap FluxCD on Kubernetes Cluster with Gitlab as source of code.

Instructions

To bootstrap FluxCD on cluster with Gitlab, follow steps below:

  1. Install FluxCD CLI:

    1. Homebrew

    brew install fluxcd/tap/flux
    1. Bash

    curl -s https://fluxcd.io/install.sh | sudo bash
  2. Create Gitlab repository for your code.

  3. Create Personal Access Token with API access on GItlab (you can use own PAT or create technical user - if it already exists, check for PAT in 1Password Vault).

  4. Export PAT into your shell env:

export GITLAB_TOKEN=<pat>
  1. Export PAT into your shell env:

kubectx <context>
  1. Run bootstrap command (adjust to your preferences - look at table below instructions):

flux bootstrap gitlab \ --hostname=<host> \ --owner=<group> \ --repository=<project> \ --path=<path> \ --branch=<branch> \ --token-auth \ --author-email=<commit_author_mail> \ --author-name=<commit_author_name> \ --components-extra=image-reflector-controller,image-automation-controller

Available configuration

Flag

Description

Default value

--deploy-token-auth

When enabled, a Project Deploy Token is generated and will be used instead of the SSH deploy token.

--hostname string

GitLab hostname.

gitlab.com

--interval duration

Sync interval.

1m0s

--owner string

GitLab user or group name.

--path safeRelativePath

Path relative to the repository root, when specified the cluster sync will be scoped to this path.

./

--personal

If true, the owner is assumed to be a GitLab user; otherwise a group.

--private

If true, the repository is setup or configured as private.

true

--read-write-key

If true, the deploy key is configured with read/write permissions.

--reconcile

If true, the configured options are also reconciled if the repository already exists.

--repository

GitLab repository name.

--team strings

GitLab teams to be given maintainer access (also accepts comma-separated values).

Last modified: 17 February 2025