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
Need help, got feedback?
We listen to your Slack support channel. You can also reach us at support@giantswarm.io. And of course, we welcome your pull requests!