Last modified November 27, 2024

The 'kubectl gs gitops' command family reference

The gitops command family provides operations to set up a GitOps repository as required to manage Giant Swarm infrastructure, as well as add and modify resources in this repository.

It implements the same basic operations the gitops-template repository supports and respects the recommended GitOps structure.

Important remarks

  • The subcommands are expected to run against a local clone of the GitOps repository and does not go beyond creating requested files and directories. Hence, all git-related operations, like cloning or pushing, must be performed by the user prior to or after the plugin execution.

  • The commands provide a dry-run mode, to preview the changes that will be applied to the repository. Add the --dry-run flag to activate this mode.

  • The commands will not overwrite already existing files to prevent overriding users, or other commands, changes. It is often that one command creates a file with an initial content, and some other command updates it with content important to its context. Without preventing re-creation, running the first command again would result in restoring the original content and possibly damaging the user environment, by for example accidental removal of resources.

  • The above also implies that these commands cannot be used for modifications of resources. This means that if you first run a command with limited set of flags, and later re-run it with a new set of flags, the outcome of the first command will not be replaced. You will either have to make the required changes manually, or remove the directory and then re-run the command. Note: this behavior may change in a future release of kubectl-gs.

Usage

The normal assumption is that commands are executed from the root folder of the GitOps repository. This behavior can be modified using the --local-path PATH_TO_ROOT flag.

The general syntax is kubectl gs gitops SUBCOMMAND [FLAGS].

Refer to the subcommand documentation for details.

Subcommands

CommandDescription
initSet up a GitOps repository with its basic structure
add management-clusterAdd a new management cluster to the GitOps repository
add organizationAdd a new organization to the GitOps repository
add workload-clusterAdd a new workload cluster to the GitOps repository
add appAdd a new app to the GitOps repository
add automatic-updateEnable automatic updates for an app
add encryptionAdd a new GPG key pair to the SOPS repository configuration
add baseAdd a new base to create workload clusters for different providers

This part of our documentation refers to our vintage product. The content may be not valid anymore for our current product. Please check our new documentation hub for the latest state of our docs.