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
Lines changed: 45 additions & 0 deletions
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+
}
Lines changed: 28 additions & 0 deletions
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+
}
Lines changed: 23 additions & 0 deletions
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+
}
Lines changed: 27 additions & 0 deletions
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+
}
Lines changed: 27 additions & 0 deletions
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+
}
Lines changed: 17 additions & 0 deletions
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+
}
Lines changed: 18 additions & 0 deletions
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+
}
Lines changed: 21 additions & 0 deletions
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+
}
Lines changed: 17 additions & 0 deletions
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+
}
Lines changed: 17 additions & 0 deletions
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+
}

0 commit comments

Comments
 (0)