Skip to content

Commit 326c5a9

Browse files
committed
added flux2
1 parent 149c781 commit 326c5a9

File tree

129 files changed

+2425
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

129 files changed

+2425
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
package cmd
2+
3+
import (
4+
"github.com/rsteube/carapace"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
var bootstrapCmd = &cobra.Command{
9+
Use: "bootstrap",
10+
Short: "Bootstrap toolkit components",
11+
Run: func(cmd *cobra.Command, args []string) {},
12+
}
13+
14+
func init() {
15+
carapace.Gen(bootstrapCmd).Standalone()
16+
bootstrapCmd.PersistentFlags().String("arch", "", "cluster architecture, available options are: (amd64, arm, arm64)")
17+
bootstrapCmd.PersistentFlags().String("author-email", "", "author email for Git commits")
18+
bootstrapCmd.PersistentFlags().String("author-name", "Flux", "author name for Git commits")
19+
bootstrapCmd.PersistentFlags().String("branch", "main", "Git branch")
20+
bootstrapCmd.PersistentFlags().String("ca-file", "", "path to TLS CA file used for validating self-signed certificates")
21+
bootstrapCmd.PersistentFlags().String("cluster-domain", "cluster.local", "internal cluster domain")
22+
bootstrapCmd.PersistentFlags().String("commit-message-appendix", "", "string to add to the commit messages, e.g. '[ci skip]'")
23+
bootstrapCmd.PersistentFlags().StringSlice("components", []string{"source-controller", "kustomize-controller", "helm-controller", "notification-controller"}, "list of components, accepts comma-separated values")
24+
bootstrapCmd.PersistentFlags().StringSlice("components-extra", []string{}, "list of components in addition to those supplied or defaulted, accepts comma-separated values")
25+
bootstrapCmd.PersistentFlags().String("gpg-key-id", "", "key id for selecting a particular key")
26+
bootstrapCmd.PersistentFlags().String("gpg-key-ring", "", "path to GPG key ring for signing commits")
27+
bootstrapCmd.PersistentFlags().String("gpg-passphrase", "", "passphrase for decrypting GPG private key")
28+
bootstrapCmd.PersistentFlags().String("image-pull-secret", "", "Kubernetes secret name used for pulling the toolkit images from a private registry")
29+
bootstrapCmd.PersistentFlags().String("log-level", "info", "log level, available options are: (debug, info, error)")
30+
bootstrapCmd.PersistentFlags().String("manifests", "", "path to the manifest directory")
31+
bootstrapCmd.PersistentFlags().Bool("network-policy", true, "deny ingress access to the toolkit controllers from other namespaces using network policies")
32+
bootstrapCmd.PersistentFlags().String("private-key-file", "", "path to a private key file used for authenticating to the Git SSH server")
33+
bootstrapCmd.PersistentFlags().Bool("recurse-submodules", false, "when enabled, configures the GitRepository source to initialize and include Git submodules in the artifact it produces")
34+
bootstrapCmd.PersistentFlags().String("registry", "ghcr.io/fluxcd", "container registry where the toolkit images are published")
35+
bootstrapCmd.PersistentFlags().String("secret-name", "flux-system", "name of the secret the sync credentials can be found in or stored to")
36+
bootstrapCmd.PersistentFlags().String("ssh-ecdsa-curve", "", "SSH ECDSA public key curve (p256, p384, p521)")
37+
bootstrapCmd.PersistentFlags().String("ssh-hostname", "", "SSH hostname, to be used when the SSH host differs from the HTTPS one")
38+
bootstrapCmd.PersistentFlags().String("ssh-key-algorithm", "ecdsa", "SSH public key algorithm (rsa, ecdsa, ed25519)")
39+
bootstrapCmd.PersistentFlags().String("ssh-rsa-bits", "2048", "SSH RSA public key bit size (multiplies of 8)")
40+
bootstrapCmd.PersistentFlags().Bool("token-auth", false, "when enabled, the personal access token will be used instead of SSH deploy key")
41+
bootstrapCmd.PersistentFlags().StringSlice("toleration-keys", []string{}, "list of toleration keys used to schedule the components pods onto nodes with matching taints")
42+
bootstrapCmd.PersistentFlags().StringP("version", "v", "", "toolkit version, when specified the manifests are downloaded from https://github.com/fluxcd/flux2/releases")
43+
bootstrapCmd.PersistentFlags().Bool("watch-all-namespaces", true, "watch for custom resources in all namespaces, if set to false it will only watch the namespace where the toolkit is installed")
44+
rootCmd.AddCommand(bootstrapCmd)
45+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package cmd
2+
3+
import (
4+
"github.com/rsteube/carapace"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
var bootstrap_bitbucketServerCmd = &cobra.Command{
9+
Use: "bitbucket-server",
10+
Short: "Bootstrap toolkit components in a Bitbucket Server repository",
11+
Run: func(cmd *cobra.Command, args []string) {},
12+
}
13+
14+
func init() {
15+
carapace.Gen(bootstrap_bitbucketServerCmd).Standalone()
16+
bootstrap_bitbucketServerCmd.Flags().StringSlice("group", []string{}, "Bitbucket Server groups to be given write access (also accepts comma-separated values)")
17+
bootstrap_bitbucketServerCmd.Flags().String("hostname", "", "Bitbucket Server hostname")
18+
bootstrap_bitbucketServerCmd.Flags().String("interval", "", "sync interval")
19+
bootstrap_bitbucketServerCmd.Flags().String("owner", "", "Bitbucket Server user or project name")
20+
bootstrap_bitbucketServerCmd.Flags().String("path", "", "path relative to the repository root, when specified the cluster sync will be scoped to this path")
21+
bootstrap_bitbucketServerCmd.Flags().Bool("personal", false, "if true, the owner is assumed to be a Bitbucket Server user; otherwise a group")
22+
bootstrap_bitbucketServerCmd.Flags().Bool("private", true, "if true, the repository is setup or configured as private")
23+
bootstrap_bitbucketServerCmd.Flags().Bool("read-write-key", false, "if true, the deploy key is configured with read/write permissions")
24+
bootstrap_bitbucketServerCmd.Flags().Bool("reconcile", false, "if true, the configured options are also reconciled if the repository already exists")
25+
bootstrap_bitbucketServerCmd.Flags().String("repository", "", "Bitbucket Server repository name")
26+
bootstrap_bitbucketServerCmd.Flags().StringP("username", "u", "git", "authentication username")
27+
bootstrapCmd.AddCommand(bootstrap_bitbucketServerCmd)
28+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package cmd
2+
3+
import (
4+
"github.com/rsteube/carapace"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
var bootstrap_gitCmd = &cobra.Command{
9+
Use: "git",
10+
Short: "Bootstrap toolkit components in a Git repository",
11+
Run: func(cmd *cobra.Command, args []string) {},
12+
}
13+
14+
func init() {
15+
carapace.Gen(bootstrap_gitCmd).Standalone()
16+
bootstrap_gitCmd.Flags().String("interval", "", "sync interval")
17+
bootstrap_gitCmd.Flags().StringP("password", "p", "", "basic authentication password")
18+
bootstrap_gitCmd.Flags().String("path", "", "path relative to the repository root, when specified the cluster sync will be scoped to this path")
19+
bootstrap_gitCmd.Flags().BoolP("silent", "s", false, "assumes the deploy key is already setup, skips confirmation")
20+
bootstrap_gitCmd.Flags().String("url", "", "Git repository URL")
21+
bootstrap_gitCmd.Flags().StringP("username", "u", "git", "basic authentication username")
22+
bootstrapCmd.AddCommand(bootstrap_gitCmd)
23+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package cmd
2+
3+
import (
4+
"github.com/rsteube/carapace"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
var bootstrap_githubCmd = &cobra.Command{
9+
Use: "github",
10+
Short: "Bootstrap toolkit components in a GitHub repository",
11+
Run: func(cmd *cobra.Command, args []string) {},
12+
}
13+
14+
func init() {
15+
carapace.Gen(bootstrap_githubCmd).Standalone()
16+
bootstrap_githubCmd.Flags().String("hostname", "github.com", "GitHub hostname")
17+
bootstrap_githubCmd.Flags().String("interval", "", "sync interval")
18+
bootstrap_githubCmd.Flags().String("owner", "", "GitHub user or organization name")
19+
bootstrap_githubCmd.Flags().String("path", "", "path relative to the repository root, when specified the cluster sync will be scoped to this path")
20+
bootstrap_githubCmd.Flags().Bool("personal", false, "if true, the owner is assumed to be a GitHub user; otherwise an org")
21+
bootstrap_githubCmd.Flags().Bool("private", true, "if true, the repository is setup or configured as private")
22+
bootstrap_githubCmd.Flags().Bool("read-write-key", false, "if true, the deploy key is configured with read/write permissions")
23+
bootstrap_githubCmd.Flags().Bool("reconcile", false, "if true, the configured options are also reconciled if the repository already exists")
24+
bootstrap_githubCmd.Flags().String("repository", "", "GitHub repository name")
25+
bootstrap_githubCmd.Flags().StringSlice("team", []string{}, "GitHub team and the access to be given to it(team:maintain). Defaults to maintainer access if no access level is specified (also accepts comma-separated values)")
26+
bootstrapCmd.AddCommand(bootstrap_githubCmd)
27+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package cmd
2+
3+
import (
4+
"github.com/rsteube/carapace"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
var bootstrap_gitlabCmd = &cobra.Command{
9+
Use: "gitlab",
10+
Short: "Bootstrap toolkit components in a GitLab repository",
11+
Run: func(cmd *cobra.Command, args []string) {},
12+
}
13+
14+
func init() {
15+
carapace.Gen(bootstrap_gitlabCmd).Standalone()
16+
bootstrap_gitlabCmd.Flags().String("hostname", "gitlab.com", "GitLab hostname")
17+
bootstrap_gitlabCmd.Flags().String("interval", "", "sync interval")
18+
bootstrap_gitlabCmd.Flags().String("owner", "", "GitLab user or group name")
19+
bootstrap_gitlabCmd.Flags().String("path", "", "path relative to the repository root, when specified the cluster sync will be scoped to this path")
20+
bootstrap_gitlabCmd.Flags().Bool("personal", false, "if true, the owner is assumed to be a GitLab user; otherwise a group")
21+
bootstrap_gitlabCmd.Flags().Bool("private", true, "if true, the repository is setup or configured as private")
22+
bootstrap_gitlabCmd.Flags().Bool("read-write-key", false, "if true, the deploy key is configured with read/write permissions")
23+
bootstrap_gitlabCmd.Flags().Bool("reconcile", false, "if true, the configured options are also reconciled if the repository already exists")
24+
bootstrap_gitlabCmd.Flags().String("repository", "", "GitLab repository name")
25+
bootstrap_gitlabCmd.Flags().StringSlice("team", []string{}, "GitLab teams to be given maintainer access (also accepts comma-separated values)")
26+
bootstrapCmd.AddCommand(bootstrap_gitlabCmd)
27+
}
+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package cmd
2+
3+
import (
4+
"github.com/rsteube/carapace"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
var buildCmd = &cobra.Command{
9+
Use: "build",
10+
Short: "Build a flux resource",
11+
Run: func(cmd *cobra.Command, args []string) {},
12+
}
13+
14+
func init() {
15+
carapace.Gen(buildCmd).Standalone()
16+
rootCmd.AddCommand(buildCmd)
17+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package cmd
2+
3+
import (
4+
"github.com/rsteube/carapace"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
var build_kustomizationCmd = &cobra.Command{
9+
Use: "kustomization",
10+
Short: "Build Kustomization",
11+
Run: func(cmd *cobra.Command, args []string) {},
12+
}
13+
14+
func init() {
15+
carapace.Gen(build_kustomizationCmd).Standalone()
16+
build_kustomizationCmd.Flags().String("path", "", "Path to the manifests location.)")
17+
buildCmd.AddCommand(build_kustomizationCmd)
18+
}
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package cmd
2+
3+
import (
4+
"github.com/rsteube/carapace"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
var checkCmd = &cobra.Command{
9+
Use: "check",
10+
Short: "Check requirements and installation",
11+
Run: func(cmd *cobra.Command, args []string) {},
12+
}
13+
14+
func init() {
15+
carapace.Gen(checkCmd).Standalone()
16+
checkCmd.Flags().StringSlice("components", []string{"source-controller", "kustomize-controller", "helm-controller", "notification-controller"}, "list of components, accepts comma-separated values")
17+
checkCmd.Flags().StringSlice("components-extra", []string{}, "list of components in addition to those supplied or defaulted, accepts comma-separated values")
18+
checkCmd.Flags().String("poll-interval", "", "how often the health checker should poll the cluster for the latest state of the resources.")
19+
checkCmd.Flags().Bool("pre", false, "only run pre-installation checks")
20+
rootCmd.AddCommand(checkCmd)
21+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package cmd
2+
3+
import (
4+
"github.com/rsteube/carapace"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
var completionCmd = &cobra.Command{
9+
Use: "completion",
10+
Short: "Generates completion scripts for various shells",
11+
Run: func(cmd *cobra.Command, args []string) {},
12+
}
13+
14+
func init() {
15+
carapace.Gen(completionCmd).Standalone()
16+
rootCmd.AddCommand(completionCmd)
17+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package cmd
2+
3+
import (
4+
"github.com/rsteube/carapace"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
var completion_bashCmd = &cobra.Command{
9+
Use: "bash",
10+
Short: "Generates bash completion scripts",
11+
Run: func(cmd *cobra.Command, args []string) {},
12+
}
13+
14+
func init() {
15+
carapace.Gen(completion_bashCmd).Standalone()
16+
completionCmd.AddCommand(completion_bashCmd)
17+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package cmd
2+
3+
import (
4+
"github.com/rsteube/carapace"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
var completion_fishCmd = &cobra.Command{
9+
Use: "fish",
10+
Short: "Generates fish completion scripts",
11+
Run: func(cmd *cobra.Command, args []string) {},
12+
}
13+
14+
func init() {
15+
carapace.Gen(completion_fishCmd).Standalone()
16+
completionCmd.AddCommand(completion_fishCmd)
17+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package cmd
2+
3+
import (
4+
"github.com/rsteube/carapace"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
var completion_powershellCmd = &cobra.Command{
9+
Use: "powershell",
10+
Short: "Generates powershell completion scripts",
11+
Run: func(cmd *cobra.Command, args []string) {},
12+
}
13+
14+
func init() {
15+
carapace.Gen(completion_powershellCmd).Standalone()
16+
completionCmd.AddCommand(completion_powershellCmd)
17+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package cmd
2+
3+
import (
4+
"github.com/rsteube/carapace"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
var completion_zshCmd = &cobra.Command{
9+
Use: "zsh",
10+
Short: "Generates zsh completion scripts",
11+
Run: func(cmd *cobra.Command, args []string) {},
12+
}
13+
14+
func init() {
15+
carapace.Gen(completion_zshCmd).Standalone()
16+
completionCmd.AddCommand(completion_zshCmd)
17+
}
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package cmd
2+
3+
import (
4+
"github.com/rsteube/carapace"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
var createCmd = &cobra.Command{
9+
Use: "create",
10+
Short: "Create or update sources and resources",
11+
Run: func(cmd *cobra.Command, args []string) {},
12+
}
13+
14+
func init() {
15+
carapace.Gen(createCmd).Standalone()
16+
createCmd.PersistentFlags().Bool("export", false, "export in YAML format to stdout")
17+
createCmd.PersistentFlags().String("interval", "", "source sync interval")
18+
createCmd.PersistentFlags().StringSlice("label", []string{}, "set labels on the resource (can specify multiple labels with commas: label1=value1,label2=value2)")
19+
rootCmd.AddCommand(createCmd)
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package cmd
2+
3+
import (
4+
"github.com/rsteube/carapace"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
var create_alertCmd = &cobra.Command{
9+
Use: "alert",
10+
Short: "Create or update a Alert resource",
11+
Run: func(cmd *cobra.Command, args []string) {},
12+
}
13+
14+
func init() {
15+
carapace.Gen(create_alertCmd).Standalone()
16+
create_alertCmd.Flags().String("event-severity", "", "severity of events to send alerts for")
17+
create_alertCmd.Flags().StringSlice("event-source", []string{}, "sources that should generate alerts (<kind>/<name>), also accepts comma-separated values")
18+
create_alertCmd.Flags().String("provider-ref", "", "reference to provider")
19+
createCmd.AddCommand(create_alertCmd)
20+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package cmd
2+
3+
import (
4+
"github.com/rsteube/carapace"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
var create_alertProviderCmd = &cobra.Command{
9+
Use: "alert-provider",
10+
Short: "Create or update a Provider resource",
11+
Run: func(cmd *cobra.Command, args []string) {},
12+
}
13+
14+
func init() {
15+
carapace.Gen(create_alertProviderCmd).Standalone()
16+
create_alertProviderCmd.Flags().String("address", "", "path to either the git repository, chat provider or webhook")
17+
create_alertProviderCmd.Flags().String("channel", "", "channel to send messages to in the case of a chat provider")
18+
create_alertProviderCmd.Flags().String("secret-ref", "", "name of secret containing authentication token")
19+
create_alertProviderCmd.Flags().String("type", "", "type of provider")
20+
create_alertProviderCmd.Flags().String("username", "", "bot username used by the provider")
21+
createCmd.AddCommand(create_alertProviderCmd)
22+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package cmd
2+
3+
import (
4+
"github.com/rsteube/carapace"
5+
"github.com/spf13/cobra"
6+
)
7+
8+
var create_helmreleaseCmd = &cobra.Command{
9+
Use: "helmrelease",
10+
Short: "Create or update a HelmRelease resource",
11+
Run: func(cmd *cobra.Command, args []string) {},
12+
}
13+
14+
func init() {
15+
carapace.Gen(create_helmreleaseCmd).Standalone()
16+
create_helmreleaseCmd.Flags().String("chart", "", "Helm chart name or path")
17+
create_helmreleaseCmd.Flags().String("chart-version", "", "Helm chart version, accepts a semver range (ignored for charts from GitRepository sources)")
18+
create_helmreleaseCmd.Flags().String("crds", "", "upgrade CRDs policy, available options are: (Skip, Create, CreateReplace)")
19+
create_helmreleaseCmd.Flags().Bool("create-target-namespace", false, "create the target namespace if it does not exist")
20+
create_helmreleaseCmd.Flags().StringSlice("depends-on", []string{}, "HelmReleases that must be ready before this release can be installed, supported formats '<name>' and '<namespace>/<name>'")
21+
create_helmreleaseCmd.Flags().String("release-name", "", "name used for the Helm release, defaults to a composition of '[<target-namespace>-]<HelmRelease-name>'")
22+
create_helmreleaseCmd.Flags().String("service-account", "", "the name of the service account to impersonate when reconciling this HelmRelease")
23+
create_helmreleaseCmd.Flags().String("source", "", "source that contains the chart in the format '<kind>/<name>.<namespace>', where kind must be one of: (HelmRepository, GitRepository, Bucket)")
24+
create_helmreleaseCmd.Flags().String("target-namespace", "", "namespace to install this release, defaults to the HelmRelease namespace")
25+
create_helmreleaseCmd.Flags().StringSlice("values", []string{}, "local path to values.yaml files, also accepts comma-separated values")
26+
create_helmreleaseCmd.Flags().String("values-from", "", "Kubernetes object reference that contains the values.yaml data key in the format '<kind>/<name>', where kind must be one of: (Secret, ConfigMap)")
27+
createCmd.AddCommand(create_helmreleaseCmd)
28+
}

0 commit comments

Comments
 (0)