Here are the steps to use Flux CD for GitOps on Kubernetes:
- Install Flux CLI: Use the command
brew install fluxcd/tap/fluxto install. - Display Flux CLI version: Use the command
flux versionto display Flux CLI version information. - Create a Git repository on GitHub.
- Set the GITHUB_TOKEN environment variable.
- Use the command
flux bootstrap githubto install Flux CD into the Kubernetes cluster. In the command, specify the GitHub username and repository name, read/write key, branch, and the components to use (including image-reflector-controller and image-automation-controller). - Wait for the Flux CD Pod to start and complete initialization.
Note that only with the --components-extra=image-reflector-controller,image-automation-controller parameter can you create pods related to images.