From ed84d75fa199662bed8afd64fa0966b1b0cfe6c4 Mon Sep 17 00:00:00 2001 From: Noam Gal Date: Thu, 1 Jul 2021 18:21:47 +0300 Subject: [PATCH 01/14] added `repo uninstall` command still not fully implemented --- cmd/commands/app.go | 24 +-- cmd/commands/common.go | 17 +++ cmd/commands/project.go | 4 +- cmd/commands/repo.go | 140 +++++++++++++++++- .../argocd-autopilot_repo_bootstrap.md | 4 +- go.mod | 1 + go.sum | 3 +- pkg/argocd/argocd.go | 55 ++++--- pkg/git/mocks/repository.go | 17 ++- pkg/git/repository.go | 17 ++- pkg/git/repository_test.go | 48 +++--- pkg/kube/kube.go | 70 ++++----- 12 files changed, 286 insertions(+), 114 deletions(-) diff --git a/cmd/commands/app.go b/cmd/commands/app.go index bfe8b7da..26ee13a5 100644 --- a/cmd/commands/app.go +++ b/cmd/commands/app.go @@ -10,7 +10,6 @@ import ( "time" "github.com/argoproj-labs/argocd-autopilot/pkg/application" - "github.com/argoproj-labs/argocd-autopilot/pkg/argocd" "github.com/argoproj-labs/argocd-autopilot/pkg/fs" "github.com/argoproj-labs/argocd-autopilot/pkg/git" "github.com/argoproj-labs/argocd-autopilot/pkg/kube" @@ -199,13 +198,14 @@ func RunAppCreate(ctx context.Context, opts *AppCreateOptions) error { if opts.AppsCloneOpts != opts.CloneOpts { log.G(ctx).Info("committing changes to apps repo...") - if err = appsRepo.Persist(ctx, &git.PushOptions{CommitMsg: getCommitMsg(opts, appsfs)}); err != nil { + if _, err = appsRepo.Persist(ctx, &git.PushOptions{CommitMsg: getCommitMsg(opts, appsfs)}); err != nil { return fmt.Errorf("failed to push to apps repo: %w", err) } } log.G(ctx).Info("committing changes to gitops repo...") - if err = r.Persist(ctx, &git.PushOptions{CommitMsg: getCommitMsg(opts, repofs)}); err != nil { + revision, err := r.Persist(ctx, &git.PushOptions{CommitMsg: getCommitMsg(opts, repofs)}) + if err != nil { return fmt.Errorf("failed to push to gitops repo: %w", err) } @@ -219,7 +219,7 @@ func RunAppCreate(ctx context.Context, opts *AppCreateOptions) error { fullName := fmt.Sprintf("%s-%s", opts.ProjectName, opts.AppOpts.AppName) // wait for argocd to be ready before applying argocd-apps stop := util.WithSpinner(ctx, fmt.Sprintf("waiting for '%s' to be ready", fullName)) - if err = waitAppSynced(ctx, opts.KubeFactory, opts.Timeout, fullName, namespace); err != nil { + if err = waitAppSynced(ctx, opts.KubeFactory, opts.Timeout, fullName, namespace, revision); err != nil { stop() return fmt.Errorf("failed waiting for application to sync: %w", err) } @@ -298,20 +298,6 @@ func getCommitMsg(opts *AppCreateOptions, repofs fs.FS) string { return commitMsg } -func waitAppSynced(ctx context.Context, f kube.Factory, timeout time.Duration, appName, namespace string) error { - return f.Wait(ctx, &kube.WaitOptions{ - Interval: store.Default.WaitInterval, - Timeout: timeout, - Resources: []kube.Resource{ - { - Name: appName, - Namespace: namespace, - WaitFunc: argocd.CheckAppSynced, - }, - }, - }) -} - func NewAppListCommand(cloneOpts *git.CloneOptions) *cobra.Command { cmd := &cobra.Command{ Use: "list [PROJECT_NAME]", @@ -490,7 +476,7 @@ func RunAppDelete(ctx context.Context, opts *AppDeleteOptions) error { } log.G(ctx).Info("committing changes to gitops repo...") - if err = r.Persist(ctx, &git.PushOptions{CommitMsg: commitMsg}); err != nil { + if _, err = r.Persist(ctx, &git.PushOptions{CommitMsg: commitMsg}); err != nil { return fmt.Errorf("failed to push to repo: %w", err) } diff --git a/cmd/commands/common.go b/cmd/commands/common.go index 9f2e618f..97c168de 100644 --- a/cmd/commands/common.go +++ b/cmd/commands/common.go @@ -5,9 +5,12 @@ import ( _ "embed" "fmt" "os" + "time" + "github.com/argoproj-labs/argocd-autopilot/pkg/argocd" "github.com/argoproj-labs/argocd-autopilot/pkg/fs" "github.com/argoproj-labs/argocd-autopilot/pkg/git" + "github.com/argoproj-labs/argocd-autopilot/pkg/kube" "github.com/argoproj-labs/argocd-autopilot/pkg/log" "github.com/argoproj-labs/argocd-autopilot/pkg/store" "github.com/argoproj-labs/argocd-autopilot/pkg/util" @@ -141,6 +144,20 @@ func createApp(opts *createAppOptions) ([]byte, error) { return yaml.Marshal(app) } +func waitAppSynced(ctx context.Context, f kube.Factory, timeout time.Duration, appName, namespace, revision string) error { + return f.Wait(ctx, &kube.WaitOptions{ + Interval: store.Default.WaitInterval, + Timeout: timeout, + Resources: []kube.Resource{ + { + Name: appName, + Namespace: namespace, + WaitFunc: argocd.GetAppSyncFn(revision), + }, + }, + }) +} + type createAppSetOptions struct { name string namespace string diff --git a/cmd/commands/project.go b/cmd/commands/project.go index 2ea9d1f1..c356d808 100644 --- a/cmd/commands/project.go +++ b/cmd/commands/project.go @@ -214,7 +214,7 @@ func RunProjectCreate(ctx context.Context, opts *ProjectCreateOptions) error { } log.G().Infof("pushing new project manifest to repo") - if err = r.Persist(ctx, &git.PushOptions{CommitMsg: fmt.Sprintf("Added project '%s'", opts.ProjectName)}); err != nil { + if _, err = r.Persist(ctx, &git.PushOptions{CommitMsg: fmt.Sprintf("Added project '%s'", opts.ProjectName)}); err != nil { return err } @@ -441,7 +441,7 @@ func RunProjectDelete(ctx context.Context, opts *ProjectDeleteOptions) error { } log.G().Info("committing changes to gitops repo...") - if err = r.Persist(ctx, &git.PushOptions{CommitMsg: fmt.Sprintf("Deleted project '%s'", opts.ProjectName)}); err != nil { + if _, err = r.Persist(ctx, &git.PushOptions{CommitMsg: fmt.Sprintf("Deleted project '%s'", opts.ProjectName)}); err != nil { return fmt.Errorf("failed to push to repo: %w", err) } diff --git a/cmd/commands/repo.go b/cmd/commands/repo.go index a74a487a..98a7dced 100644 --- a/cmd/commands/repo.go +++ b/cmd/commands/repo.go @@ -55,6 +55,14 @@ type ( CloneOptions *git.CloneOptions } + RepoUninstallOptions struct { + Namespace string + KubeContext string + Timeout time.Duration + KubeFactory kube.Factory + CloneOptions *git.CloneOptions + } + bootstrapManifests struct { bootstrapApp []byte rootApp []byte @@ -79,6 +87,7 @@ func NewRepoCommand() *cobra.Command { } cmd.AddCommand(NewRepoBootstrapCommand()) + cmd.AddCommand(NewRepoUninstallCommand()) return cmd } @@ -112,8 +121,8 @@ func NewRepoBootstrapCommand() *cobra.Command { repo bootstrap --repo https://github.com/example/repo - # Install argo-cd on the current kubernetes context in the argocd namespace - # and persists the bootstrap manifests to a specific folder in the gitops repository +# Install argo-cd on the current kubernetes context in the argocd namespace +# and persists the bootstrap manifests to a specific folder in the gitops repository repo bootstrap --repo https://github.com/example/repo/path/to/installation_root `), @@ -233,7 +242,7 @@ func RunRepoBootstrap(ctx context.Context, opts *RepoBootstrapOptions) error { commitMsg = "Autopilot Bootstrap at " + opts.CloneOptions.Path() } - if err = r.Persist(ctx, &git.PushOptions{CommitMsg: commitMsg}); err != nil { + if _, err = r.Persist(ctx, &git.PushOptions{CommitMsg: commitMsg}); err != nil { return err } @@ -266,6 +275,96 @@ func RunRepoBootstrap(ctx context.Context, opts *RepoBootstrapOptions) error { return nil } +func NewRepoUninstallCommand() *cobra.Command { + var ( + cloneOpts *git.CloneOptions + f kube.Factory + ) + + cmd := &cobra.Command{ + Use: "uninstall", + Short: "Uninstalls an installation", + Example: util.Doc(` +# To run this command you need to create a personal access token for your git provider +# and provide it using: + + export GIT_TOKEN= + +# or with the flag: + + --git-token + +# Uninstall argo-cd from the current kubernetes context in the argocd namespace +# and delete all manifests rom the root of gitops repository + + repo uninstall --repo https://github.com/example/repo + +# Uninstall argo-cd from the current kubernetes context in the argocd namespace +# and delete all manifests from a specific folder in the gitops repository + + repo uninstall --repo https://github.com/example/repo/path/to/installation_root +`), + PreRun: func(_ *cobra.Command, _ []string) { cloneOpts.Parse() }, + RunE: func(cmd *cobra.Command, args []string) error { + return RunRepoUninstall(cmd.Context(), &RepoUninstallOptions{ + Namespace: cmd.Flag("namespace").Value.String(), + KubeContext: cmd.Flag("context").Value.String(), + Timeout: util.MustParseDuration(cmd.Flag("request-timeout").Value.String()), + KubeFactory: f, + CloneOptions: cloneOpts, + }) + }, + } + + cloneOpts = git.AddFlags(cmd, &git.AddFlagsOptions{ + FS: memfs.New(), + }) + f = kube.AddFlags(cmd.Flags()) + + return cmd +} + +func RunRepoUninstall(ctx context.Context, opts *RepoUninstallOptions) error { + var err error + + if opts, err = setUninstallOptsDefaults(*opts); err != nil { + return err + } + + log.G().WithFields(log.Fields{ + "repo-url": opts.CloneOptions.URL(), + "revision": opts.CloneOptions.Revision(), + "namespace": opts.Namespace, + "kube-context": opts.KubeContext, + }).Debug("starting with options: ") + + log.G().Infof("cloning repo: %s", opts.CloneOptions.URL()) + + // clone GitOps repo + r, repofs, err := getRepo(ctx, opts.CloneOptions) + if err != nil { + return err + } + + if err = clearBootstrapFolder(repofs); err != nil { + return err + } + + revision, err := r.Persist(ctx, &git.PushOptions{CommitMsg: "Autopilot Uninstall"}) + if err != nil { + return err + } + + if err = waitAppSynced(ctx, opts.KubeFactory, opts.Timeout, store.Default.BootsrtrapAppName, opts.Namespace, revision); err != nil { + return err + } + + // delete bootstrap app + // delete bootstrap|projects|apps folders + commit/push + + return nil +} + func setBootstrapOptsDefaults(opts RepoBootstrapOptions) (*RepoBootstrapOptions, error) { var err error @@ -570,3 +669,38 @@ func createCreds(repoUrl string) ([]byte, error) { return yaml.Marshal(creds) } + +func setUninstallOptsDefaults(opts RepoUninstallOptions) (*RepoUninstallOptions, error) { + var err error + + if opts.Namespace == "" { + opts.Namespace = store.Default.ArgoCDNamespace + } + + if opts.KubeContext == "" { + if opts.KubeContext, err = currentKubeContext(); err != nil { + return nil, err + } + } + + return &opts, nil +} + +func clearBootstrapFolder(repofs fs.FS) error { + files, err := repofs.ReadDir(store.Default.BootsrtrapDir) + if err != nil { + return err + } + + for _, f := range files { + if f.IsDir() { + continue + } + + if err = repofs.Remove(repofs.Join(store.Default.BootsrtrapDir, f.Name())); err != nil { + return err + } + } + + return nil +} diff --git a/docs/commands/argocd-autopilot_repo_bootstrap.md b/docs/commands/argocd-autopilot_repo_bootstrap.md index 2e9eb61e..b8eed603 100644 --- a/docs/commands/argocd-autopilot_repo_bootstrap.md +++ b/docs/commands/argocd-autopilot_repo_bootstrap.md @@ -24,8 +24,8 @@ argocd-autopilot repo bootstrap [flags] argocd-autopilot repo bootstrap --repo https://github.com/example/repo - # Install argo-cd on the current kubernetes context in the argocd namespace - # and persists the bootstrap manifests to a specific folder in the gitops repository +# Install argo-cd on the current kubernetes context in the argocd namespace +# and persists the bootstrap manifests to a specific folder in the gitops repository argocd-autopilot repo bootstrap --repo https://github.com/example/repo/path/to/installation_root diff --git a/go.mod b/go.mod index 47a3997b..d90a847a 100644 --- a/go.mod +++ b/go.mod @@ -6,6 +6,7 @@ require ( github.com/argoproj-labs/applicationset v0.1.0 github.com/argoproj/argo-cd v1.8.7 github.com/argoproj/argo-cd/v2 v2.0.3 + github.com/argoproj/gitops-engine v0.3.3 github.com/briandowns/spinner v1.13.0 github.com/ghodss/yaml v1.0.0 github.com/go-git/go-billy/v5 v5.3.1 diff --git a/go.sum b/go.sum index 20c5a62e..c2469288 100644 --- a/go.sum +++ b/go.sum @@ -116,8 +116,9 @@ github.com/argoproj/argo-cd/v2 v2.0.3 h1:9KK9u5wegvBhUQIrK+dfsGiJglPNlzFGoUFM/5i github.com/argoproj/argo-cd/v2 v2.0.3/go.mod h1:eg4iTfTUICd6o6ZpbPElWGcHSHWOsgXIQM13+HzhIYE= github.com/argoproj/gitops-engine v0.2.1/go.mod h1:OxXp8YaT73rw9gEBnGBWg55af80nkV/uIjWCbJu1Nw0= github.com/argoproj/gitops-engine v0.2.2/go.mod h1:OxXp8YaT73rw9gEBnGBWg55af80nkV/uIjWCbJu1Nw0= -github.com/argoproj/gitops-engine v0.3.2 h1:m5bjOk/bWwMsFBGFpurdK31/hC5UuLMQn0hAd51TlEk= github.com/argoproj/gitops-engine v0.3.2/go.mod h1:IBHhAkqlC+3r/wBWUitWSidQhPzlLoSTWp2htq3dyQk= +github.com/argoproj/gitops-engine v0.3.3 h1:zRNwKRj3h+EBpciy/+Eyo4vW2GTG3UG4HXAdWn0mQRI= +github.com/argoproj/gitops-engine v0.3.3/go.mod h1:IBHhAkqlC+3r/wBWUitWSidQhPzlLoSTWp2htq3dyQk= github.com/argoproj/pkg v0.2.0 h1:ETgC600kr8WcAi3MEVY5sA1H7H/u1/IysYOobwsZ8No= github.com/argoproj/pkg v0.2.0/go.mod h1:F4TZgInLUEjzsWFB/BTJBsewoEy0ucnKSq6vmQiD/yc= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= diff --git a/pkg/argocd/argocd.go b/pkg/argocd/argocd.go index 5b640e38..6d3873d2 100644 --- a/pkg/argocd/argocd.go +++ b/pkg/argocd/argocd.go @@ -2,6 +2,7 @@ package argocd import ( "context" + "time" "github.com/argoproj-labs/argocd-autopilot/pkg/kube" "github.com/argoproj-labs/argocd-autopilot/pkg/log" @@ -13,6 +14,7 @@ import ( "github.com/argoproj/argo-cd/v2/cmd/argocd/commands" "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1" argocdcd "github.com/argoproj/argo-cd/v2/pkg/client/clientset/versioned" + "github.com/argoproj/gitops-engine/pkg/health" "github.com/spf13/cobra" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -34,6 +36,14 @@ type ( Username string Password string } + + AppWaitOptions struct { + Namespace string + Name string + Interval time.Duration + Timeout time.Duration + Revision string + } ) func AddClusterAddFlags(cmd *cobra.Command) (AddClusterCmd, error) { @@ -54,29 +64,38 @@ func AddClusterAddFlags(cmd *cobra.Command) (AddClusterCmd, error) { return &addClusterImpl{root, args}, nil } -func CheckAppSynced(ctx context.Context, f kube.Factory, ns, name string) (bool, error) { - rc, err := f.ToRESTConfig() - if err != nil { - return false, err - } - - c, err := argocdcd.NewForConfig(rc) - if err != nil { - return false, err - } +func GetAppSyncFn(revision string) kube.WaitFunc { + return func(ctx context.Context, f kube.Factory, ns, name string) (bool, error) { + rc, err := f.ToRESTConfig() + if err != nil { + return false, err + } - app, err := c.ArgoprojV1alpha1().Applications(ns).Get(ctx, name, metav1.GetOptions{}) - if err != nil { - se, ok := err.(*errors.StatusError) - if !ok || se.ErrStatus.Reason != metav1.StatusReasonNotFound { + c, err := argocdcd.NewForConfig(rc) + if err != nil { return false, err } - return false, nil - } + app, err := c.ArgoprojV1alpha1().Applications(ns).Get(ctx, name, metav1.GetOptions{}) + if err != nil { + se, ok := err.(*errors.StatusError) + if !ok || se.ErrStatus.Reason != metav1.StatusReasonNotFound { + return false, err + } + + return false, nil + } + + synced := app.Status.Sync.Status == v1alpha1.SyncStatusCodeSynced + healthy := app.Status.Health.Status == health.HealthStatusHealthy + atRevision := true + if revision != "" { + atRevision = revision == app.Status.Sync.Revision + } - log.G().Debugf("Application found, Sync Status = %s", app.Status.Sync.Status) - return app.Status.Sync.Status == v1alpha1.SyncStatusCodeSynced, nil + log.G().Debugf("Application found, Sync Status: %s, Health Status: %s, Revision: %s", app.Status.Sync.Status, app.Status.Health.Status, app.Status.Sync.Revision) + return synced && healthy && atRevision, nil + } } func (a *addClusterImpl) Execute(ctx context.Context, clusterName string) error { diff --git a/pkg/git/mocks/repository.go b/pkg/git/mocks/repository.go index 29a621fa..9a97fb0e 100644 --- a/pkg/git/mocks/repository.go +++ b/pkg/git/mocks/repository.go @@ -15,15 +15,22 @@ type Repository struct { } // Persist provides a mock function with given fields: ctx, opts -func (_m *Repository) Persist(ctx context.Context, opts *git.PushOptions) error { +func (_m *Repository) Persist(ctx context.Context, opts *git.PushOptions) (string, error) { ret := _m.Called(ctx, opts) - var r0 error - if rf, ok := ret.Get(0).(func(context.Context, *git.PushOptions) error); ok { + var r0 string + if rf, ok := ret.Get(0).(func(context.Context, *git.PushOptions) string); ok { r0 = rf(ctx, opts) } else { - r0 = ret.Error(0) + r0 = ret.Get(0).(string) } - return r0 + var r1 error + if rf, ok := ret.Get(1).(func(context.Context, *git.PushOptions) error); ok { + r1 = rf(ctx, opts) + } else { + r1 = ret.Error(1) + } + + return r0, r1 } diff --git a/pkg/git/repository.go b/pkg/git/repository.go index 2caf8267..5cb84f9b 100644 --- a/pkg/git/repository.go +++ b/pkg/git/repository.go @@ -33,7 +33,7 @@ type ( // Repository represents a git repository Repository interface { // Persist runs add, commit and push to the repository default remote - Persist(ctx context.Context, opts *PushOptions) error + Persist(ctx context.Context, opts *PushOptions) (string, error) } AddFlagsOptions struct { @@ -192,9 +192,9 @@ func (o *CloneOptions) Path() string { return o.path } -func (r *repo) Persist(ctx context.Context, opts *PushOptions) error { +func (r *repo) Persist(ctx context.Context, opts *PushOptions) (string, error) { if opts == nil { - return ErrNilOpts + return "", ErrNilOpts } addPattern := "." @@ -205,18 +205,19 @@ func (r *repo) Persist(ctx context.Context, opts *PushOptions) error { w, err := worktree(r) if err != nil { - return err + return "", err } if err := w.AddGlob(addPattern); err != nil { - return err + return "", err } - if _, err = w.Commit(opts.CommitMsg, &gg.CommitOptions{All: true}); err != nil { - return err + h, err := w.Commit(opts.CommitMsg, &gg.CommitOptions{All: true}) + if err != nil { + return "", err } - return r.PushContext(ctx, &gg.PushOptions{ + return h.String(), r.PushContext(ctx, &gg.PushOptions{ Auth: getAuth(r.auth), Progress: os.Stderr, }) diff --git a/pkg/git/repository_test.go b/pkg/git/repository_test.go index 333258b3..168cb67a 100644 --- a/pkg/git/repository_test.go +++ b/pkg/git/repository_test.go @@ -514,15 +514,18 @@ func TestGetRepo(t *testing.T) { func Test_repo_Persist(t *testing.T) { tests := map[string]struct { - opts *PushOptions - wantErr bool - retErr error - assertFn func(t *testing.T, r *mocks.Repository, w *mocks.Worktree) + opts *PushOptions + retRevision string + retErr error + assertFn func(t *testing.T, r *mocks.Repository, w *mocks.Worktree, revision string, err error) }{ "NilOpts": { - opts: nil, - wantErr: true, - assertFn: func(t *testing.T, r *mocks.Repository, _ *mocks.Worktree) { + opts: nil, + assertFn: func(t *testing.T, r *mocks.Repository, wt *mocks.Worktree, revision string, err error) { + assert.ErrorIs(t, err, ErrNilOpts) + assert.Equal(t, "", revision) + wt.AssertNotCalled(t, "AddGlob") + wt.AssertNotCalled(t, "Commit") r.AssertNotCalled(t, "PushContext") }, }, @@ -531,13 +534,14 @@ func Test_repo_Persist(t *testing.T) { AddGlobPattern: "", CommitMsg: "hello", }, - wantErr: false, - assertFn: func(t *testing.T, r *mocks.Repository, w *mocks.Worktree) { - r.AssertCalled(t, "PushContext", mock.Anything, mock.Anything) - assert.True(t, reflect.DeepEqual(r.Calls[0].Arguments[1], &gg.PushOptions{ + retRevision: "0dee45f70b37aeb59e6d2efb29855f97df9bccb2", + assertFn: func(t *testing.T, r *mocks.Repository, w *mocks.Worktree, revision string, err error) { + assert.Equal(t, "0dee45f70b37aeb59e6d2efb29855f97df9bccb2", revision) + assert.Nil(t, err) + r.AssertCalled(t, "PushContext", mock.Anything, &gg.PushOptions{ Auth: nil, Progress: os.Stderr, - })) + }) w.AssertCalled(t, "AddGlob", ".") w.AssertCalled(t, "Commit", "hello", mock.Anything) }, @@ -547,13 +551,14 @@ func Test_repo_Persist(t *testing.T) { AddGlobPattern: "test", CommitMsg: "hello", }, - wantErr: false, - assertFn: func(t *testing.T, r *mocks.Repository, w *mocks.Worktree) { - r.AssertCalled(t, "PushContext", mock.Anything, mock.Anything) - assert.True(t, reflect.DeepEqual(r.Calls[0].Arguments[1], &gg.PushOptions{ + retRevision: "0dee45f70b37aeb59e6d2efb29855f97df9bccb2", + assertFn: func(t *testing.T, r *mocks.Repository, w *mocks.Worktree, revision string, err error) { + assert.Equal(t, "0dee45f70b37aeb59e6d2efb29855f97df9bccb2", revision) + assert.Nil(t, err) + r.AssertCalled(t, "PushContext", mock.Anything, &gg.PushOptions{ Auth: nil, Progress: os.Stderr, - })) + }) w.AssertCalled(t, "AddGlob", "test") w.AssertCalled(t, "Commit", "hello", mock.Anything) }, @@ -570,18 +575,15 @@ func Test_repo_Persist(t *testing.T) { mockWt := &mocks.Worktree{} mockWt.On("AddGlob", mock.Anything).Return(tt.retErr) - mockWt.On("Commit", mock.Anything, mock.Anything).Return(nil, tt.retErr) + mockWt.On("Commit", mock.Anything, mock.Anything).Return(plumbing.NewHash(tt.retRevision), tt.retErr) r := &repo{Repository: mockRepo} worktree = func(r gogit.Repository) (gogit.Worktree, error) { return mockWt, tt.retErr } - if err := r.Persist(context.Background(), tt.opts); (err != nil) != tt.wantErr { - t.Errorf("repo.Persist() error = %v, wantErr %v", err, tt.wantErr) - } - - tt.assertFn(t, mockRepo, mockWt) + revision, err := r.Persist(context.Background(), tt.opts) + tt.assertFn(t, mockRepo, mockWt, revision, err) }) } } diff --git a/pkg/kube/kube.go b/pkg/kube/kube.go index 2a21165d..ad366c0e 100644 --- a/pkg/kube/kube.go +++ b/pkg/kube/kube.go @@ -43,49 +43,53 @@ func WaitDeploymentReady(ctx context.Context, f Factory, ns, name string) (bool, return d.Status.ReadyReplicas >= *d.Spec.Replicas, nil } -type Factory interface { - // KubernetesClientSet returns a new kubernetes clientset or error - KubernetesClientSet() (kubernetes.Interface, error) +type ( + Factory interface { + // KubernetesClientSet returns a new kubernetes clientset or error + KubernetesClientSet() (kubernetes.Interface, error) - // KubernetesClientSetOrDie calls KubernetesClientSet() and panics if it returns an error - KubernetesClientSetOrDie() kubernetes.Interface + // KubernetesClientSetOrDie calls KubernetesClientSet() and panics if it returns an error + KubernetesClientSetOrDie() kubernetes.Interface - // ToRESTConfig returns a rest Config object or error - ToRESTConfig() (*restclient.Config, error) + // ToRESTConfig returns a rest Config object or error + ToRESTConfig() (*restclient.Config, error) - // Apply applies the provided manifests on the specified namespace - Apply(ctx context.Context, namespace string, manifests []byte) error + // Apply applies the provided manifests on the specified namespace + Apply(ctx context.Context, namespace string, manifests []byte) error - // Wait waits for all of the provided `Resources` to be ready by calling - // the `WaitFunc` of each resource until all of them returns `true` - Wait(context.Context, *WaitOptions) error -} - -type Resource struct { - Name string - Namespace string + // Wait waits for all of the provided `Resources` to be ready by calling + // the `WaitFunc` of each resource until all of them returns `true` + Wait(context.Context, *WaitOptions) error + } - // WaitFunc will be called to check if the resources is ready. Should return (true, nil) - // if the resources is ready, (false, nil) if the resource is not ready yet, or (false, err) - // if some error occured (in that case the `Wait` will fail with that error). WaitFunc func(ctx context.Context, f Factory, ns, name string) (bool, error) -} -type WaitOptions struct { - // Inverval the duration between each iteration of calling all of the resources' `WaitFunc`s. - Interval time.Duration + Resource struct { + Name string + Namespace string - // Timeout the max time to wait for all of the resources to be ready. If not all of the - // resourecs are ready at time this will cause `Wait` to return an error. - Timeout time.Duration + // WaitFunc will be called to check if the resources is ready. Should return (true, nil) + // if the resources is ready, (false, nil) if the resource is not ready yet, or (false, err) + // if some error occured (in that case the `Wait` will fail with that error). + WaitFunc WaitFunc + } - // Resources the list of resources to wait for. - Resources []Resource -} + WaitOptions struct { + // Inverval the duration between each iteration of calling all of the resources' `WaitFunc`s. + Interval time.Duration -type factory struct { - f cmdutil.Factory -} + // Timeout the max time to wait for all of the resources to be ready. If not all of the + // resourecs are ready at time this will cause `Wait` to return an error. + Timeout time.Duration + + // Resources the list of resources to wait for. + Resources []Resource + } + + factory struct { + f cmdutil.Factory + } +) func AddFlags(flags *pflag.FlagSet) Factory { confFlags := genericclioptions.NewConfigFlags(true) From b4715a36c038bbb94786abfae44175653f4f882a Mon Sep 17 00:00:00 2001 From: Noam Gal Date: Thu, 1 Jul 2021 18:24:51 +0300 Subject: [PATCH 02/14] removed AppWaitOptions (not used) --- pkg/argocd/argocd.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/pkg/argocd/argocd.go b/pkg/argocd/argocd.go index 6d3873d2..069022b7 100644 --- a/pkg/argocd/argocd.go +++ b/pkg/argocd/argocd.go @@ -2,7 +2,6 @@ package argocd import ( "context" - "time" "github.com/argoproj-labs/argocd-autopilot/pkg/kube" "github.com/argoproj-labs/argocd-autopilot/pkg/log" @@ -36,14 +35,6 @@ type ( Username string Password string } - - AppWaitOptions struct { - Namespace string - Name string - Interval time.Duration - Timeout time.Duration - Revision string - } ) func AddClusterAddFlags(cmd *cobra.Command) (AddClusterCmd, error) { From 45f51323ac3b25cab13894d765f4d6ff15c16a41 Mon Sep 17 00:00:00 2001 From: Noam Gal Date: Thu, 1 Jul 2021 18:36:45 +0300 Subject: [PATCH 03/14] ran codegen --- docs/commands/argocd-autopilot_repo.md | 1 + .../argocd-autopilot_repo_uninstall.md | 61 +++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 docs/commands/argocd-autopilot_repo_uninstall.md diff --git a/docs/commands/argocd-autopilot_repo.md b/docs/commands/argocd-autopilot_repo.md index 735d8247..49a5e660 100644 --- a/docs/commands/argocd-autopilot_repo.md +++ b/docs/commands/argocd-autopilot_repo.md @@ -17,4 +17,5 @@ argocd-autopilot repo [flags] * [argocd-autopilot](argocd-autopilot.md) - argocd-autopilot is used for installing and managing argo-cd installations and argo-cd applications using gitops * [argocd-autopilot repo bootstrap](argocd-autopilot_repo_bootstrap.md) - Bootstrap a new installation +* [argocd-autopilot repo uninstall](argocd-autopilot_repo_uninstall.md) - Uninstalls an installation diff --git a/docs/commands/argocd-autopilot_repo_uninstall.md b/docs/commands/argocd-autopilot_repo_uninstall.md new file mode 100644 index 00000000..41d2b3f9 --- /dev/null +++ b/docs/commands/argocd-autopilot_repo_uninstall.md @@ -0,0 +1,61 @@ +## argocd-autopilot repo uninstall + +Uninstalls an installation + +``` +argocd-autopilot repo uninstall [flags] +``` + +### Examples + +``` + +# To run this command you need to create a personal access token for your git provider +# and provide it using: + + export GIT_TOKEN= + +# or with the flag: + + --git-token + +# Uninstall argo-cd from the current kubernetes context in the argocd namespace +# and delete all manifests rom the root of gitops repository + + argocd-autopilot repo uninstall --repo https://github.com/example/repo + +# Uninstall argo-cd from the current kubernetes context in the argocd namespace +# and delete all manifests from a specific folder in the gitops repository + + argocd-autopilot repo uninstall --repo https://github.com/example/repo/path/to/installation_root + +``` + +### Options + +``` + --as string Username to impersonate for the operation + --as-group stringArray Group to impersonate for the operation, this flag can be repeated to specify multiple groups. + --cache-dir string Default cache directory (default "/home/user/.kube/cache") + --certificate-authority string Path to a cert file for the certificate authority + --client-certificate string Path to a client certificate file for TLS + --client-key string Path to a client key file for TLS + --cluster string The name of the kubeconfig cluster to use + --context string The name of the kubeconfig context to use + -t, --git-token string Your git provider api token [GIT_TOKEN] + -h, --help help for uninstall + --insecure-skip-tls-verify If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure + --kubeconfig string Path to the kubeconfig file to use for CLI requests. + -n, --namespace string If present, the namespace scope for this CLI request + --repo string Repository URL [GIT_REPO] + --request-timeout string The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. (default "0") + -s, --server string The address and port of the Kubernetes API server + --tls-server-name string Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used + --token string Bearer token for authentication to the API server + --user string The name of the kubeconfig user to use +``` + +### SEE ALSO + +* [argocd-autopilot repo](argocd-autopilot_repo.md) - Manage gitops repositories + From 11f689a0a605e66a05b4e1f7a36f9a6584ae3888 Mon Sep 17 00:00:00 2001 From: Noam Gal Date: Sun, 4 Jul 2021 16:43:34 +0300 Subject: [PATCH 04/14] delete cluster resources, and cleanup repo afterwards --- a.yaml | 9073 +++++++++++++++++++++++++++++++++++++++ cmd/commands/common.go | 16 +- cmd/commands/project.go | 26 +- cmd/commands/repo.go | 98 +- pkg/argocd/argocd.go | 6 +- pkg/kube/kube.go | 89 +- pkg/store/store.go | 39 +- 7 files changed, 9277 insertions(+), 70 deletions(-) create mode 100644 a.yaml diff --git a/a.yaml b/a.yaml new file mode 100644 index 00000000..2cdfa069 --- /dev/null +++ b/a.yaml @@ -0,0 +1,9073 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + labels: + app.kubernetes.io/name: applications.argoproj.io + app.kubernetes.io/part-of: argocd + name: applications.argoproj.io +spec: + group: argoproj.io + names: + kind: Application + listKind: ApplicationList + plural: applications + shortNames: + - app + - apps + singular: application + scope: Namespaced + versions: + - additionalPrinterColumns: + - jsonPath: .status.sync.status + name: Sync Status + type: string + - jsonPath: .status.health.status + name: Health Status + type: string + - jsonPath: .status.sync.revision + name: Revision + priority: 10 + type: string + name: v1alpha1 + schema: + openAPIV3Schema: + description: Application is a definition of Application resource. + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + operation: + description: Operation contains information about a requested or running + operation + properties: + info: + description: Info is a list of informational items for this operation + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + initiatedBy: + description: InitiatedBy contains information about who initiated + the operations + properties: + automated: + description: Automated is set to true if operation was initiated + automatically by the application controller. + type: boolean + username: + description: Username contains the name of a user who started + operation + type: string + type: object + retry: + description: Retry controls the strategy to apply if a sync fails + properties: + backoff: + description: Backoff controls how to backoff on subsequent retries + of failed syncs + properties: + duration: + description: Duration is the amount to back off. Default unit + is seconds, but could also be a duration (e.g. "2m", "1h") + type: string + factor: + description: Factor is a factor to multiply the base duration + after each failed retry + format: int64 + type: integer + maxDuration: + description: MaxDuration is the maximum amount of time allowed + for the backoff strategy + type: string + type: object + limit: + description: Limit is the maximum number of attempts for retrying + a failed sync. If set to 0, no retries will be performed. + format: int64 + type: integer + type: object + sync: + description: Sync contains parameters for the operation + properties: + dryRun: + description: DryRun specifies to perform a `kubectl apply --dry-run` + without actually performing the sync + type: boolean + manifests: + description: Manifests is an optional field that overrides sync + source with a local directory for development + items: + type: string + type: array + prune: + description: Prune specifies to delete resources from the cluster + that are no longer tracked in git + type: boolean + resources: + description: Resources describes which resources shall be part + of the sync + items: + description: SyncOperationResource contains resources to sync. + properties: + group: + type: string + kind: + type: string + name: + type: string + namespace: + type: string + required: + - kind + - name + type: object + type: array + revision: + description: Revision is the revision (Git) or chart version (Helm) + which to sync the application to If omitted, will use the revision + specified in app spec. + type: string + source: + description: Source overrides the source definition set in the + application. This is typically set in a Rollback operation and + is nil during a Sync operation + properties: + chart: + description: Chart is a Helm chart name, and must be specified + for applications sourced from a Helm repo. + type: string + directory: + description: Directory holds path/directory specific options + properties: + exclude: + description: Exclude contains a glob pattern to match + paths against that should be explicitly excluded from + being used during manifest generation + type: string + include: + description: Include contains a glob pattern to match + paths against that should be explicitly included during + manifest generation + type: string + jsonnet: + description: Jsonnet holds options specific to Jsonnet + properties: + extVars: + description: ExtVars is a list of Jsonnet External + Variables + items: + description: JsonnetVar represents a variable to + be passed to jsonnet during manifest generation + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + libs: + description: Additional library search dirs + items: + type: string + type: array + tlas: + description: TLAS is a list of Jsonnet Top-level Arguments + items: + description: JsonnetVar represents a variable to + be passed to jsonnet during manifest generation + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + recurse: + description: Recurse specifies whether to scan a directory + recursively for manifests + type: boolean + type: object + helm: + description: Helm holds helm specific options + properties: + fileParameters: + description: FileParameters are file parameters to the + helm template + items: + description: HelmFileParameter is a file parameter that's + passed to helm template during manifest generation + properties: + name: + description: Name is the name of the Helm parameter + type: string + path: + description: Path is the path to the file containing + the values for the Helm parameter + type: string + type: object + type: array + parameters: + description: Parameters is a list of Helm parameters which + are passed to the helm template command upon manifest + generation + items: + description: HelmParameter is a parameter that's passed + to helm template during manifest generation + properties: + forceString: + description: ForceString determines whether to tell + Helm to interpret booleans and numbers as strings + type: boolean + name: + description: Name is the name of the Helm parameter + type: string + value: + description: Value is the value for the Helm parameter + type: string + type: object + type: array + releaseName: + description: ReleaseName is the Helm release name to use. + If omitted it will use the application name + type: string + valueFiles: + description: ValuesFiles is a list of Helm value files + to use when generating a template + items: + type: string + type: array + values: + description: Values specifies Helm values to be passed + to helm template, typically defined as a block + type: string + version: + description: Version is the Helm version to use for templating + (either "2" or "3") + type: string + type: object + ksonnet: + description: Ksonnet holds ksonnet specific options + properties: + environment: + description: Environment is a ksonnet application environment + name + type: string + parameters: + description: Parameters are a list of ksonnet component + parameter override values + items: + description: KsonnetParameter is a ksonnet component + parameter + properties: + component: + type: string + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + kustomize: + description: Kustomize holds kustomize specific options + properties: + commonAnnotations: + additionalProperties: + type: string + description: CommonAnnotations is a list of additional + annotations to add to rendered manifests + type: object + commonLabels: + additionalProperties: + type: string + description: CommonLabels is a list of additional labels + to add to rendered manifests + type: object + images: + description: Images is a list of Kustomize image override + specifications + items: + description: KustomizeImage represents a Kustomize image + definition in the format [old_image_name=]: + type: string + type: array + namePrefix: + description: NamePrefix is a prefix appended to resources + for Kustomize apps + type: string + nameSuffix: + description: NameSuffix is a suffix appended to resources + for Kustomize apps + type: string + version: + description: Version controls which version of Kustomize + to use for rendering manifests + type: string + type: object + path: + description: Path is a directory path within the Git repository, + and is only valid for applications sourced from Git. + type: string + plugin: + description: ConfigManagementPlugin holds config management + plugin specific options + properties: + env: + description: Env is a list of environment variable entries + items: + description: EnvEntry represents an entry in the application's + environment + properties: + name: + description: Name is the name of the variable, usually + expressed in uppercase + type: string + value: + description: Value is the value of the variable + type: string + required: + - name + - value + type: object + type: array + name: + type: string + type: object + repoURL: + description: RepoURL is the URL to the repository (Git or + Helm) that contains the application manifests + type: string + targetRevision: + description: TargetRevision defines the revision of the source + to sync the application to. In case of Git, this can be + commit, tag, or branch. If omitted, will equal to HEAD. + In case of Helm, this is a semver tag for the Chart's version. + type: string + required: + - repoURL + type: object + syncOptions: + description: SyncOptions provide per-sync sync-options, e.g. Validate=false + items: + type: string + type: array + syncStrategy: + description: SyncStrategy describes how to perform the sync + properties: + apply: + description: Apply will perform a `kubectl apply` to perform + the sync. + properties: + force: + description: Force indicates whether or not to supply + the --force flag to `kubectl apply`. The --force flag + deletes and re-create the resource, when PATCH encounters + conflict and has retried for 5 times. + type: boolean + type: object + hook: + description: Hook will submit any referenced resources to + perform the sync. This is the default strategy + properties: + force: + description: Force indicates whether or not to supply + the --force flag to `kubectl apply`. The --force flag + deletes and re-create the resource, when PATCH encounters + conflict and has retried for 5 times. + type: boolean + type: object + type: object + type: object + type: object + spec: + description: ApplicationSpec represents desired application state. Contains + link to repository with application definition and additional parameters + link definition revision. + properties: + destination: + description: Destination is a reference to the target Kubernetes server + and namespace + properties: + name: + description: Name is an alternate way of specifying the target + cluster by its symbolic name + type: string + namespace: + description: Namespace specifies the target namespace for the + application's resources. The namespace will only be set for + namespace-scoped resources that have not set a value for .metadata.namespace + type: string + server: + description: Server specifies the URL of the target cluster and + must be set to the Kubernetes control plane API + type: string + type: object + ignoreDifferences: + description: IgnoreDifferences is a list of resources and their fields + which should be ignored during comparison + items: + description: ResourceIgnoreDifferences contains resource filter + and list of json paths which should be ignored during comparison + with live state. + properties: + group: + type: string + jsonPointers: + items: + type: string + type: array + kind: + type: string + name: + type: string + namespace: + type: string + required: + - jsonPointers + - kind + type: object + type: array + info: + description: Info contains a list of information (URLs, email addresses, + and plain text) that relates to the application + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + project: + description: Project is a reference to the project this application + belongs to. The empty string means that application belongs to the + 'default' project. + type: string + revisionHistoryLimit: + description: RevisionHistoryLimit limits the number of items kept + in the application's revision history, which is used for informational + purposes as well as for rollbacks to previous versions. This should + only be changed in exceptional circumstances. Setting to zero will + store no history. This will reduce storage used. Increasing will + increase the space used to store the history, so we do not recommend + increasing it. Default is 10. + format: int64 + type: integer + source: + description: Source is a reference to the location of the application's + manifests or chart + properties: + chart: + description: Chart is a Helm chart name, and must be specified + for applications sourced from a Helm repo. + type: string + directory: + description: Directory holds path/directory specific options + properties: + exclude: + description: Exclude contains a glob pattern to match paths + against that should be explicitly excluded from being used + during manifest generation + type: string + include: + description: Include contains a glob pattern to match paths + against that should be explicitly included during manifest + generation + type: string + jsonnet: + description: Jsonnet holds options specific to Jsonnet + properties: + extVars: + description: ExtVars is a list of Jsonnet External Variables + items: + description: JsonnetVar represents a variable to be + passed to jsonnet during manifest generation + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + libs: + description: Additional library search dirs + items: + type: string + type: array + tlas: + description: TLAS is a list of Jsonnet Top-level Arguments + items: + description: JsonnetVar represents a variable to be + passed to jsonnet during manifest generation + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + recurse: + description: Recurse specifies whether to scan a directory + recursively for manifests + type: boolean + type: object + helm: + description: Helm holds helm specific options + properties: + fileParameters: + description: FileParameters are file parameters to the helm + template + items: + description: HelmFileParameter is a file parameter that's + passed to helm template during manifest generation + properties: + name: + description: Name is the name of the Helm parameter + type: string + path: + description: Path is the path to the file containing + the values for the Helm parameter + type: string + type: object + type: array + parameters: + description: Parameters is a list of Helm parameters which + are passed to the helm template command upon manifest generation + items: + description: HelmParameter is a parameter that's passed + to helm template during manifest generation + properties: + forceString: + description: ForceString determines whether to tell + Helm to interpret booleans and numbers as strings + type: boolean + name: + description: Name is the name of the Helm parameter + type: string + value: + description: Value is the value for the Helm parameter + type: string + type: object + type: array + releaseName: + description: ReleaseName is the Helm release name to use. + If omitted it will use the application name + type: string + valueFiles: + description: ValuesFiles is a list of Helm value files to + use when generating a template + items: + type: string + type: array + values: + description: Values specifies Helm values to be passed to + helm template, typically defined as a block + type: string + version: + description: Version is the Helm version to use for templating + (either "2" or "3") + type: string + type: object + ksonnet: + description: Ksonnet holds ksonnet specific options + properties: + environment: + description: Environment is a ksonnet application environment + name + type: string + parameters: + description: Parameters are a list of ksonnet component parameter + override values + items: + description: KsonnetParameter is a ksonnet component parameter + properties: + component: + type: string + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + kustomize: + description: Kustomize holds kustomize specific options + properties: + commonAnnotations: + additionalProperties: + type: string + description: CommonAnnotations is a list of additional annotations + to add to rendered manifests + type: object + commonLabels: + additionalProperties: + type: string + description: CommonLabels is a list of additional labels to + add to rendered manifests + type: object + images: + description: Images is a list of Kustomize image override + specifications + items: + description: KustomizeImage represents a Kustomize image + definition in the format [old_image_name=]: + type: string + type: array + namePrefix: + description: NamePrefix is a prefix appended to resources + for Kustomize apps + type: string + nameSuffix: + description: NameSuffix is a suffix appended to resources + for Kustomize apps + type: string + version: + description: Version controls which version of Kustomize to + use for rendering manifests + type: string + type: object + path: + description: Path is a directory path within the Git repository, + and is only valid for applications sourced from Git. + type: string + plugin: + description: ConfigManagementPlugin holds config management plugin + specific options + properties: + env: + description: Env is a list of environment variable entries + items: + description: EnvEntry represents an entry in the application's + environment + properties: + name: + description: Name is the name of the variable, usually + expressed in uppercase + type: string + value: + description: Value is the value of the variable + type: string + required: + - name + - value + type: object + type: array + name: + type: string + type: object + repoURL: + description: RepoURL is the URL to the repository (Git or Helm) + that contains the application manifests + type: string + targetRevision: + description: TargetRevision defines the revision of the source + to sync the application to. In case of Git, this can be commit, + tag, or branch. If omitted, will equal to HEAD. In case of Helm, + this is a semver tag for the Chart's version. + type: string + required: + - repoURL + type: object + syncPolicy: + description: SyncPolicy controls when and how a sync will be performed + properties: + automated: + description: Automated will keep an application synced to the + target revision + properties: + allowEmpty: + description: 'AllowEmpty allows apps have zero live resources + (default: false)' + type: boolean + prune: + description: 'Prune specifies whether to delete resources + from the cluster that are not found in the sources anymore + as part of automated sync (default: false)' + type: boolean + selfHeal: + description: 'SelfHeal specifes whether to revert resources + back to their desired state upon modification in the cluster + (default: false)' + type: boolean + type: object + retry: + description: Retry controls failed sync retry behavior + properties: + backoff: + description: Backoff controls how to backoff on subsequent + retries of failed syncs + properties: + duration: + description: Duration is the amount to back off. Default + unit is seconds, but could also be a duration (e.g. + "2m", "1h") + type: string + factor: + description: Factor is a factor to multiply the base duration + after each failed retry + format: int64 + type: integer + maxDuration: + description: MaxDuration is the maximum amount of time + allowed for the backoff strategy + type: string + type: object + limit: + description: Limit is the maximum number of attempts for retrying + a failed sync. If set to 0, no retries will be performed. + format: int64 + type: integer + type: object + syncOptions: + description: Options allow you to specify whole app sync-options + items: + type: string + type: array + type: object + required: + - destination + - project + - source + type: object + status: + description: ApplicationStatus contains status information for the application + properties: + conditions: + description: Conditions is a list of currently observed application + conditions + items: + description: ApplicationCondition contains details about an application + condition, which is usally an error or warning + properties: + lastTransitionTime: + description: LastTransitionTime is the time the condition was + last observed + format: date-time + type: string + message: + description: Message contains human-readable message indicating + details about condition + type: string + type: + description: Type is an application condition type + type: string + required: + - message + - type + type: object + type: array + health: + description: Health contains information about the application's current + health status + properties: + message: + description: Message is a human-readable informational message + describing the health status + type: string + status: + description: Status holds the status code of the application or + resource + type: string + type: object + history: + description: History contains information about the application's + sync history + items: + description: RevisionHistory contains history information about + a previous sync + properties: + deployStartedAt: + description: DeployStartedAt holds the time the sync operation + started + format: date-time + type: string + deployedAt: + description: DeployedAt holds the time the sync operation completed + format: date-time + type: string + id: + description: ID is an auto incrementing identifier of the RevisionHistory + format: int64 + type: integer + revision: + description: Revision holds the revision the sync was performed + against + type: string + source: + description: Source is a reference to the application source + used for the sync operation + properties: + chart: + description: Chart is a Helm chart name, and must be specified + for applications sourced from a Helm repo. + type: string + directory: + description: Directory holds path/directory specific options + properties: + exclude: + description: Exclude contains a glob pattern to match + paths against that should be explicitly excluded from + being used during manifest generation + type: string + include: + description: Include contains a glob pattern to match + paths against that should be explicitly included during + manifest generation + type: string + jsonnet: + description: Jsonnet holds options specific to Jsonnet + properties: + extVars: + description: ExtVars is a list of Jsonnet External + Variables + items: + description: JsonnetVar represents a variable + to be passed to jsonnet during manifest generation + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + libs: + description: Additional library search dirs + items: + type: string + type: array + tlas: + description: TLAS is a list of Jsonnet Top-level + Arguments + items: + description: JsonnetVar represents a variable + to be passed to jsonnet during manifest generation + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + recurse: + description: Recurse specifies whether to scan a directory + recursively for manifests + type: boolean + type: object + helm: + description: Helm holds helm specific options + properties: + fileParameters: + description: FileParameters are file parameters to the + helm template + items: + description: HelmFileParameter is a file parameter + that's passed to helm template during manifest generation + properties: + name: + description: Name is the name of the Helm parameter + type: string + path: + description: Path is the path to the file containing + the values for the Helm parameter + type: string + type: object + type: array + parameters: + description: Parameters is a list of Helm parameters + which are passed to the helm template command upon + manifest generation + items: + description: HelmParameter is a parameter that's passed + to helm template during manifest generation + properties: + forceString: + description: ForceString determines whether to + tell Helm to interpret booleans and numbers + as strings + type: boolean + name: + description: Name is the name of the Helm parameter + type: string + value: + description: Value is the value for the Helm parameter + type: string + type: object + type: array + releaseName: + description: ReleaseName is the Helm release name to + use. If omitted it will use the application name + type: string + valueFiles: + description: ValuesFiles is a list of Helm value files + to use when generating a template + items: + type: string + type: array + values: + description: Values specifies Helm values to be passed + to helm template, typically defined as a block + type: string + version: + description: Version is the Helm version to use for + templating (either "2" or "3") + type: string + type: object + ksonnet: + description: Ksonnet holds ksonnet specific options + properties: + environment: + description: Environment is a ksonnet application environment + name + type: string + parameters: + description: Parameters are a list of ksonnet component + parameter override values + items: + description: KsonnetParameter is a ksonnet component + parameter + properties: + component: + type: string + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + kustomize: + description: Kustomize holds kustomize specific options + properties: + commonAnnotations: + additionalProperties: + type: string + description: CommonAnnotations is a list of additional + annotations to add to rendered manifests + type: object + commonLabels: + additionalProperties: + type: string + description: CommonLabels is a list of additional labels + to add to rendered manifests + type: object + images: + description: Images is a list of Kustomize image override + specifications + items: + description: KustomizeImage represents a Kustomize + image definition in the format [old_image_name=]: + type: string + type: array + namePrefix: + description: NamePrefix is a prefix appended to resources + for Kustomize apps + type: string + nameSuffix: + description: NameSuffix is a suffix appended to resources + for Kustomize apps + type: string + version: + description: Version controls which version of Kustomize + to use for rendering manifests + type: string + type: object + path: + description: Path is a directory path within the Git repository, + and is only valid for applications sourced from Git. + type: string + plugin: + description: ConfigManagementPlugin holds config management + plugin specific options + properties: + env: + description: Env is a list of environment variable entries + items: + description: EnvEntry represents an entry in the application's + environment + properties: + name: + description: Name is the name of the variable, + usually expressed in uppercase + type: string + value: + description: Value is the value of the variable + type: string + required: + - name + - value + type: object + type: array + name: + type: string + type: object + repoURL: + description: RepoURL is the URL to the repository (Git or + Helm) that contains the application manifests + type: string + targetRevision: + description: TargetRevision defines the revision of the + source to sync the application to. In case of Git, this + can be commit, tag, or branch. If omitted, will equal + to HEAD. In case of Helm, this is a semver tag for the + Chart's version. + type: string + required: + - repoURL + type: object + required: + - deployedAt + - id + - revision + type: object + type: array + observedAt: + description: 'ObservedAt indicates when the application state was + updated without querying latest git state Deprecated: controller + no longer updates ObservedAt field' + format: date-time + type: string + operationState: + description: OperationState contains information about any ongoing + operations, such as a sync + properties: + finishedAt: + description: FinishedAt contains time of operation completion + format: date-time + type: string + message: + description: Message holds any pertinent messages when attempting + to perform operation (typically errors). + type: string + operation: + description: Operation is the original requested operation + properties: + info: + description: Info is a list of informational items for this + operation + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + initiatedBy: + description: InitiatedBy contains information about who initiated + the operations + properties: + automated: + description: Automated is set to true if operation was + initiated automatically by the application controller. + type: boolean + username: + description: Username contains the name of a user who + started operation + type: string + type: object + retry: + description: Retry controls the strategy to apply if a sync + fails + properties: + backoff: + description: Backoff controls how to backoff on subsequent + retries of failed syncs + properties: + duration: + description: Duration is the amount to back off. Default + unit is seconds, but could also be a duration (e.g. + "2m", "1h") + type: string + factor: + description: Factor is a factor to multiply the base + duration after each failed retry + format: int64 + type: integer + maxDuration: + description: MaxDuration is the maximum amount of + time allowed for the backoff strategy + type: string + type: object + limit: + description: Limit is the maximum number of attempts for + retrying a failed sync. If set to 0, no retries will + be performed. + format: int64 + type: integer + type: object + sync: + description: Sync contains parameters for the operation + properties: + dryRun: + description: DryRun specifies to perform a `kubectl apply + --dry-run` without actually performing the sync + type: boolean + manifests: + description: Manifests is an optional field that overrides + sync source with a local directory for development + items: + type: string + type: array + prune: + description: Prune specifies to delete resources from + the cluster that are no longer tracked in git + type: boolean + resources: + description: Resources describes which resources shall + be part of the sync + items: + description: SyncOperationResource contains resources + to sync. + properties: + group: + type: string + kind: + type: string + name: + type: string + namespace: + type: string + required: + - kind + - name + type: object + type: array + revision: + description: Revision is the revision (Git) or chart version + (Helm) which to sync the application to If omitted, + will use the revision specified in app spec. + type: string + source: + description: Source overrides the source definition set + in the application. This is typically set in a Rollback + operation and is nil during a Sync operation + properties: + chart: + description: Chart is a Helm chart name, and must + be specified for applications sourced from a Helm + repo. + type: string + directory: + description: Directory holds path/directory specific + options + properties: + exclude: + description: Exclude contains a glob pattern to + match paths against that should be explicitly + excluded from being used during manifest generation + type: string + include: + description: Include contains a glob pattern to + match paths against that should be explicitly + included during manifest generation + type: string + jsonnet: + description: Jsonnet holds options specific to + Jsonnet + properties: + extVars: + description: ExtVars is a list of Jsonnet + External Variables + items: + description: JsonnetVar represents a variable + to be passed to jsonnet during manifest + generation + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + libs: + description: Additional library search dirs + items: + type: string + type: array + tlas: + description: TLAS is a list of Jsonnet Top-level + Arguments + items: + description: JsonnetVar represents a variable + to be passed to jsonnet during manifest + generation + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + recurse: + description: Recurse specifies whether to scan + a directory recursively for manifests + type: boolean + type: object + helm: + description: Helm holds helm specific options + properties: + fileParameters: + description: FileParameters are file parameters + to the helm template + items: + description: HelmFileParameter is a file parameter + that's passed to helm template during manifest + generation + properties: + name: + description: Name is the name of the Helm + parameter + type: string + path: + description: Path is the path to the file + containing the values for the Helm parameter + type: string + type: object + type: array + parameters: + description: Parameters is a list of Helm parameters + which are passed to the helm template command + upon manifest generation + items: + description: HelmParameter is a parameter that's + passed to helm template during manifest generation + properties: + forceString: + description: ForceString determines whether + to tell Helm to interpret booleans and + numbers as strings + type: boolean + name: + description: Name is the name of the Helm + parameter + type: string + value: + description: Value is the value for the + Helm parameter + type: string + type: object + type: array + releaseName: + description: ReleaseName is the Helm release name + to use. If omitted it will use the application + name + type: string + valueFiles: + description: ValuesFiles is a list of Helm value + files to use when generating a template + items: + type: string + type: array + values: + description: Values specifies Helm values to be + passed to helm template, typically defined as + a block + type: string + version: + description: Version is the Helm version to use + for templating (either "2" or "3") + type: string + type: object + ksonnet: + description: Ksonnet holds ksonnet specific options + properties: + environment: + description: Environment is a ksonnet application + environment name + type: string + parameters: + description: Parameters are a list of ksonnet + component parameter override values + items: + description: KsonnetParameter is a ksonnet component + parameter + properties: + component: + type: string + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + kustomize: + description: Kustomize holds kustomize specific options + properties: + commonAnnotations: + additionalProperties: + type: string + description: CommonAnnotations is a list of additional + annotations to add to rendered manifests + type: object + commonLabels: + additionalProperties: + type: string + description: CommonLabels is a list of additional + labels to add to rendered manifests + type: object + images: + description: Images is a list of Kustomize image + override specifications + items: + description: KustomizeImage represents a Kustomize + image definition in the format [old_image_name=]: + type: string + type: array + namePrefix: + description: NamePrefix is a prefix appended to + resources for Kustomize apps + type: string + nameSuffix: + description: NameSuffix is a suffix appended to + resources for Kustomize apps + type: string + version: + description: Version controls which version of + Kustomize to use for rendering manifests + type: string + type: object + path: + description: Path is a directory path within the Git + repository, and is only valid for applications sourced + from Git. + type: string + plugin: + description: ConfigManagementPlugin holds config management + plugin specific options + properties: + env: + description: Env is a list of environment variable + entries + items: + description: EnvEntry represents an entry in + the application's environment + properties: + name: + description: Name is the name of the variable, + usually expressed in uppercase + type: string + value: + description: Value is the value of the variable + type: string + required: + - name + - value + type: object + type: array + name: + type: string + type: object + repoURL: + description: RepoURL is the URL to the repository + (Git or Helm) that contains the application manifests + type: string + targetRevision: + description: TargetRevision defines the revision of + the source to sync the application to. In case of + Git, this can be commit, tag, or branch. If omitted, + will equal to HEAD. In case of Helm, this is a semver + tag for the Chart's version. + type: string + required: + - repoURL + type: object + syncOptions: + description: SyncOptions provide per-sync sync-options, + e.g. Validate=false + items: + type: string + type: array + syncStrategy: + description: SyncStrategy describes how to perform the + sync + properties: + apply: + description: Apply will perform a `kubectl apply` + to perform the sync. + properties: + force: + description: Force indicates whether or not to + supply the --force flag to `kubectl apply`. + The --force flag deletes and re-create the resource, + when PATCH encounters conflict and has retried + for 5 times. + type: boolean + type: object + hook: + description: Hook will submit any referenced resources + to perform the sync. This is the default strategy + properties: + force: + description: Force indicates whether or not to + supply the --force flag to `kubectl apply`. + The --force flag deletes and re-create the resource, + when PATCH encounters conflict and has retried + for 5 times. + type: boolean + type: object + type: object + type: object + type: object + phase: + description: Phase is the current phase of the operation + type: string + retryCount: + description: RetryCount contains time of operation retries + format: int64 + type: integer + startedAt: + description: StartedAt contains time of operation start + format: date-time + type: string + syncResult: + description: SyncResult is the result of a Sync operation + properties: + resources: + description: Resources contains a list of sync result items + for each individual resource in a sync operation + items: + description: ResourceResult holds the operation result details + of a specific resource + properties: + group: + description: Group specifies the API group of the resource + type: string + hookPhase: + description: HookPhase contains the state of any operation + associated with this resource OR hook This can also + contain values for non-hook resources. + type: string + hookType: + description: HookType specifies the type of the hook. + Empty for non-hook resources + type: string + kind: + description: Kind specifies the API kind of the resource + type: string + message: + description: Message contains an informational or error + message for the last sync OR operation + type: string + name: + description: Name specifies the name of the resource + type: string + namespace: + description: Namespace specifies the target namespace + of the resource + type: string + status: + description: Status holds the final result of the sync. + Will be empty if the resources is yet to be applied/pruned + and is always zero-value for hooks + type: string + syncPhase: + description: SyncPhase indicates the particular phase + of the sync that this result was acquired in + type: string + version: + description: Version specifies the API version of the + resource + type: string + required: + - group + - kind + - name + - namespace + - version + type: object + type: array + revision: + description: Revision holds the revision this sync operation + was performed to + type: string + source: + description: Source records the application source information + of the sync, used for comparing auto-sync + properties: + chart: + description: Chart is a Helm chart name, and must be specified + for applications sourced from a Helm repo. + type: string + directory: + description: Directory holds path/directory specific options + properties: + exclude: + description: Exclude contains a glob pattern to match + paths against that should be explicitly excluded + from being used during manifest generation + type: string + include: + description: Include contains a glob pattern to match + paths against that should be explicitly included + during manifest generation + type: string + jsonnet: + description: Jsonnet holds options specific to Jsonnet + properties: + extVars: + description: ExtVars is a list of Jsonnet External + Variables + items: + description: JsonnetVar represents a variable + to be passed to jsonnet during manifest generation + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + libs: + description: Additional library search dirs + items: + type: string + type: array + tlas: + description: TLAS is a list of Jsonnet Top-level + Arguments + items: + description: JsonnetVar represents a variable + to be passed to jsonnet during manifest generation + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + recurse: + description: Recurse specifies whether to scan a directory + recursively for manifests + type: boolean + type: object + helm: + description: Helm holds helm specific options + properties: + fileParameters: + description: FileParameters are file parameters to + the helm template + items: + description: HelmFileParameter is a file parameter + that's passed to helm template during manifest + generation + properties: + name: + description: Name is the name of the Helm parameter + type: string + path: + description: Path is the path to the file containing + the values for the Helm parameter + type: string + type: object + type: array + parameters: + description: Parameters is a list of Helm parameters + which are passed to the helm template command upon + manifest generation + items: + description: HelmParameter is a parameter that's + passed to helm template during manifest generation + properties: + forceString: + description: ForceString determines whether + to tell Helm to interpret booleans and numbers + as strings + type: boolean + name: + description: Name is the name of the Helm parameter + type: string + value: + description: Value is the value for the Helm + parameter + type: string + type: object + type: array + releaseName: + description: ReleaseName is the Helm release name + to use. If omitted it will use the application name + type: string + valueFiles: + description: ValuesFiles is a list of Helm value files + to use when generating a template + items: + type: string + type: array + values: + description: Values specifies Helm values to be passed + to helm template, typically defined as a block + type: string + version: + description: Version is the Helm version to use for + templating (either "2" or "3") + type: string + type: object + ksonnet: + description: Ksonnet holds ksonnet specific options + properties: + environment: + description: Environment is a ksonnet application + environment name + type: string + parameters: + description: Parameters are a list of ksonnet component + parameter override values + items: + description: KsonnetParameter is a ksonnet component + parameter + properties: + component: + type: string + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + kustomize: + description: Kustomize holds kustomize specific options + properties: + commonAnnotations: + additionalProperties: + type: string + description: CommonAnnotations is a list of additional + annotations to add to rendered manifests + type: object + commonLabels: + additionalProperties: + type: string + description: CommonLabels is a list of additional + labels to add to rendered manifests + type: object + images: + description: Images is a list of Kustomize image override + specifications + items: + description: KustomizeImage represents a Kustomize + image definition in the format [old_image_name=]: + type: string + type: array + namePrefix: + description: NamePrefix is a prefix appended to resources + for Kustomize apps + type: string + nameSuffix: + description: NameSuffix is a suffix appended to resources + for Kustomize apps + type: string + version: + description: Version controls which version of Kustomize + to use for rendering manifests + type: string + type: object + path: + description: Path is a directory path within the Git repository, + and is only valid for applications sourced from Git. + type: string + plugin: + description: ConfigManagementPlugin holds config management + plugin specific options + properties: + env: + description: Env is a list of environment variable + entries + items: + description: EnvEntry represents an entry in the + application's environment + properties: + name: + description: Name is the name of the variable, + usually expressed in uppercase + type: string + value: + description: Value is the value of the variable + type: string + required: + - name + - value + type: object + type: array + name: + type: string + type: object + repoURL: + description: RepoURL is the URL to the repository (Git + or Helm) that contains the application manifests + type: string + targetRevision: + description: TargetRevision defines the revision of the + source to sync the application to. In case of Git, this + can be commit, tag, or branch. If omitted, will equal + to HEAD. In case of Helm, this is a semver tag for the + Chart's version. + type: string + required: + - repoURL + type: object + required: + - revision + type: object + required: + - operation + - phase + - startedAt + type: object + reconciledAt: + description: ReconciledAt indicates when the application state was + reconciled using the latest git version + format: date-time + type: string + resources: + description: Resources is a list of Kubernetes resources managed by + this application + items: + description: 'ResourceStatus holds the current sync and health status + of a resource TODO: describe members of this type' + properties: + group: + type: string + health: + description: HealthStatus contains information about the currently + observed health state of an application or resource + properties: + message: + description: Message is a human-readable informational message + describing the health status + type: string + status: + description: Status holds the status code of the application + or resource + type: string + type: object + hook: + type: boolean + kind: + type: string + name: + type: string + namespace: + type: string + requiresPruning: + type: boolean + status: + description: SyncStatusCode is a type which represents possible + comparison results + type: string + version: + type: string + type: object + type: array + sourceType: + description: SourceType specifies the type of this application + type: string + summary: + description: Summary contains a list of URLs and container images + used by this application + properties: + externalURLs: + description: ExternalURLs holds all external URLs of application + child resources. + items: + type: string + type: array + images: + description: Images holds all images of application child resources. + items: + type: string + type: array + type: object + sync: + description: Sync contains information about the application's current + sync status + properties: + comparedTo: + description: ComparedTo contains information about what has been + compared + properties: + destination: + description: Destination is a reference to the application's + destination used for comparison + properties: + name: + description: Name is an alternate way of specifying the + target cluster by its symbolic name + type: string + namespace: + description: Namespace specifies the target namespace + for the application's resources. The namespace will + only be set for namespace-scoped resources that have + not set a value for .metadata.namespace + type: string + server: + description: Server specifies the URL of the target cluster + and must be set to the Kubernetes control plane API + type: string + type: object + source: + description: Source is a reference to the application's source + used for comparison + properties: + chart: + description: Chart is a Helm chart name, and must be specified + for applications sourced from a Helm repo. + type: string + directory: + description: Directory holds path/directory specific options + properties: + exclude: + description: Exclude contains a glob pattern to match + paths against that should be explicitly excluded + from being used during manifest generation + type: string + include: + description: Include contains a glob pattern to match + paths against that should be explicitly included + during manifest generation + type: string + jsonnet: + description: Jsonnet holds options specific to Jsonnet + properties: + extVars: + description: ExtVars is a list of Jsonnet External + Variables + items: + description: JsonnetVar represents a variable + to be passed to jsonnet during manifest generation + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + libs: + description: Additional library search dirs + items: + type: string + type: array + tlas: + description: TLAS is a list of Jsonnet Top-level + Arguments + items: + description: JsonnetVar represents a variable + to be passed to jsonnet during manifest generation + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + recurse: + description: Recurse specifies whether to scan a directory + recursively for manifests + type: boolean + type: object + helm: + description: Helm holds helm specific options + properties: + fileParameters: + description: FileParameters are file parameters to + the helm template + items: + description: HelmFileParameter is a file parameter + that's passed to helm template during manifest + generation + properties: + name: + description: Name is the name of the Helm parameter + type: string + path: + description: Path is the path to the file containing + the values for the Helm parameter + type: string + type: object + type: array + parameters: + description: Parameters is a list of Helm parameters + which are passed to the helm template command upon + manifest generation + items: + description: HelmParameter is a parameter that's + passed to helm template during manifest generation + properties: + forceString: + description: ForceString determines whether + to tell Helm to interpret booleans and numbers + as strings + type: boolean + name: + description: Name is the name of the Helm parameter + type: string + value: + description: Value is the value for the Helm + parameter + type: string + type: object + type: array + releaseName: + description: ReleaseName is the Helm release name + to use. If omitted it will use the application name + type: string + valueFiles: + description: ValuesFiles is a list of Helm value files + to use when generating a template + items: + type: string + type: array + values: + description: Values specifies Helm values to be passed + to helm template, typically defined as a block + type: string + version: + description: Version is the Helm version to use for + templating (either "2" or "3") + type: string + type: object + ksonnet: + description: Ksonnet holds ksonnet specific options + properties: + environment: + description: Environment is a ksonnet application + environment name + type: string + parameters: + description: Parameters are a list of ksonnet component + parameter override values + items: + description: KsonnetParameter is a ksonnet component + parameter + properties: + component: + type: string + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + kustomize: + description: Kustomize holds kustomize specific options + properties: + commonAnnotations: + additionalProperties: + type: string + description: CommonAnnotations is a list of additional + annotations to add to rendered manifests + type: object + commonLabels: + additionalProperties: + type: string + description: CommonLabels is a list of additional + labels to add to rendered manifests + type: object + images: + description: Images is a list of Kustomize image override + specifications + items: + description: KustomizeImage represents a Kustomize + image definition in the format [old_image_name=]: + type: string + type: array + namePrefix: + description: NamePrefix is a prefix appended to resources + for Kustomize apps + type: string + nameSuffix: + description: NameSuffix is a suffix appended to resources + for Kustomize apps + type: string + version: + description: Version controls which version of Kustomize + to use for rendering manifests + type: string + type: object + path: + description: Path is a directory path within the Git repository, + and is only valid for applications sourced from Git. + type: string + plugin: + description: ConfigManagementPlugin holds config management + plugin specific options + properties: + env: + description: Env is a list of environment variable + entries + items: + description: EnvEntry represents an entry in the + application's environment + properties: + name: + description: Name is the name of the variable, + usually expressed in uppercase + type: string + value: + description: Value is the value of the variable + type: string + required: + - name + - value + type: object + type: array + name: + type: string + type: object + repoURL: + description: RepoURL is the URL to the repository (Git + or Helm) that contains the application manifests + type: string + targetRevision: + description: TargetRevision defines the revision of the + source to sync the application to. In case of Git, this + can be commit, tag, or branch. If omitted, will equal + to HEAD. In case of Helm, this is a semver tag for the + Chart's version. + type: string + required: + - repoURL + type: object + required: + - destination + - source + type: object + revision: + description: Revision contains information about the revision + the comparison has been performed to + type: string + status: + description: Status is the sync state of the comparison + type: string + required: + - status + type: object + type: object + required: + - metadata + - spec + type: object + served: true + storage: true + subresources: {} +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.3.0 + creationTimestamp: null + name: applicationsets.argoproj.io +spec: + group: argoproj.io + names: + kind: ApplicationSet + listKind: ApplicationSetList + plural: applicationsets + shortNames: + - appset + - appsets + singular: applicationset + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: ApplicationSet is a set of Application resources + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: ApplicationSetSpec represents a class of application set + state. + properties: + generators: + items: + description: ApplicationSetGenerator include list item info + properties: + clusterDecisionResource: + description: DuckType defines a generator to match against clusters + registered with ArgoCD. + properties: + configMapRef: + description: ConfigMapRef is a ConfigMap with the duck type + definitions needed to retreive the data this + includes apiVersion(group/version), kind, matchKey and + validation settings Name is the resource name of the kind, + group and version, defined in the ConfigMapRef RequeueAfterSeconds + is how long before the duckType will be rechecked for + a change + type: string + labelSelector: + description: A label selector is a label query over a set + of resources. The result of matchLabels and matchExpressions + are ANDed. An empty label selector matches all objects. + A null label selector matches no objects. + properties: + matchExpressions: + description: matchExpressions is a list of label selector + requirements. The requirements are ANDed. + items: + description: A label selector requirement is a selector + that contains values, a key, and an operator that + relates the key and values. + properties: + key: + description: key is the label key that the selector + applies to. + type: string + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are In, + NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. + If the operator is In or NotIn, the values array + must be non-empty. If the operator is Exists + or DoesNotExist, the values array must be empty. + This array is replaced during a strategic merge + patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. + A single {key,value} in the matchLabels map is equivalent + to an element of matchExpressions, whose key field + is "key", the operator is "In", and the values array + contains only "value". The requirements are ANDed. + type: object + type: object + name: + type: string + requeueAfterSeconds: + format: int64 + type: integer + template: + description: ApplicationSetTemplate represents argocd ApplicationSpec + properties: + metadata: + description: ApplicationSetTemplateMeta represents the + Argo CD application fields that may be used for Applications + generated from the ApplicationSet (based on metav1.ObjectMeta) + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + name: + type: string + namespace: + type: string + type: object + spec: + description: ApplicationSpec represents desired application + state. Contains link to repository with application + definition and additional parameters link definition + revision. + properties: + destination: + description: Destination overrides the kubernetes + server and namespace defined in the environment + ksonnet app.yaml + properties: + name: + description: Name of the destination cluster + which can be used instead of server (url) + field + type: string + namespace: + description: Namespace overrides the environment + namespace value in the ksonnet app.yaml + type: string + server: + description: Server overrides the environment + server value in the ksonnet app.yaml + type: string + type: object + ignoreDifferences: + description: IgnoreDifferences controls resources + fields which should be ignored during comparison + items: + description: ResourceIgnoreDifferences contains + resource filter and list of json paths which + should be ignored during comparison with live + state. + properties: + group: + type: string + jsonPointers: + items: + type: string + type: array + kind: + type: string + name: + type: string + namespace: + type: string + required: + - jsonPointers + - kind + type: object + type: array + info: + description: Infos contains a list of useful information + (URLs, email addresses, and plain text) that relates + to the application + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + project: + description: Project is a application project name. + Empty name means that application belongs to 'default' + project. + type: string + revisionHistoryLimit: + description: This limits this number of items kept + in the apps revision history. This should only + be changed in exceptional circumstances. Setting + to zero will store no history. This will reduce + storage used. Increasing will increase the space + used to store the history, so we do not recommend + increasing it. Default is 10. + format: int64 + type: integer + source: + description: Source is a reference to the location + ksonnet application definition + properties: + chart: + description: Chart is a Helm chart name + type: string + directory: + description: Directory holds path/directory + specific options + properties: + exclude: + type: string + jsonnet: + description: ApplicationSourceJsonnet holds + jsonnet specific options + properties: + extVars: + description: ExtVars is a list of Jsonnet + External Variables + items: + description: JsonnetVar is a jsonnet + variable + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + libs: + description: Additional library search + dirs + items: + type: string + type: array + tlas: + description: TLAS is a list of Jsonnet + Top-level Arguments + items: + description: JsonnetVar is a jsonnet + variable + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + recurse: + type: boolean + type: object + helm: + description: Helm holds helm specific options + properties: + fileParameters: + description: FileParameters are file parameters + to the helm template + items: + description: HelmFileParameter is a file + parameter to a helm template + properties: + name: + description: Name is the name of the + helm parameter + type: string + path: + description: Path is the path value + for the helm parameter + type: string + type: object + type: array + parameters: + description: Parameters are parameters to + the helm template + items: + description: HelmParameter is a parameter + to a helm template + properties: + forceString: + description: ForceString determines + whether to tell Helm to interpret + booleans and numbers as strings + type: boolean + name: + description: Name is the name of the + helm parameter + type: string + value: + description: Value is the value for + the helm parameter + type: string + type: object + type: array + releaseName: + description: The Helm release name. If omitted + it will use the application name + type: string + valueFiles: + description: ValuesFiles is a list of Helm + value files to use when generating a template + items: + type: string + type: array + values: + description: Values is Helm values, typically + defined as a block + type: string + version: + description: Version is the Helm version + to use for templating with + type: string + type: object + ksonnet: + description: Ksonnet holds ksonnet specific + options + properties: + environment: + description: Environment is a ksonnet application + environment name + type: string + parameters: + description: Parameters are a list of ksonnet + component parameter override values + items: + description: KsonnetParameter is a ksonnet + component parameter + properties: + component: + type: string + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + kustomize: + description: Kustomize holds kustomize specific + options + properties: + commonAnnotations: + additionalProperties: + type: string + description: CommonAnnotations adds additional + kustomize commonAnnotations + type: object + commonLabels: + additionalProperties: + type: string + description: CommonLabels adds additional + kustomize commonLabels + type: object + images: + description: Images are kustomize image + overrides + items: + type: string + type: array + namePrefix: + description: NamePrefix is a prefix appended + to resources for kustomize apps + type: string + nameSuffix: + description: NameSuffix is a suffix appended + to resources for kustomize apps + type: string + version: + description: Version contains optional Kustomize + version + type: string + type: object + path: + description: Path is a directory path within + the Git repository + type: string + plugin: + description: ConfigManagementPlugin holds config + management plugin specific options + properties: + env: + items: + properties: + name: + description: the name, usually uppercase + type: string + value: + description: the value + type: string + required: + - name + - value + type: object + type: array + name: + type: string + type: object + repoURL: + description: RepoURL is the repository URL of + the application manifests + type: string + targetRevision: + description: TargetRevision defines the commit, + tag, or branch in which to sync the application + to. If omitted, will sync to HEAD + type: string + required: + - repoURL + type: object + syncPolicy: + description: SyncPolicy controls when a sync will + be performed + properties: + automated: + description: Automated will keep an application + synced to the target revision + properties: + allowEmpty: + description: 'AllowEmpty allows apps have + zero live resources (default: false)' + type: boolean + prune: + description: 'Prune will prune resources + automatically as part of automated sync + (default: false)' + type: boolean + selfHeal: + description: 'SelfHeal enables auto-syncing + if (default: false)' + type: boolean + type: object + retry: + description: Retry controls failed sync retry + behavior + properties: + backoff: + description: Backoff is a backoff strategy + properties: + duration: + description: Duration is the amount + to back off. Default unit is seconds, + but could also be a duration (e.g. + "2m", "1h") + type: string + factor: + description: Factor is a factor to multiply + the base duration after each failed + retry + format: int64 + type: integer + maxDuration: + description: MaxDuration is the maximum + amount of time allowed for the backoff + strategy + type: string + type: object + limit: + description: Limit is the maximum number + of attempts when retrying a container + format: int64 + type: integer + type: object + syncOptions: + description: Options allow you to specify whole + app sync-options + items: + type: string + type: array + type: object + required: + - destination + - project + - source + type: object + required: + - metadata + - spec + type: object + values: + additionalProperties: + type: string + description: Values contains key/value pairs which are passed + directly as parameters to the template + type: object + required: + - configMapRef + type: object + clusters: + description: ClusterGenerator defines a generator to match against + clusters registered with ArgoCD. + properties: + selector: + description: Selector defines a label selector to match + against all clusters registered with ArgoCD. Clusters + today are stored as Kubernetes Secrets, thus the Secret + labels will be used for matching the selector. + properties: + matchExpressions: + description: matchExpressions is a list of label selector + requirements. The requirements are ANDed. + items: + description: A label selector requirement is a selector + that contains values, a key, and an operator that + relates the key and values. + properties: + key: + description: key is the label key that the selector + applies to. + type: string + operator: + description: operator represents a key's relationship + to a set of values. Valid operators are In, + NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. + If the operator is In or NotIn, the values array + must be non-empty. If the operator is Exists + or DoesNotExist, the values array must be empty. + This array is replaced during a strategic merge + patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. + A single {key,value} in the matchLabels map is equivalent + to an element of matchExpressions, whose key field + is "key", the operator is "In", and the values array + contains only "value". The requirements are ANDed. + type: object + type: object + template: + description: ApplicationSetTemplate represents argocd ApplicationSpec + properties: + metadata: + description: ApplicationSetTemplateMeta represents the + Argo CD application fields that may be used for Applications + generated from the ApplicationSet (based on metav1.ObjectMeta) + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + name: + type: string + namespace: + type: string + type: object + spec: + description: ApplicationSpec represents desired application + state. Contains link to repository with application + definition and additional parameters link definition + revision. + properties: + destination: + description: Destination overrides the kubernetes + server and namespace defined in the environment + ksonnet app.yaml + properties: + name: + description: Name of the destination cluster + which can be used instead of server (url) + field + type: string + namespace: + description: Namespace overrides the environment + namespace value in the ksonnet app.yaml + type: string + server: + description: Server overrides the environment + server value in the ksonnet app.yaml + type: string + type: object + ignoreDifferences: + description: IgnoreDifferences controls resources + fields which should be ignored during comparison + items: + description: ResourceIgnoreDifferences contains + resource filter and list of json paths which + should be ignored during comparison with live + state. + properties: + group: + type: string + jsonPointers: + items: + type: string + type: array + kind: + type: string + name: + type: string + namespace: + type: string + required: + - jsonPointers + - kind + type: object + type: array + info: + description: Infos contains a list of useful information + (URLs, email addresses, and plain text) that relates + to the application + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + project: + description: Project is a application project name. + Empty name means that application belongs to 'default' + project. + type: string + revisionHistoryLimit: + description: This limits this number of items kept + in the apps revision history. This should only + be changed in exceptional circumstances. Setting + to zero will store no history. This will reduce + storage used. Increasing will increase the space + used to store the history, so we do not recommend + increasing it. Default is 10. + format: int64 + type: integer + source: + description: Source is a reference to the location + ksonnet application definition + properties: + chart: + description: Chart is a Helm chart name + type: string + directory: + description: Directory holds path/directory + specific options + properties: + exclude: + type: string + jsonnet: + description: ApplicationSourceJsonnet holds + jsonnet specific options + properties: + extVars: + description: ExtVars is a list of Jsonnet + External Variables + items: + description: JsonnetVar is a jsonnet + variable + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + libs: + description: Additional library search + dirs + items: + type: string + type: array + tlas: + description: TLAS is a list of Jsonnet + Top-level Arguments + items: + description: JsonnetVar is a jsonnet + variable + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + recurse: + type: boolean + type: object + helm: + description: Helm holds helm specific options + properties: + fileParameters: + description: FileParameters are file parameters + to the helm template + items: + description: HelmFileParameter is a file + parameter to a helm template + properties: + name: + description: Name is the name of the + helm parameter + type: string + path: + description: Path is the path value + for the helm parameter + type: string + type: object + type: array + parameters: + description: Parameters are parameters to + the helm template + items: + description: HelmParameter is a parameter + to a helm template + properties: + forceString: + description: ForceString determines + whether to tell Helm to interpret + booleans and numbers as strings + type: boolean + name: + description: Name is the name of the + helm parameter + type: string + value: + description: Value is the value for + the helm parameter + type: string + type: object + type: array + releaseName: + description: The Helm release name. If omitted + it will use the application name + type: string + valueFiles: + description: ValuesFiles is a list of Helm + value files to use when generating a template + items: + type: string + type: array + values: + description: Values is Helm values, typically + defined as a block + type: string + version: + description: Version is the Helm version + to use for templating with + type: string + type: object + ksonnet: + description: Ksonnet holds ksonnet specific + options + properties: + environment: + description: Environment is a ksonnet application + environment name + type: string + parameters: + description: Parameters are a list of ksonnet + component parameter override values + items: + description: KsonnetParameter is a ksonnet + component parameter + properties: + component: + type: string + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + kustomize: + description: Kustomize holds kustomize specific + options + properties: + commonAnnotations: + additionalProperties: + type: string + description: CommonAnnotations adds additional + kustomize commonAnnotations + type: object + commonLabels: + additionalProperties: + type: string + description: CommonLabels adds additional + kustomize commonLabels + type: object + images: + description: Images are kustomize image + overrides + items: + type: string + type: array + namePrefix: + description: NamePrefix is a prefix appended + to resources for kustomize apps + type: string + nameSuffix: + description: NameSuffix is a suffix appended + to resources for kustomize apps + type: string + version: + description: Version contains optional Kustomize + version + type: string + type: object + path: + description: Path is a directory path within + the Git repository + type: string + plugin: + description: ConfigManagementPlugin holds config + management plugin specific options + properties: + env: + items: + properties: + name: + description: the name, usually uppercase + type: string + value: + description: the value + type: string + required: + - name + - value + type: object + type: array + name: + type: string + type: object + repoURL: + description: RepoURL is the repository URL of + the application manifests + type: string + targetRevision: + description: TargetRevision defines the commit, + tag, or branch in which to sync the application + to. If omitted, will sync to HEAD + type: string + required: + - repoURL + type: object + syncPolicy: + description: SyncPolicy controls when a sync will + be performed + properties: + automated: + description: Automated will keep an application + synced to the target revision + properties: + allowEmpty: + description: 'AllowEmpty allows apps have + zero live resources (default: false)' + type: boolean + prune: + description: 'Prune will prune resources + automatically as part of automated sync + (default: false)' + type: boolean + selfHeal: + description: 'SelfHeal enables auto-syncing + if (default: false)' + type: boolean + type: object + retry: + description: Retry controls failed sync retry + behavior + properties: + backoff: + description: Backoff is a backoff strategy + properties: + duration: + description: Duration is the amount + to back off. Default unit is seconds, + but could also be a duration (e.g. + "2m", "1h") + type: string + factor: + description: Factor is a factor to multiply + the base duration after each failed + retry + format: int64 + type: integer + maxDuration: + description: MaxDuration is the maximum + amount of time allowed for the backoff + strategy + type: string + type: object + limit: + description: Limit is the maximum number + of attempts when retrying a container + format: int64 + type: integer + type: object + syncOptions: + description: Options allow you to specify whole + app sync-options + items: + type: string + type: array + type: object + required: + - destination + - project + - source + type: object + required: + - metadata + - spec + type: object + values: + additionalProperties: + type: string + description: Values contains key/value pairs which are passed + directly as parameters to the template + type: object + type: object + git: + properties: + directories: + items: + properties: + exclude: + type: boolean + path: + type: string + required: + - path + type: object + type: array + files: + items: + properties: + path: + type: string + required: + - path + type: object + type: array + repoURL: + type: string + requeueAfterSeconds: + format: int64 + type: integer + revision: + type: string + template: + description: ApplicationSetTemplate represents argocd ApplicationSpec + properties: + metadata: + description: ApplicationSetTemplateMeta represents the + Argo CD application fields that may be used for Applications + generated from the ApplicationSet (based on metav1.ObjectMeta) + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + name: + type: string + namespace: + type: string + type: object + spec: + description: ApplicationSpec represents desired application + state. Contains link to repository with application + definition and additional parameters link definition + revision. + properties: + destination: + description: Destination overrides the kubernetes + server and namespace defined in the environment + ksonnet app.yaml + properties: + name: + description: Name of the destination cluster + which can be used instead of server (url) + field + type: string + namespace: + description: Namespace overrides the environment + namespace value in the ksonnet app.yaml + type: string + server: + description: Server overrides the environment + server value in the ksonnet app.yaml + type: string + type: object + ignoreDifferences: + description: IgnoreDifferences controls resources + fields which should be ignored during comparison + items: + description: ResourceIgnoreDifferences contains + resource filter and list of json paths which + should be ignored during comparison with live + state. + properties: + group: + type: string + jsonPointers: + items: + type: string + type: array + kind: + type: string + name: + type: string + namespace: + type: string + required: + - jsonPointers + - kind + type: object + type: array + info: + description: Infos contains a list of useful information + (URLs, email addresses, and plain text) that relates + to the application + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + project: + description: Project is a application project name. + Empty name means that application belongs to 'default' + project. + type: string + revisionHistoryLimit: + description: This limits this number of items kept + in the apps revision history. This should only + be changed in exceptional circumstances. Setting + to zero will store no history. This will reduce + storage used. Increasing will increase the space + used to store the history, so we do not recommend + increasing it. Default is 10. + format: int64 + type: integer + source: + description: Source is a reference to the location + ksonnet application definition + properties: + chart: + description: Chart is a Helm chart name + type: string + directory: + description: Directory holds path/directory + specific options + properties: + exclude: + type: string + jsonnet: + description: ApplicationSourceJsonnet holds + jsonnet specific options + properties: + extVars: + description: ExtVars is a list of Jsonnet + External Variables + items: + description: JsonnetVar is a jsonnet + variable + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + libs: + description: Additional library search + dirs + items: + type: string + type: array + tlas: + description: TLAS is a list of Jsonnet + Top-level Arguments + items: + description: JsonnetVar is a jsonnet + variable + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + recurse: + type: boolean + type: object + helm: + description: Helm holds helm specific options + properties: + fileParameters: + description: FileParameters are file parameters + to the helm template + items: + description: HelmFileParameter is a file + parameter to a helm template + properties: + name: + description: Name is the name of the + helm parameter + type: string + path: + description: Path is the path value + for the helm parameter + type: string + type: object + type: array + parameters: + description: Parameters are parameters to + the helm template + items: + description: HelmParameter is a parameter + to a helm template + properties: + forceString: + description: ForceString determines + whether to tell Helm to interpret + booleans and numbers as strings + type: boolean + name: + description: Name is the name of the + helm parameter + type: string + value: + description: Value is the value for + the helm parameter + type: string + type: object + type: array + releaseName: + description: The Helm release name. If omitted + it will use the application name + type: string + valueFiles: + description: ValuesFiles is a list of Helm + value files to use when generating a template + items: + type: string + type: array + values: + description: Values is Helm values, typically + defined as a block + type: string + version: + description: Version is the Helm version + to use for templating with + type: string + type: object + ksonnet: + description: Ksonnet holds ksonnet specific + options + properties: + environment: + description: Environment is a ksonnet application + environment name + type: string + parameters: + description: Parameters are a list of ksonnet + component parameter override values + items: + description: KsonnetParameter is a ksonnet + component parameter + properties: + component: + type: string + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + kustomize: + description: Kustomize holds kustomize specific + options + properties: + commonAnnotations: + additionalProperties: + type: string + description: CommonAnnotations adds additional + kustomize commonAnnotations + type: object + commonLabels: + additionalProperties: + type: string + description: CommonLabels adds additional + kustomize commonLabels + type: object + images: + description: Images are kustomize image + overrides + items: + type: string + type: array + namePrefix: + description: NamePrefix is a prefix appended + to resources for kustomize apps + type: string + nameSuffix: + description: NameSuffix is a suffix appended + to resources for kustomize apps + type: string + version: + description: Version contains optional Kustomize + version + type: string + type: object + path: + description: Path is a directory path within + the Git repository + type: string + plugin: + description: ConfigManagementPlugin holds config + management plugin specific options + properties: + env: + items: + properties: + name: + description: the name, usually uppercase + type: string + value: + description: the value + type: string + required: + - name + - value + type: object + type: array + name: + type: string + type: object + repoURL: + description: RepoURL is the repository URL of + the application manifests + type: string + targetRevision: + description: TargetRevision defines the commit, + tag, or branch in which to sync the application + to. If omitted, will sync to HEAD + type: string + required: + - repoURL + type: object + syncPolicy: + description: SyncPolicy controls when a sync will + be performed + properties: + automated: + description: Automated will keep an application + synced to the target revision + properties: + allowEmpty: + description: 'AllowEmpty allows apps have + zero live resources (default: false)' + type: boolean + prune: + description: 'Prune will prune resources + automatically as part of automated sync + (default: false)' + type: boolean + selfHeal: + description: 'SelfHeal enables auto-syncing + if (default: false)' + type: boolean + type: object + retry: + description: Retry controls failed sync retry + behavior + properties: + backoff: + description: Backoff is a backoff strategy + properties: + duration: + description: Duration is the amount + to back off. Default unit is seconds, + but could also be a duration (e.g. + "2m", "1h") + type: string + factor: + description: Factor is a factor to multiply + the base duration after each failed + retry + format: int64 + type: integer + maxDuration: + description: MaxDuration is the maximum + amount of time allowed for the backoff + strategy + type: string + type: object + limit: + description: Limit is the maximum number + of attempts when retrying a container + format: int64 + type: integer + type: object + syncOptions: + description: Options allow you to specify whole + app sync-options + items: + type: string + type: array + type: object + required: + - destination + - project + - source + type: object + required: + - metadata + - spec + type: object + required: + - repoURL + - revision + type: object + list: + description: ListGenerator include items info + properties: + elements: + items: + description: ListGeneratorElement include cluster and + url info + properties: + cluster: + type: string + url: + type: string + values: + additionalProperties: + type: string + description: Values contains key/value pairs which + are passed directly as parameters to the template + type: object + required: + - cluster + - url + type: object + type: array + template: + description: ApplicationSetTemplate represents argocd ApplicationSpec + properties: + metadata: + description: ApplicationSetTemplateMeta represents the + Argo CD application fields that may be used for Applications + generated from the ApplicationSet (based on metav1.ObjectMeta) + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + name: + type: string + namespace: + type: string + type: object + spec: + description: ApplicationSpec represents desired application + state. Contains link to repository with application + definition and additional parameters link definition + revision. + properties: + destination: + description: Destination overrides the kubernetes + server and namespace defined in the environment + ksonnet app.yaml + properties: + name: + description: Name of the destination cluster + which can be used instead of server (url) + field + type: string + namespace: + description: Namespace overrides the environment + namespace value in the ksonnet app.yaml + type: string + server: + description: Server overrides the environment + server value in the ksonnet app.yaml + type: string + type: object + ignoreDifferences: + description: IgnoreDifferences controls resources + fields which should be ignored during comparison + items: + description: ResourceIgnoreDifferences contains + resource filter and list of json paths which + should be ignored during comparison with live + state. + properties: + group: + type: string + jsonPointers: + items: + type: string + type: array + kind: + type: string + name: + type: string + namespace: + type: string + required: + - jsonPointers + - kind + type: object + type: array + info: + description: Infos contains a list of useful information + (URLs, email addresses, and plain text) that relates + to the application + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + project: + description: Project is a application project name. + Empty name means that application belongs to 'default' + project. + type: string + revisionHistoryLimit: + description: This limits this number of items kept + in the apps revision history. This should only + be changed in exceptional circumstances. Setting + to zero will store no history. This will reduce + storage used. Increasing will increase the space + used to store the history, so we do not recommend + increasing it. Default is 10. + format: int64 + type: integer + source: + description: Source is a reference to the location + ksonnet application definition + properties: + chart: + description: Chart is a Helm chart name + type: string + directory: + description: Directory holds path/directory + specific options + properties: + exclude: + type: string + jsonnet: + description: ApplicationSourceJsonnet holds + jsonnet specific options + properties: + extVars: + description: ExtVars is a list of Jsonnet + External Variables + items: + description: JsonnetVar is a jsonnet + variable + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + libs: + description: Additional library search + dirs + items: + type: string + type: array + tlas: + description: TLAS is a list of Jsonnet + Top-level Arguments + items: + description: JsonnetVar is a jsonnet + variable + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + recurse: + type: boolean + type: object + helm: + description: Helm holds helm specific options + properties: + fileParameters: + description: FileParameters are file parameters + to the helm template + items: + description: HelmFileParameter is a file + parameter to a helm template + properties: + name: + description: Name is the name of the + helm parameter + type: string + path: + description: Path is the path value + for the helm parameter + type: string + type: object + type: array + parameters: + description: Parameters are parameters to + the helm template + items: + description: HelmParameter is a parameter + to a helm template + properties: + forceString: + description: ForceString determines + whether to tell Helm to interpret + booleans and numbers as strings + type: boolean + name: + description: Name is the name of the + helm parameter + type: string + value: + description: Value is the value for + the helm parameter + type: string + type: object + type: array + releaseName: + description: The Helm release name. If omitted + it will use the application name + type: string + valueFiles: + description: ValuesFiles is a list of Helm + value files to use when generating a template + items: + type: string + type: array + values: + description: Values is Helm values, typically + defined as a block + type: string + version: + description: Version is the Helm version + to use for templating with + type: string + type: object + ksonnet: + description: Ksonnet holds ksonnet specific + options + properties: + environment: + description: Environment is a ksonnet application + environment name + type: string + parameters: + description: Parameters are a list of ksonnet + component parameter override values + items: + description: KsonnetParameter is a ksonnet + component parameter + properties: + component: + type: string + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + kustomize: + description: Kustomize holds kustomize specific + options + properties: + commonAnnotations: + additionalProperties: + type: string + description: CommonAnnotations adds additional + kustomize commonAnnotations + type: object + commonLabels: + additionalProperties: + type: string + description: CommonLabels adds additional + kustomize commonLabels + type: object + images: + description: Images are kustomize image + overrides + items: + type: string + type: array + namePrefix: + description: NamePrefix is a prefix appended + to resources for kustomize apps + type: string + nameSuffix: + description: NameSuffix is a suffix appended + to resources for kustomize apps + type: string + version: + description: Version contains optional Kustomize + version + type: string + type: object + path: + description: Path is a directory path within + the Git repository + type: string + plugin: + description: ConfigManagementPlugin holds config + management plugin specific options + properties: + env: + items: + properties: + name: + description: the name, usually uppercase + type: string + value: + description: the value + type: string + required: + - name + - value + type: object + type: array + name: + type: string + type: object + repoURL: + description: RepoURL is the repository URL of + the application manifests + type: string + targetRevision: + description: TargetRevision defines the commit, + tag, or branch in which to sync the application + to. If omitted, will sync to HEAD + type: string + required: + - repoURL + type: object + syncPolicy: + description: SyncPolicy controls when a sync will + be performed + properties: + automated: + description: Automated will keep an application + synced to the target revision + properties: + allowEmpty: + description: 'AllowEmpty allows apps have + zero live resources (default: false)' + type: boolean + prune: + description: 'Prune will prune resources + automatically as part of automated sync + (default: false)' + type: boolean + selfHeal: + description: 'SelfHeal enables auto-syncing + if (default: false)' + type: boolean + type: object + retry: + description: Retry controls failed sync retry + behavior + properties: + backoff: + description: Backoff is a backoff strategy + properties: + duration: + description: Duration is the amount + to back off. Default unit is seconds, + but could also be a duration (e.g. + "2m", "1h") + type: string + factor: + description: Factor is a factor to multiply + the base duration after each failed + retry + format: int64 + type: integer + maxDuration: + description: MaxDuration is the maximum + amount of time allowed for the backoff + strategy + type: string + type: object + limit: + description: Limit is the maximum number + of attempts when retrying a container + format: int64 + type: integer + type: object + syncOptions: + description: Options allow you to specify whole + app sync-options + items: + type: string + type: array + type: object + required: + - destination + - project + - source + type: object + required: + - metadata + - spec + type: object + required: + - elements + type: object + matrix: + description: MatrixGenerator include Other generators + properties: + generators: + items: + description: ApplicationSetBaseGenerator include list + item info CRD dosn't support recursive types so we need + a different type for the matrix generator https://github.com/kubernetes-sigs/controller-tools/issues/477 + properties: + clusterDecisionResource: + description: DuckType defines a generator to match + against clusters registered with ArgoCD. + properties: + configMapRef: + description: ConfigMapRef is a ConfigMap with + the duck type definitions needed to retreive + the data this includes apiVersion(group/version), + kind, matchKey and validation settings Name + is the resource name of the kind, group and + version, defined in the ConfigMapRef RequeueAfterSeconds + is how long before the duckType will be rechecked + for a change + type: string + labelSelector: + description: A label selector is a label query + over a set of resources. The result of matchLabels + and matchExpressions are ANDed. An empty label + selector matches all objects. A null label selector + matches no objects. + properties: + matchExpressions: + description: matchExpressions is a list of + label selector requirements. The requirements + are ANDed. + items: + description: A label selector requirement + is a selector that contains values, a + key, and an operator that relates the + key and values. + properties: + key: + description: key is the label key that + the selector applies to. + type: string + operator: + description: operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only + "value". The requirements are ANDed. + type: object + type: object + name: + type: string + requeueAfterSeconds: + format: int64 + type: integer + template: + description: ApplicationSetTemplate represents + argocd ApplicationSpec + properties: + metadata: + description: ApplicationSetTemplateMeta represents + the Argo CD application fields that may + be used for Applications generated from + the ApplicationSet (based on metav1.ObjectMeta) + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + name: + type: string + namespace: + type: string + type: object + spec: + description: ApplicationSpec represents desired + application state. Contains link to repository + with application definition and additional + parameters link definition revision. + properties: + destination: + description: Destination overrides the + kubernetes server and namespace defined + in the environment ksonnet app.yaml + properties: + name: + description: Name of the destination + cluster which can be used instead + of server (url) field + type: string + namespace: + description: Namespace overrides the + environment namespace value in the + ksonnet app.yaml + type: string + server: + description: Server overrides the + environment server value in the + ksonnet app.yaml + type: string + type: object + ignoreDifferences: + description: IgnoreDifferences controls + resources fields which should be ignored + during comparison + items: + description: ResourceIgnoreDifferences + contains resource filter and list + of json paths which should be ignored + during comparison with live state. + properties: + group: + type: string + jsonPointers: + items: + type: string + type: array + kind: + type: string + name: + type: string + namespace: + type: string + required: + - jsonPointers + - kind + type: object + type: array + info: + description: Infos contains a list of + useful information (URLs, email addresses, + and plain text) that relates to the + application + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + project: + description: Project is a application + project name. Empty name means that + application belongs to 'default' project. + type: string + revisionHistoryLimit: + description: This limits this number of + items kept in the apps revision history. + This should only be changed in exceptional + circumstances. Setting to zero will + store no history. This will reduce storage + used. Increasing will increase the space + used to store the history, so we do + not recommend increasing it. Default + is 10. + format: int64 + type: integer + source: + description: Source is a reference to + the location ksonnet application definition + properties: + chart: + description: Chart is a Helm chart + name + type: string + directory: + description: Directory holds path/directory + specific options + properties: + exclude: + type: string + jsonnet: + description: ApplicationSourceJsonnet + holds jsonnet specific options + properties: + extVars: + description: ExtVars is a + list of Jsonnet External + Variables + items: + description: JsonnetVar + is a jsonnet variable + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + libs: + description: Additional library + search dirs + items: + type: string + type: array + tlas: + description: TLAS is a list + of Jsonnet Top-level Arguments + items: + description: JsonnetVar + is a jsonnet variable + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + recurse: + type: boolean + type: object + helm: + description: Helm holds helm specific + options + properties: + fileParameters: + description: FileParameters are + file parameters to the helm + template + items: + description: HelmFileParameter + is a file parameter to a helm + template + properties: + name: + description: Name is the + name of the helm parameter + type: string + path: + description: Path is the + path value for the helm + parameter + type: string + type: object + type: array + parameters: + description: Parameters are parameters + to the helm template + items: + description: HelmParameter is + a parameter to a helm template + properties: + forceString: + description: ForceString + determines whether to + tell Helm to interpret + booleans and numbers as + strings + type: boolean + name: + description: Name is the + name of the helm parameter + type: string + value: + description: Value is the + value for the helm parameter + type: string + type: object + type: array + releaseName: + description: The Helm release + name. If omitted it will use + the application name + type: string + valueFiles: + description: ValuesFiles is a + list of Helm value files to + use when generating a template + items: + type: string + type: array + values: + description: Values is Helm values, + typically defined as a block + type: string + version: + description: Version is the Helm + version to use for templating + with + type: string + type: object + ksonnet: + description: Ksonnet holds ksonnet + specific options + properties: + environment: + description: Environment is a + ksonnet application environment + name + type: string + parameters: + description: Parameters are a + list of ksonnet component parameter + override values + items: + description: KsonnetParameter + is a ksonnet component parameter + properties: + component: + type: string + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + kustomize: + description: Kustomize holds kustomize + specific options + properties: + commonAnnotations: + additionalProperties: + type: string + description: CommonAnnotations + adds additional kustomize commonAnnotations + type: object + commonLabels: + additionalProperties: + type: string + description: CommonLabels adds + additional kustomize commonLabels + type: object + images: + description: Images are kustomize + image overrides + items: + type: string + type: array + namePrefix: + description: NamePrefix is a prefix + appended to resources for kustomize + apps + type: string + nameSuffix: + description: NameSuffix is a suffix + appended to resources for kustomize + apps + type: string + version: + description: Version contains + optional Kustomize version + type: string + type: object + path: + description: Path is a directory path + within the Git repository + type: string + plugin: + description: ConfigManagementPlugin + holds config management plugin specific + options + properties: + env: + items: + properties: + name: + description: the name, usually + uppercase + type: string + value: + description: the value + type: string + required: + - name + - value + type: object + type: array + name: + type: string + type: object + repoURL: + description: RepoURL is the repository + URL of the application manifests + type: string + targetRevision: + description: TargetRevision defines + the commit, tag, or branch in which + to sync the application to. If omitted, + will sync to HEAD + type: string + required: + - repoURL + type: object + syncPolicy: + description: SyncPolicy controls when + a sync will be performed + properties: + automated: + description: Automated will keep an + application synced to the target + revision + properties: + allowEmpty: + description: 'AllowEmpty allows + apps have zero live resources + (default: false)' + type: boolean + prune: + description: 'Prune will prune + resources automatically as part + of automated sync (default: + false)' + type: boolean + selfHeal: + description: 'SelfHeal enables + auto-syncing if (default: false)' + type: boolean + type: object + retry: + description: Retry controls failed + sync retry behavior + properties: + backoff: + description: Backoff is a backoff + strategy + properties: + duration: + description: Duration is the + amount to back off. Default + unit is seconds, but could + also be a duration (e.g. + "2m", "1h") + type: string + factor: + description: Factor is a factor + to multiply the base duration + after each failed retry + format: int64 + type: integer + maxDuration: + description: MaxDuration is + the maximum amount of time + allowed for the backoff + strategy + type: string + type: object + limit: + description: Limit is the maximum + number of attempts when retrying + a container + format: int64 + type: integer + type: object + syncOptions: + description: Options allow you to + specify whole app sync-options + items: + type: string + type: array + type: object + required: + - destination + - project + - source + type: object + required: + - metadata + - spec + type: object + values: + additionalProperties: + type: string + description: Values contains key/value pairs which + are passed directly as parameters to the template + type: object + required: + - configMapRef + type: object + clusters: + description: ClusterGenerator defines a generator + to match against clusters registered with ArgoCD. + properties: + selector: + description: Selector defines a label selector + to match against all clusters registered with + ArgoCD. Clusters today are stored as Kubernetes + Secrets, thus the Secret labels will be used + for matching the selector. + properties: + matchExpressions: + description: matchExpressions is a list of + label selector requirements. The requirements + are ANDed. + items: + description: A label selector requirement + is a selector that contains values, a + key, and an operator that relates the + key and values. + properties: + key: + description: key is the label key that + the selector applies to. + type: string + operator: + description: operator represents a key's + relationship to a set of values. Valid + operators are In, NotIn, Exists and + DoesNotExist. + type: string + values: + description: values is an array of string + values. If the operator is In or NotIn, + the values array must be non-empty. + If the operator is Exists or DoesNotExist, + the values array must be empty. This + array is replaced during a strategic + merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} + pairs. A single {key,value} in the matchLabels + map is equivalent to an element of matchExpressions, + whose key field is "key", the operator is + "In", and the values array contains only + "value". The requirements are ANDed. + type: object + type: object + template: + description: ApplicationSetTemplate represents + argocd ApplicationSpec + properties: + metadata: + description: ApplicationSetTemplateMeta represents + the Argo CD application fields that may + be used for Applications generated from + the ApplicationSet (based on metav1.ObjectMeta) + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + name: + type: string + namespace: + type: string + type: object + spec: + description: ApplicationSpec represents desired + application state. Contains link to repository + with application definition and additional + parameters link definition revision. + properties: + destination: + description: Destination overrides the + kubernetes server and namespace defined + in the environment ksonnet app.yaml + properties: + name: + description: Name of the destination + cluster which can be used instead + of server (url) field + type: string + namespace: + description: Namespace overrides the + environment namespace value in the + ksonnet app.yaml + type: string + server: + description: Server overrides the + environment server value in the + ksonnet app.yaml + type: string + type: object + ignoreDifferences: + description: IgnoreDifferences controls + resources fields which should be ignored + during comparison + items: + description: ResourceIgnoreDifferences + contains resource filter and list + of json paths which should be ignored + during comparison with live state. + properties: + group: + type: string + jsonPointers: + items: + type: string + type: array + kind: + type: string + name: + type: string + namespace: + type: string + required: + - jsonPointers + - kind + type: object + type: array + info: + description: Infos contains a list of + useful information (URLs, email addresses, + and plain text) that relates to the + application + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + project: + description: Project is a application + project name. Empty name means that + application belongs to 'default' project. + type: string + revisionHistoryLimit: + description: This limits this number of + items kept in the apps revision history. + This should only be changed in exceptional + circumstances. Setting to zero will + store no history. This will reduce storage + used. Increasing will increase the space + used to store the history, so we do + not recommend increasing it. Default + is 10. + format: int64 + type: integer + source: + description: Source is a reference to + the location ksonnet application definition + properties: + chart: + description: Chart is a Helm chart + name + type: string + directory: + description: Directory holds path/directory + specific options + properties: + exclude: + type: string + jsonnet: + description: ApplicationSourceJsonnet + holds jsonnet specific options + properties: + extVars: + description: ExtVars is a + list of Jsonnet External + Variables + items: + description: JsonnetVar + is a jsonnet variable + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + libs: + description: Additional library + search dirs + items: + type: string + type: array + tlas: + description: TLAS is a list + of Jsonnet Top-level Arguments + items: + description: JsonnetVar + is a jsonnet variable + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + recurse: + type: boolean + type: object + helm: + description: Helm holds helm specific + options + properties: + fileParameters: + description: FileParameters are + file parameters to the helm + template + items: + description: HelmFileParameter + is a file parameter to a helm + template + properties: + name: + description: Name is the + name of the helm parameter + type: string + path: + description: Path is the + path value for the helm + parameter + type: string + type: object + type: array + parameters: + description: Parameters are parameters + to the helm template + items: + description: HelmParameter is + a parameter to a helm template + properties: + forceString: + description: ForceString + determines whether to + tell Helm to interpret + booleans and numbers as + strings + type: boolean + name: + description: Name is the + name of the helm parameter + type: string + value: + description: Value is the + value for the helm parameter + type: string + type: object + type: array + releaseName: + description: The Helm release + name. If omitted it will use + the application name + type: string + valueFiles: + description: ValuesFiles is a + list of Helm value files to + use when generating a template + items: + type: string + type: array + values: + description: Values is Helm values, + typically defined as a block + type: string + version: + description: Version is the Helm + version to use for templating + with + type: string + type: object + ksonnet: + description: Ksonnet holds ksonnet + specific options + properties: + environment: + description: Environment is a + ksonnet application environment + name + type: string + parameters: + description: Parameters are a + list of ksonnet component parameter + override values + items: + description: KsonnetParameter + is a ksonnet component parameter + properties: + component: + type: string + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + kustomize: + description: Kustomize holds kustomize + specific options + properties: + commonAnnotations: + additionalProperties: + type: string + description: CommonAnnotations + adds additional kustomize commonAnnotations + type: object + commonLabels: + additionalProperties: + type: string + description: CommonLabels adds + additional kustomize commonLabels + type: object + images: + description: Images are kustomize + image overrides + items: + type: string + type: array + namePrefix: + description: NamePrefix is a prefix + appended to resources for kustomize + apps + type: string + nameSuffix: + description: NameSuffix is a suffix + appended to resources for kustomize + apps + type: string + version: + description: Version contains + optional Kustomize version + type: string + type: object + path: + description: Path is a directory path + within the Git repository + type: string + plugin: + description: ConfigManagementPlugin + holds config management plugin specific + options + properties: + env: + items: + properties: + name: + description: the name, usually + uppercase + type: string + value: + description: the value + type: string + required: + - name + - value + type: object + type: array + name: + type: string + type: object + repoURL: + description: RepoURL is the repository + URL of the application manifests + type: string + targetRevision: + description: TargetRevision defines + the commit, tag, or branch in which + to sync the application to. If omitted, + will sync to HEAD + type: string + required: + - repoURL + type: object + syncPolicy: + description: SyncPolicy controls when + a sync will be performed + properties: + automated: + description: Automated will keep an + application synced to the target + revision + properties: + allowEmpty: + description: 'AllowEmpty allows + apps have zero live resources + (default: false)' + type: boolean + prune: + description: 'Prune will prune + resources automatically as part + of automated sync (default: + false)' + type: boolean + selfHeal: + description: 'SelfHeal enables + auto-syncing if (default: false)' + type: boolean + type: object + retry: + description: Retry controls failed + sync retry behavior + properties: + backoff: + description: Backoff is a backoff + strategy + properties: + duration: + description: Duration is the + amount to back off. Default + unit is seconds, but could + also be a duration (e.g. + "2m", "1h") + type: string + factor: + description: Factor is a factor + to multiply the base duration + after each failed retry + format: int64 + type: integer + maxDuration: + description: MaxDuration is + the maximum amount of time + allowed for the backoff + strategy + type: string + type: object + limit: + description: Limit is the maximum + number of attempts when retrying + a container + format: int64 + type: integer + type: object + syncOptions: + description: Options allow you to + specify whole app sync-options + items: + type: string + type: array + type: object + required: + - destination + - project + - source + type: object + required: + - metadata + - spec + type: object + values: + additionalProperties: + type: string + description: Values contains key/value pairs which + are passed directly as parameters to the template + type: object + type: object + git: + properties: + directories: + items: + properties: + exclude: + type: boolean + path: + type: string + required: + - path + type: object + type: array + files: + items: + properties: + path: + type: string + required: + - path + type: object + type: array + repoURL: + type: string + requeueAfterSeconds: + format: int64 + type: integer + revision: + type: string + template: + description: ApplicationSetTemplate represents + argocd ApplicationSpec + properties: + metadata: + description: ApplicationSetTemplateMeta represents + the Argo CD application fields that may + be used for Applications generated from + the ApplicationSet (based on metav1.ObjectMeta) + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + name: + type: string + namespace: + type: string + type: object + spec: + description: ApplicationSpec represents desired + application state. Contains link to repository + with application definition and additional + parameters link definition revision. + properties: + destination: + description: Destination overrides the + kubernetes server and namespace defined + in the environment ksonnet app.yaml + properties: + name: + description: Name of the destination + cluster which can be used instead + of server (url) field + type: string + namespace: + description: Namespace overrides the + environment namespace value in the + ksonnet app.yaml + type: string + server: + description: Server overrides the + environment server value in the + ksonnet app.yaml + type: string + type: object + ignoreDifferences: + description: IgnoreDifferences controls + resources fields which should be ignored + during comparison + items: + description: ResourceIgnoreDifferences + contains resource filter and list + of json paths which should be ignored + during comparison with live state. + properties: + group: + type: string + jsonPointers: + items: + type: string + type: array + kind: + type: string + name: + type: string + namespace: + type: string + required: + - jsonPointers + - kind + type: object + type: array + info: + description: Infos contains a list of + useful information (URLs, email addresses, + and plain text) that relates to the + application + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + project: + description: Project is a application + project name. Empty name means that + application belongs to 'default' project. + type: string + revisionHistoryLimit: + description: This limits this number of + items kept in the apps revision history. + This should only be changed in exceptional + circumstances. Setting to zero will + store no history. This will reduce storage + used. Increasing will increase the space + used to store the history, so we do + not recommend increasing it. Default + is 10. + format: int64 + type: integer + source: + description: Source is a reference to + the location ksonnet application definition + properties: + chart: + description: Chart is a Helm chart + name + type: string + directory: + description: Directory holds path/directory + specific options + properties: + exclude: + type: string + jsonnet: + description: ApplicationSourceJsonnet + holds jsonnet specific options + properties: + extVars: + description: ExtVars is a + list of Jsonnet External + Variables + items: + description: JsonnetVar + is a jsonnet variable + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + libs: + description: Additional library + search dirs + items: + type: string + type: array + tlas: + description: TLAS is a list + of Jsonnet Top-level Arguments + items: + description: JsonnetVar + is a jsonnet variable + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + recurse: + type: boolean + type: object + helm: + description: Helm holds helm specific + options + properties: + fileParameters: + description: FileParameters are + file parameters to the helm + template + items: + description: HelmFileParameter + is a file parameter to a helm + template + properties: + name: + description: Name is the + name of the helm parameter + type: string + path: + description: Path is the + path value for the helm + parameter + type: string + type: object + type: array + parameters: + description: Parameters are parameters + to the helm template + items: + description: HelmParameter is + a parameter to a helm template + properties: + forceString: + description: ForceString + determines whether to + tell Helm to interpret + booleans and numbers as + strings + type: boolean + name: + description: Name is the + name of the helm parameter + type: string + value: + description: Value is the + value for the helm parameter + type: string + type: object + type: array + releaseName: + description: The Helm release + name. If omitted it will use + the application name + type: string + valueFiles: + description: ValuesFiles is a + list of Helm value files to + use when generating a template + items: + type: string + type: array + values: + description: Values is Helm values, + typically defined as a block + type: string + version: + description: Version is the Helm + version to use for templating + with + type: string + type: object + ksonnet: + description: Ksonnet holds ksonnet + specific options + properties: + environment: + description: Environment is a + ksonnet application environment + name + type: string + parameters: + description: Parameters are a + list of ksonnet component parameter + override values + items: + description: KsonnetParameter + is a ksonnet component parameter + properties: + component: + type: string + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + kustomize: + description: Kustomize holds kustomize + specific options + properties: + commonAnnotations: + additionalProperties: + type: string + description: CommonAnnotations + adds additional kustomize commonAnnotations + type: object + commonLabels: + additionalProperties: + type: string + description: CommonLabels adds + additional kustomize commonLabels + type: object + images: + description: Images are kustomize + image overrides + items: + type: string + type: array + namePrefix: + description: NamePrefix is a prefix + appended to resources for kustomize + apps + type: string + nameSuffix: + description: NameSuffix is a suffix + appended to resources for kustomize + apps + type: string + version: + description: Version contains + optional Kustomize version + type: string + type: object + path: + description: Path is a directory path + within the Git repository + type: string + plugin: + description: ConfigManagementPlugin + holds config management plugin specific + options + properties: + env: + items: + properties: + name: + description: the name, usually + uppercase + type: string + value: + description: the value + type: string + required: + - name + - value + type: object + type: array + name: + type: string + type: object + repoURL: + description: RepoURL is the repository + URL of the application manifests + type: string + targetRevision: + description: TargetRevision defines + the commit, tag, or branch in which + to sync the application to. If omitted, + will sync to HEAD + type: string + required: + - repoURL + type: object + syncPolicy: + description: SyncPolicy controls when + a sync will be performed + properties: + automated: + description: Automated will keep an + application synced to the target + revision + properties: + allowEmpty: + description: 'AllowEmpty allows + apps have zero live resources + (default: false)' + type: boolean + prune: + description: 'Prune will prune + resources automatically as part + of automated sync (default: + false)' + type: boolean + selfHeal: + description: 'SelfHeal enables + auto-syncing if (default: false)' + type: boolean + type: object + retry: + description: Retry controls failed + sync retry behavior + properties: + backoff: + description: Backoff is a backoff + strategy + properties: + duration: + description: Duration is the + amount to back off. Default + unit is seconds, but could + also be a duration (e.g. + "2m", "1h") + type: string + factor: + description: Factor is a factor + to multiply the base duration + after each failed retry + format: int64 + type: integer + maxDuration: + description: MaxDuration is + the maximum amount of time + allowed for the backoff + strategy + type: string + type: object + limit: + description: Limit is the maximum + number of attempts when retrying + a container + format: int64 + type: integer + type: object + syncOptions: + description: Options allow you to + specify whole app sync-options + items: + type: string + type: array + type: object + required: + - destination + - project + - source + type: object + required: + - metadata + - spec + type: object + required: + - repoURL + - revision + type: object + list: + description: ListGenerator include items info + properties: + elements: + items: + description: ListGeneratorElement include cluster + and url info + properties: + cluster: + type: string + url: + type: string + values: + additionalProperties: + type: string + description: Values contains key/value pairs + which are passed directly as parameters + to the template + type: object + required: + - cluster + - url + type: object + type: array + template: + description: ApplicationSetTemplate represents + argocd ApplicationSpec + properties: + metadata: + description: ApplicationSetTemplateMeta represents + the Argo CD application fields that may + be used for Applications generated from + the ApplicationSet (based on metav1.ObjectMeta) + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + name: + type: string + namespace: + type: string + type: object + spec: + description: ApplicationSpec represents desired + application state. Contains link to repository + with application definition and additional + parameters link definition revision. + properties: + destination: + description: Destination overrides the + kubernetes server and namespace defined + in the environment ksonnet app.yaml + properties: + name: + description: Name of the destination + cluster which can be used instead + of server (url) field + type: string + namespace: + description: Namespace overrides the + environment namespace value in the + ksonnet app.yaml + type: string + server: + description: Server overrides the + environment server value in the + ksonnet app.yaml + type: string + type: object + ignoreDifferences: + description: IgnoreDifferences controls + resources fields which should be ignored + during comparison + items: + description: ResourceIgnoreDifferences + contains resource filter and list + of json paths which should be ignored + during comparison with live state. + properties: + group: + type: string + jsonPointers: + items: + type: string + type: array + kind: + type: string + name: + type: string + namespace: + type: string + required: + - jsonPointers + - kind + type: object + type: array + info: + description: Infos contains a list of + useful information (URLs, email addresses, + and plain text) that relates to the + application + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + project: + description: Project is a application + project name. Empty name means that + application belongs to 'default' project. + type: string + revisionHistoryLimit: + description: This limits this number of + items kept in the apps revision history. + This should only be changed in exceptional + circumstances. Setting to zero will + store no history. This will reduce storage + used. Increasing will increase the space + used to store the history, so we do + not recommend increasing it. Default + is 10. + format: int64 + type: integer + source: + description: Source is a reference to + the location ksonnet application definition + properties: + chart: + description: Chart is a Helm chart + name + type: string + directory: + description: Directory holds path/directory + specific options + properties: + exclude: + type: string + jsonnet: + description: ApplicationSourceJsonnet + holds jsonnet specific options + properties: + extVars: + description: ExtVars is a + list of Jsonnet External + Variables + items: + description: JsonnetVar + is a jsonnet variable + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + libs: + description: Additional library + search dirs + items: + type: string + type: array + tlas: + description: TLAS is a list + of Jsonnet Top-level Arguments + items: + description: JsonnetVar + is a jsonnet variable + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + recurse: + type: boolean + type: object + helm: + description: Helm holds helm specific + options + properties: + fileParameters: + description: FileParameters are + file parameters to the helm + template + items: + description: HelmFileParameter + is a file parameter to a helm + template + properties: + name: + description: Name is the + name of the helm parameter + type: string + path: + description: Path is the + path value for the helm + parameter + type: string + type: object + type: array + parameters: + description: Parameters are parameters + to the helm template + items: + description: HelmParameter is + a parameter to a helm template + properties: + forceString: + description: ForceString + determines whether to + tell Helm to interpret + booleans and numbers as + strings + type: boolean + name: + description: Name is the + name of the helm parameter + type: string + value: + description: Value is the + value for the helm parameter + type: string + type: object + type: array + releaseName: + description: The Helm release + name. If omitted it will use + the application name + type: string + valueFiles: + description: ValuesFiles is a + list of Helm value files to + use when generating a template + items: + type: string + type: array + values: + description: Values is Helm values, + typically defined as a block + type: string + version: + description: Version is the Helm + version to use for templating + with + type: string + type: object + ksonnet: + description: Ksonnet holds ksonnet + specific options + properties: + environment: + description: Environment is a + ksonnet application environment + name + type: string + parameters: + description: Parameters are a + list of ksonnet component parameter + override values + items: + description: KsonnetParameter + is a ksonnet component parameter + properties: + component: + type: string + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + kustomize: + description: Kustomize holds kustomize + specific options + properties: + commonAnnotations: + additionalProperties: + type: string + description: CommonAnnotations + adds additional kustomize commonAnnotations + type: object + commonLabels: + additionalProperties: + type: string + description: CommonLabels adds + additional kustomize commonLabels + type: object + images: + description: Images are kustomize + image overrides + items: + type: string + type: array + namePrefix: + description: NamePrefix is a prefix + appended to resources for kustomize + apps + type: string + nameSuffix: + description: NameSuffix is a suffix + appended to resources for kustomize + apps + type: string + version: + description: Version contains + optional Kustomize version + type: string + type: object + path: + description: Path is a directory path + within the Git repository + type: string + plugin: + description: ConfigManagementPlugin + holds config management plugin specific + options + properties: + env: + items: + properties: + name: + description: the name, usually + uppercase + type: string + value: + description: the value + type: string + required: + - name + - value + type: object + type: array + name: + type: string + type: object + repoURL: + description: RepoURL is the repository + URL of the application manifests + type: string + targetRevision: + description: TargetRevision defines + the commit, tag, or branch in which + to sync the application to. If omitted, + will sync to HEAD + type: string + required: + - repoURL + type: object + syncPolicy: + description: SyncPolicy controls when + a sync will be performed + properties: + automated: + description: Automated will keep an + application synced to the target + revision + properties: + allowEmpty: + description: 'AllowEmpty allows + apps have zero live resources + (default: false)' + type: boolean + prune: + description: 'Prune will prune + resources automatically as part + of automated sync (default: + false)' + type: boolean + selfHeal: + description: 'SelfHeal enables + auto-syncing if (default: false)' + type: boolean + type: object + retry: + description: Retry controls failed + sync retry behavior + properties: + backoff: + description: Backoff is a backoff + strategy + properties: + duration: + description: Duration is the + amount to back off. Default + unit is seconds, but could + also be a duration (e.g. + "2m", "1h") + type: string + factor: + description: Factor is a factor + to multiply the base duration + after each failed retry + format: int64 + type: integer + maxDuration: + description: MaxDuration is + the maximum amount of time + allowed for the backoff + strategy + type: string + type: object + limit: + description: Limit is the maximum + number of attempts when retrying + a container + format: int64 + type: integer + type: object + syncOptions: + description: Options allow you to + specify whole app sync-options + items: + type: string + type: array + type: object + required: + - destination + - project + - source + type: object + required: + - metadata + - spec + type: object + required: + - elements + type: object + scmProvider: + description: SCMProviderGenerator defines a generator + that scrapes a SCMaaS API to find candidate repos. + properties: + cloneProtocol: + description: Which protocol to use for the SCM + URL. Default is provider-specific but ssh if + possible. Not all providers necessarily support + all protocols. + type: string + filters: + description: TODO other providers. Filters for + which repos should be considered. + items: + description: SCMProviderGeneratorFilter is a + single repository filter. If multiple filter + types are set on a single struct, they will + be AND'd together. All filters must pass for + a repo to be included. + properties: + branchMatch: + description: A regex which must match the + branch name. + type: string + labelMatch: + description: A regex which must match at + least one label. + type: string + pathsExist: + description: An array of paths, all of which + must exist. + items: + type: string + type: array + repositoryMatch: + description: A regex for repo names. + type: string + type: object + type: array + github: + description: Which provider to use and config + for it. + properties: + allBranches: + description: Scan all branches instead of + just the default branch. + type: boolean + api: + description: The GitHub API URL to talk to. + If blank, use https://api.github.com/. + type: string + organization: + description: GitHub org to scan. Required. + type: string + tokenRef: + description: Authentication token reference. + properties: + key: + type: string + secretName: + type: string + required: + - key + - secretName + type: object + required: + - organization + type: object + requeueAfterSeconds: + description: Standard parameters. + format: int64 + type: integer + template: + description: ApplicationSetTemplate represents + argocd ApplicationSpec + properties: + metadata: + description: ApplicationSetTemplateMeta represents + the Argo CD application fields that may + be used for Applications generated from + the ApplicationSet (based on metav1.ObjectMeta) + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + name: + type: string + namespace: + type: string + type: object + spec: + description: ApplicationSpec represents desired + application state. Contains link to repository + with application definition and additional + parameters link definition revision. + properties: + destination: + description: Destination overrides the + kubernetes server and namespace defined + in the environment ksonnet app.yaml + properties: + name: + description: Name of the destination + cluster which can be used instead + of server (url) field + type: string + namespace: + description: Namespace overrides the + environment namespace value in the + ksonnet app.yaml + type: string + server: + description: Server overrides the + environment server value in the + ksonnet app.yaml + type: string + type: object + ignoreDifferences: + description: IgnoreDifferences controls + resources fields which should be ignored + during comparison + items: + description: ResourceIgnoreDifferences + contains resource filter and list + of json paths which should be ignored + during comparison with live state. + properties: + group: + type: string + jsonPointers: + items: + type: string + type: array + kind: + type: string + name: + type: string + namespace: + type: string + required: + - jsonPointers + - kind + type: object + type: array + info: + description: Infos contains a list of + useful information (URLs, email addresses, + and plain text) that relates to the + application + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + project: + description: Project is a application + project name. Empty name means that + application belongs to 'default' project. + type: string + revisionHistoryLimit: + description: This limits this number of + items kept in the apps revision history. + This should only be changed in exceptional + circumstances. Setting to zero will + store no history. This will reduce storage + used. Increasing will increase the space + used to store the history, so we do + not recommend increasing it. Default + is 10. + format: int64 + type: integer + source: + description: Source is a reference to + the location ksonnet application definition + properties: + chart: + description: Chart is a Helm chart + name + type: string + directory: + description: Directory holds path/directory + specific options + properties: + exclude: + type: string + jsonnet: + description: ApplicationSourceJsonnet + holds jsonnet specific options + properties: + extVars: + description: ExtVars is a + list of Jsonnet External + Variables + items: + description: JsonnetVar + is a jsonnet variable + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + libs: + description: Additional library + search dirs + items: + type: string + type: array + tlas: + description: TLAS is a list + of Jsonnet Top-level Arguments + items: + description: JsonnetVar + is a jsonnet variable + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + recurse: + type: boolean + type: object + helm: + description: Helm holds helm specific + options + properties: + fileParameters: + description: FileParameters are + file parameters to the helm + template + items: + description: HelmFileParameter + is a file parameter to a helm + template + properties: + name: + description: Name is the + name of the helm parameter + type: string + path: + description: Path is the + path value for the helm + parameter + type: string + type: object + type: array + parameters: + description: Parameters are parameters + to the helm template + items: + description: HelmParameter is + a parameter to a helm template + properties: + forceString: + description: ForceString + determines whether to + tell Helm to interpret + booleans and numbers as + strings + type: boolean + name: + description: Name is the + name of the helm parameter + type: string + value: + description: Value is the + value for the helm parameter + type: string + type: object + type: array + releaseName: + description: The Helm release + name. If omitted it will use + the application name + type: string + valueFiles: + description: ValuesFiles is a + list of Helm value files to + use when generating a template + items: + type: string + type: array + values: + description: Values is Helm values, + typically defined as a block + type: string + version: + description: Version is the Helm + version to use for templating + with + type: string + type: object + ksonnet: + description: Ksonnet holds ksonnet + specific options + properties: + environment: + description: Environment is a + ksonnet application environment + name + type: string + parameters: + description: Parameters are a + list of ksonnet component parameter + override values + items: + description: KsonnetParameter + is a ksonnet component parameter + properties: + component: + type: string + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + kustomize: + description: Kustomize holds kustomize + specific options + properties: + commonAnnotations: + additionalProperties: + type: string + description: CommonAnnotations + adds additional kustomize commonAnnotations + type: object + commonLabels: + additionalProperties: + type: string + description: CommonLabels adds + additional kustomize commonLabels + type: object + images: + description: Images are kustomize + image overrides + items: + type: string + type: array + namePrefix: + description: NamePrefix is a prefix + appended to resources for kustomize + apps + type: string + nameSuffix: + description: NameSuffix is a suffix + appended to resources for kustomize + apps + type: string + version: + description: Version contains + optional Kustomize version + type: string + type: object + path: + description: Path is a directory path + within the Git repository + type: string + plugin: + description: ConfigManagementPlugin + holds config management plugin specific + options + properties: + env: + items: + properties: + name: + description: the name, usually + uppercase + type: string + value: + description: the value + type: string + required: + - name + - value + type: object + type: array + name: + type: string + type: object + repoURL: + description: RepoURL is the repository + URL of the application manifests + type: string + targetRevision: + description: TargetRevision defines + the commit, tag, or branch in which + to sync the application to. If omitted, + will sync to HEAD + type: string + required: + - repoURL + type: object + syncPolicy: + description: SyncPolicy controls when + a sync will be performed + properties: + automated: + description: Automated will keep an + application synced to the target + revision + properties: + allowEmpty: + description: 'AllowEmpty allows + apps have zero live resources + (default: false)' + type: boolean + prune: + description: 'Prune will prune + resources automatically as part + of automated sync (default: + false)' + type: boolean + selfHeal: + description: 'SelfHeal enables + auto-syncing if (default: false)' + type: boolean + type: object + retry: + description: Retry controls failed + sync retry behavior + properties: + backoff: + description: Backoff is a backoff + strategy + properties: + duration: + description: Duration is the + amount to back off. Default + unit is seconds, but could + also be a duration (e.g. + "2m", "1h") + type: string + factor: + description: Factor is a factor + to multiply the base duration + after each failed retry + format: int64 + type: integer + maxDuration: + description: MaxDuration is + the maximum amount of time + allowed for the backoff + strategy + type: string + type: object + limit: + description: Limit is the maximum + number of attempts when retrying + a container + format: int64 + type: integer + type: object + syncOptions: + description: Options allow you to + specify whole app sync-options + items: + type: string + type: array + type: object + required: + - destination + - project + - source + type: object + required: + - metadata + - spec + type: object + type: object + type: object + type: array + template: + description: ApplicationSetTemplate represents argocd ApplicationSpec + properties: + metadata: + description: ApplicationSetTemplateMeta represents the + Argo CD application fields that may be used for Applications + generated from the ApplicationSet (based on metav1.ObjectMeta) + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + name: + type: string + namespace: + type: string + type: object + spec: + description: ApplicationSpec represents desired application + state. Contains link to repository with application + definition and additional parameters link definition + revision. + properties: + destination: + description: Destination overrides the kubernetes + server and namespace defined in the environment + ksonnet app.yaml + properties: + name: + description: Name of the destination cluster + which can be used instead of server (url) + field + type: string + namespace: + description: Namespace overrides the environment + namespace value in the ksonnet app.yaml + type: string + server: + description: Server overrides the environment + server value in the ksonnet app.yaml + type: string + type: object + ignoreDifferences: + description: IgnoreDifferences controls resources + fields which should be ignored during comparison + items: + description: ResourceIgnoreDifferences contains + resource filter and list of json paths which + should be ignored during comparison with live + state. + properties: + group: + type: string + jsonPointers: + items: + type: string + type: array + kind: + type: string + name: + type: string + namespace: + type: string + required: + - jsonPointers + - kind + type: object + type: array + info: + description: Infos contains a list of useful information + (URLs, email addresses, and plain text) that relates + to the application + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + project: + description: Project is a application project name. + Empty name means that application belongs to 'default' + project. + type: string + revisionHistoryLimit: + description: This limits this number of items kept + in the apps revision history. This should only + be changed in exceptional circumstances. Setting + to zero will store no history. This will reduce + storage used. Increasing will increase the space + used to store the history, so we do not recommend + increasing it. Default is 10. + format: int64 + type: integer + source: + description: Source is a reference to the location + ksonnet application definition + properties: + chart: + description: Chart is a Helm chart name + type: string + directory: + description: Directory holds path/directory + specific options + properties: + exclude: + type: string + jsonnet: + description: ApplicationSourceJsonnet holds + jsonnet specific options + properties: + extVars: + description: ExtVars is a list of Jsonnet + External Variables + items: + description: JsonnetVar is a jsonnet + variable + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + libs: + description: Additional library search + dirs + items: + type: string + type: array + tlas: + description: TLAS is a list of Jsonnet + Top-level Arguments + items: + description: JsonnetVar is a jsonnet + variable + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + recurse: + type: boolean + type: object + helm: + description: Helm holds helm specific options + properties: + fileParameters: + description: FileParameters are file parameters + to the helm template + items: + description: HelmFileParameter is a file + parameter to a helm template + properties: + name: + description: Name is the name of the + helm parameter + type: string + path: + description: Path is the path value + for the helm parameter + type: string + type: object + type: array + parameters: + description: Parameters are parameters to + the helm template + items: + description: HelmParameter is a parameter + to a helm template + properties: + forceString: + description: ForceString determines + whether to tell Helm to interpret + booleans and numbers as strings + type: boolean + name: + description: Name is the name of the + helm parameter + type: string + value: + description: Value is the value for + the helm parameter + type: string + type: object + type: array + releaseName: + description: The Helm release name. If omitted + it will use the application name + type: string + valueFiles: + description: ValuesFiles is a list of Helm + value files to use when generating a template + items: + type: string + type: array + values: + description: Values is Helm values, typically + defined as a block + type: string + version: + description: Version is the Helm version + to use for templating with + type: string + type: object + ksonnet: + description: Ksonnet holds ksonnet specific + options + properties: + environment: + description: Environment is a ksonnet application + environment name + type: string + parameters: + description: Parameters are a list of ksonnet + component parameter override values + items: + description: KsonnetParameter is a ksonnet + component parameter + properties: + component: + type: string + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + kustomize: + description: Kustomize holds kustomize specific + options + properties: + commonAnnotations: + additionalProperties: + type: string + description: CommonAnnotations adds additional + kustomize commonAnnotations + type: object + commonLabels: + additionalProperties: + type: string + description: CommonLabels adds additional + kustomize commonLabels + type: object + images: + description: Images are kustomize image + overrides + items: + type: string + type: array + namePrefix: + description: NamePrefix is a prefix appended + to resources for kustomize apps + type: string + nameSuffix: + description: NameSuffix is a suffix appended + to resources for kustomize apps + type: string + version: + description: Version contains optional Kustomize + version + type: string + type: object + path: + description: Path is a directory path within + the Git repository + type: string + plugin: + description: ConfigManagementPlugin holds config + management plugin specific options + properties: + env: + items: + properties: + name: + description: the name, usually uppercase + type: string + value: + description: the value + type: string + required: + - name + - value + type: object + type: array + name: + type: string + type: object + repoURL: + description: RepoURL is the repository URL of + the application manifests + type: string + targetRevision: + description: TargetRevision defines the commit, + tag, or branch in which to sync the application + to. If omitted, will sync to HEAD + type: string + required: + - repoURL + type: object + syncPolicy: + description: SyncPolicy controls when a sync will + be performed + properties: + automated: + description: Automated will keep an application + synced to the target revision + properties: + allowEmpty: + description: 'AllowEmpty allows apps have + zero live resources (default: false)' + type: boolean + prune: + description: 'Prune will prune resources + automatically as part of automated sync + (default: false)' + type: boolean + selfHeal: + description: 'SelfHeal enables auto-syncing + if (default: false)' + type: boolean + type: object + retry: + description: Retry controls failed sync retry + behavior + properties: + backoff: + description: Backoff is a backoff strategy + properties: + duration: + description: Duration is the amount + to back off. Default unit is seconds, + but could also be a duration (e.g. + "2m", "1h") + type: string + factor: + description: Factor is a factor to multiply + the base duration after each failed + retry + format: int64 + type: integer + maxDuration: + description: MaxDuration is the maximum + amount of time allowed for the backoff + strategy + type: string + type: object + limit: + description: Limit is the maximum number + of attempts when retrying a container + format: int64 + type: integer + type: object + syncOptions: + description: Options allow you to specify whole + app sync-options + items: + type: string + type: array + type: object + required: + - destination + - project + - source + type: object + required: + - metadata + - spec + type: object + required: + - generators + type: object + scmProvider: + description: SCMProviderGenerator defines a generator that scrapes + a SCMaaS API to find candidate repos. + properties: + cloneProtocol: + description: Which protocol to use for the SCM URL. Default + is provider-specific but ssh if possible. Not all providers + necessarily support all protocols. + type: string + filters: + description: TODO other providers. Filters for which repos + should be considered. + items: + description: SCMProviderGeneratorFilter is a single repository + filter. If multiple filter types are set on a single + struct, they will be AND'd together. All filters must + pass for a repo to be included. + properties: + branchMatch: + description: A regex which must match the branch name. + type: string + labelMatch: + description: A regex which must match at least one + label. + type: string + pathsExist: + description: An array of paths, all of which must + exist. + items: + type: string + type: array + repositoryMatch: + description: A regex for repo names. + type: string + type: object + type: array + github: + description: Which provider to use and config for it. + properties: + allBranches: + description: Scan all branches instead of just the default + branch. + type: boolean + api: + description: The GitHub API URL to talk to. If blank, + use https://api.github.com/. + type: string + organization: + description: GitHub org to scan. Required. + type: string + tokenRef: + description: Authentication token reference. + properties: + key: + type: string + secretName: + type: string + required: + - key + - secretName + type: object + required: + - organization + type: object + requeueAfterSeconds: + description: Standard parameters. + format: int64 + type: integer + template: + description: ApplicationSetTemplate represents argocd ApplicationSpec + properties: + metadata: + description: ApplicationSetTemplateMeta represents the + Argo CD application fields that may be used for Applications + generated from the ApplicationSet (based on metav1.ObjectMeta) + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + name: + type: string + namespace: + type: string + type: object + spec: + description: ApplicationSpec represents desired application + state. Contains link to repository with application + definition and additional parameters link definition + revision. + properties: + destination: + description: Destination overrides the kubernetes + server and namespace defined in the environment + ksonnet app.yaml + properties: + name: + description: Name of the destination cluster + which can be used instead of server (url) + field + type: string + namespace: + description: Namespace overrides the environment + namespace value in the ksonnet app.yaml + type: string + server: + description: Server overrides the environment + server value in the ksonnet app.yaml + type: string + type: object + ignoreDifferences: + description: IgnoreDifferences controls resources + fields which should be ignored during comparison + items: + description: ResourceIgnoreDifferences contains + resource filter and list of json paths which + should be ignored during comparison with live + state. + properties: + group: + type: string + jsonPointers: + items: + type: string + type: array + kind: + type: string + name: + type: string + namespace: + type: string + required: + - jsonPointers + - kind + type: object + type: array + info: + description: Infos contains a list of useful information + (URLs, email addresses, and plain text) that relates + to the application + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + project: + description: Project is a application project name. + Empty name means that application belongs to 'default' + project. + type: string + revisionHistoryLimit: + description: This limits this number of items kept + in the apps revision history. This should only + be changed in exceptional circumstances. Setting + to zero will store no history. This will reduce + storage used. Increasing will increase the space + used to store the history, so we do not recommend + increasing it. Default is 10. + format: int64 + type: integer + source: + description: Source is a reference to the location + ksonnet application definition + properties: + chart: + description: Chart is a Helm chart name + type: string + directory: + description: Directory holds path/directory + specific options + properties: + exclude: + type: string + jsonnet: + description: ApplicationSourceJsonnet holds + jsonnet specific options + properties: + extVars: + description: ExtVars is a list of Jsonnet + External Variables + items: + description: JsonnetVar is a jsonnet + variable + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + libs: + description: Additional library search + dirs + items: + type: string + type: array + tlas: + description: TLAS is a list of Jsonnet + Top-level Arguments + items: + description: JsonnetVar is a jsonnet + variable + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + recurse: + type: boolean + type: object + helm: + description: Helm holds helm specific options + properties: + fileParameters: + description: FileParameters are file parameters + to the helm template + items: + description: HelmFileParameter is a file + parameter to a helm template + properties: + name: + description: Name is the name of the + helm parameter + type: string + path: + description: Path is the path value + for the helm parameter + type: string + type: object + type: array + parameters: + description: Parameters are parameters to + the helm template + items: + description: HelmParameter is a parameter + to a helm template + properties: + forceString: + description: ForceString determines + whether to tell Helm to interpret + booleans and numbers as strings + type: boolean + name: + description: Name is the name of the + helm parameter + type: string + value: + description: Value is the value for + the helm parameter + type: string + type: object + type: array + releaseName: + description: The Helm release name. If omitted + it will use the application name + type: string + valueFiles: + description: ValuesFiles is a list of Helm + value files to use when generating a template + items: + type: string + type: array + values: + description: Values is Helm values, typically + defined as a block + type: string + version: + description: Version is the Helm version + to use for templating with + type: string + type: object + ksonnet: + description: Ksonnet holds ksonnet specific + options + properties: + environment: + description: Environment is a ksonnet application + environment name + type: string + parameters: + description: Parameters are a list of ksonnet + component parameter override values + items: + description: KsonnetParameter is a ksonnet + component parameter + properties: + component: + type: string + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + kustomize: + description: Kustomize holds kustomize specific + options + properties: + commonAnnotations: + additionalProperties: + type: string + description: CommonAnnotations adds additional + kustomize commonAnnotations + type: object + commonLabels: + additionalProperties: + type: string + description: CommonLabels adds additional + kustomize commonLabels + type: object + images: + description: Images are kustomize image + overrides + items: + type: string + type: array + namePrefix: + description: NamePrefix is a prefix appended + to resources for kustomize apps + type: string + nameSuffix: + description: NameSuffix is a suffix appended + to resources for kustomize apps + type: string + version: + description: Version contains optional Kustomize + version + type: string + type: object + path: + description: Path is a directory path within + the Git repository + type: string + plugin: + description: ConfigManagementPlugin holds config + management plugin specific options + properties: + env: + items: + properties: + name: + description: the name, usually uppercase + type: string + value: + description: the value + type: string + required: + - name + - value + type: object + type: array + name: + type: string + type: object + repoURL: + description: RepoURL is the repository URL of + the application manifests + type: string + targetRevision: + description: TargetRevision defines the commit, + tag, or branch in which to sync the application + to. If omitted, will sync to HEAD + type: string + required: + - repoURL + type: object + syncPolicy: + description: SyncPolicy controls when a sync will + be performed + properties: + automated: + description: Automated will keep an application + synced to the target revision + properties: + allowEmpty: + description: 'AllowEmpty allows apps have + zero live resources (default: false)' + type: boolean + prune: + description: 'Prune will prune resources + automatically as part of automated sync + (default: false)' + type: boolean + selfHeal: + description: 'SelfHeal enables auto-syncing + if (default: false)' + type: boolean + type: object + retry: + description: Retry controls failed sync retry + behavior + properties: + backoff: + description: Backoff is a backoff strategy + properties: + duration: + description: Duration is the amount + to back off. Default unit is seconds, + but could also be a duration (e.g. + "2m", "1h") + type: string + factor: + description: Factor is a factor to multiply + the base duration after each failed + retry + format: int64 + type: integer + maxDuration: + description: MaxDuration is the maximum + amount of time allowed for the backoff + strategy + type: string + type: object + limit: + description: Limit is the maximum number + of attempts when retrying a container + format: int64 + type: integer + type: object + syncOptions: + description: Options allow you to specify whole + app sync-options + items: + type: string + type: array + type: object + required: + - destination + - project + - source + type: object + required: + - metadata + - spec + type: object + type: object + type: object + type: array + syncPolicy: + description: ApplicationSetSyncPolicy configures how generated Applications + will relate to their ApplicationSet. + properties: + preserveResourcesOnDeletion: + description: PreserveResourcesOnDeletion will preserve resources + on deletion. If PreserveResourcesOnDeletion is set to true, + these Applications will not be deleted. + type: boolean + type: object + template: + description: ApplicationSetTemplate represents argocd ApplicationSpec + properties: + metadata: + description: ApplicationSetTemplateMeta represents the Argo CD + application fields that may be used for Applications generated + from the ApplicationSet (based on metav1.ObjectMeta) + properties: + annotations: + additionalProperties: + type: string + type: object + labels: + additionalProperties: + type: string + type: object + name: + type: string + namespace: + type: string + type: object + spec: + description: ApplicationSpec represents desired application state. + Contains link to repository with application definition and + additional parameters link definition revision. + properties: + destination: + description: Destination overrides the kubernetes server and + namespace defined in the environment ksonnet app.yaml + properties: + name: + description: Name of the destination cluster which can + be used instead of server (url) field + type: string + namespace: + description: Namespace overrides the environment namespace + value in the ksonnet app.yaml + type: string + server: + description: Server overrides the environment server value + in the ksonnet app.yaml + type: string + type: object + ignoreDifferences: + description: IgnoreDifferences controls resources fields which + should be ignored during comparison + items: + description: ResourceIgnoreDifferences contains resource + filter and list of json paths which should be ignored + during comparison with live state. + properties: + group: + type: string + jsonPointers: + items: + type: string + type: array + kind: + type: string + name: + type: string + namespace: + type: string + required: + - jsonPointers + - kind + type: object + type: array + info: + description: Infos contains a list of useful information (URLs, + email addresses, and plain text) that relates to the application + items: + properties: + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + project: + description: Project is a application project name. Empty + name means that application belongs to 'default' project. + type: string + revisionHistoryLimit: + description: This limits this number of items kept in the + apps revision history. This should only be changed in exceptional + circumstances. Setting to zero will store no history. This + will reduce storage used. Increasing will increase the space + used to store the history, so we do not recommend increasing + it. Default is 10. + format: int64 + type: integer + source: + description: Source is a reference to the location ksonnet + application definition + properties: + chart: + description: Chart is a Helm chart name + type: string + directory: + description: Directory holds path/directory specific options + properties: + exclude: + type: string + jsonnet: + description: ApplicationSourceJsonnet holds jsonnet + specific options + properties: + extVars: + description: ExtVars is a list of Jsonnet External + Variables + items: + description: JsonnetVar is a jsonnet variable + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + libs: + description: Additional library search dirs + items: + type: string + type: array + tlas: + description: TLAS is a list of Jsonnet Top-level + Arguments + items: + description: JsonnetVar is a jsonnet variable + properties: + code: + type: boolean + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + recurse: + type: boolean + type: object + helm: + description: Helm holds helm specific options + properties: + fileParameters: + description: FileParameters are file parameters to + the helm template + items: + description: HelmFileParameter is a file parameter + to a helm template + properties: + name: + description: Name is the name of the helm parameter + type: string + path: + description: Path is the path value for the + helm parameter + type: string + type: object + type: array + parameters: + description: Parameters are parameters to the helm + template + items: + description: HelmParameter is a parameter to a helm + template + properties: + forceString: + description: ForceString determines whether + to tell Helm to interpret booleans and numbers + as strings + type: boolean + name: + description: Name is the name of the helm parameter + type: string + value: + description: Value is the value for the helm + parameter + type: string + type: object + type: array + releaseName: + description: The Helm release name. If omitted it + will use the application name + type: string + valueFiles: + description: ValuesFiles is a list of Helm value files + to use when generating a template + items: + type: string + type: array + values: + description: Values is Helm values, typically defined + as a block + type: string + version: + description: Version is the Helm version to use for + templating with + type: string + type: object + ksonnet: + description: Ksonnet holds ksonnet specific options + properties: + environment: + description: Environment is a ksonnet application + environment name + type: string + parameters: + description: Parameters are a list of ksonnet component + parameter override values + items: + description: KsonnetParameter is a ksonnet component + parameter + properties: + component: + type: string + name: + type: string + value: + type: string + required: + - name + - value + type: object + type: array + type: object + kustomize: + description: Kustomize holds kustomize specific options + properties: + commonAnnotations: + additionalProperties: + type: string + description: CommonAnnotations adds additional kustomize + commonAnnotations + type: object + commonLabels: + additionalProperties: + type: string + description: CommonLabels adds additional kustomize + commonLabels + type: object + images: + description: Images are kustomize image overrides + items: + type: string + type: array + namePrefix: + description: NamePrefix is a prefix appended to resources + for kustomize apps + type: string + nameSuffix: + description: NameSuffix is a suffix appended to resources + for kustomize apps + type: string + version: + description: Version contains optional Kustomize version + type: string + type: object + path: + description: Path is a directory path within the Git repository + type: string + plugin: + description: ConfigManagementPlugin holds config management + plugin specific options + properties: + env: + items: + properties: + name: + description: the name, usually uppercase + type: string + value: + description: the value + type: string + required: + - name + - value + type: object + type: array + name: + type: string + type: object + repoURL: + description: RepoURL is the repository URL of the application + manifests + type: string + targetRevision: + description: TargetRevision defines the commit, tag, or + branch in which to sync the application to. If omitted, + will sync to HEAD + type: string + required: + - repoURL + type: object + syncPolicy: + description: SyncPolicy controls when a sync will be performed + properties: + automated: + description: Automated will keep an application synced + to the target revision + properties: + allowEmpty: + description: 'AllowEmpty allows apps have zero live + resources (default: false)' + type: boolean + prune: + description: 'Prune will prune resources automatically + as part of automated sync (default: false)' + type: boolean + selfHeal: + description: 'SelfHeal enables auto-syncing if (default: + false)' + type: boolean + type: object + retry: + description: Retry controls failed sync retry behavior + properties: + backoff: + description: Backoff is a backoff strategy + properties: + duration: + description: Duration is the amount to back off. + Default unit is seconds, but could also be a + duration (e.g. "2m", "1h") + type: string + factor: + description: Factor is a factor to multiply the + base duration after each failed retry + format: int64 + type: integer + maxDuration: + description: MaxDuration is the maximum amount + of time allowed for the backoff strategy + type: string + type: object + limit: + description: Limit is the maximum number of attempts + when retrying a container + format: int64 + type: integer + type: object + syncOptions: + description: Options allow you to specify whole app sync-options + items: + type: string + type: array + type: object + required: + - destination + - project + - source + type: object + required: + - metadata + - spec + type: object + required: + - generators + - template + type: object + status: + description: ApplicationSetStatus defines the observed state of ApplicationSet + type: object + required: + - metadata + - spec + type: object + served: true + storage: true +status: + acceptedNames: + kind: "" + plural: "" + conditions: [] + storedVersions: [] +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + labels: + app.kubernetes.io/name: appprojects.argoproj.io + app.kubernetes.io/part-of: argocd + name: appprojects.argoproj.io +spec: + group: argoproj.io + names: + kind: AppProject + listKind: AppProjectList + plural: appprojects + shortNames: + - appproj + - appprojs + singular: appproject + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: 'AppProject provides a logical grouping of applications, providing + controls for: * where the apps may deploy to (cluster whitelist) * what + may be deployed (repository whitelist, resource whitelist/blacklist) * who + can access these applications (roles, OIDC group claims bindings) * and + what they can do (RBAC policies) * automation access to these roles (JWT + tokens)' + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation + of an object. Servers should convert recognized schemas to the latest + internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this + object represents. Servers may infer this from the endpoint the client + submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: AppProjectSpec is the specification of an AppProject + properties: + clusterResourceBlacklist: + description: ClusterResourceBlacklist contains list of blacklisted + cluster level resources + items: + description: GroupKind specifies a Group and a Kind, but does not + force a version. This is useful for identifying concepts during + lookup stages without having partially valid types + properties: + group: + type: string + kind: + type: string + required: + - group + - kind + type: object + type: array + clusterResourceWhitelist: + description: ClusterResourceWhitelist contains list of whitelisted + cluster level resources + items: + description: GroupKind specifies a Group and a Kind, but does not + force a version. This is useful for identifying concepts during + lookup stages without having partially valid types + properties: + group: + type: string + kind: + type: string + required: + - group + - kind + type: object + type: array + description: + description: Description contains optional project description + type: string + destinations: + description: Destinations contains list of destinations available + for deployment + items: + description: ApplicationDestination holds information about the + application's destination + properties: + name: + description: Name is an alternate way of specifying the target + cluster by its symbolic name + type: string + namespace: + description: Namespace specifies the target namespace for the + application's resources. The namespace will only be set for + namespace-scoped resources that have not set a value for .metadata.namespace + type: string + server: + description: Server specifies the URL of the target cluster + and must be set to the Kubernetes control plane API + type: string + type: object + type: array + namespaceResourceBlacklist: + description: NamespaceResourceBlacklist contains list of blacklisted + namespace level resources + items: + description: GroupKind specifies a Group and a Kind, but does not + force a version. This is useful for identifying concepts during + lookup stages without having partially valid types + properties: + group: + type: string + kind: + type: string + required: + - group + - kind + type: object + type: array + namespaceResourceWhitelist: + description: NamespaceResourceWhitelist contains list of whitelisted + namespace level resources + items: + description: GroupKind specifies a Group and a Kind, but does not + force a version. This is useful for identifying concepts during + lookup stages without having partially valid types + properties: + group: + type: string + kind: + type: string + required: + - group + - kind + type: object + type: array + orphanedResources: + description: OrphanedResources specifies if controller should monitor + orphaned resources of apps in this project + properties: + ignore: + description: Ignore contains a list of resources that are to be + excluded from orphaned resources monitoring + items: + description: OrphanedResourceKey is a reference to a resource + to be ignored from + properties: + group: + type: string + kind: + type: string + name: + type: string + type: object + type: array + warn: + description: Warn indicates if warning condition should be created + for apps which have orphaned resources + type: boolean + type: object + roles: + description: Roles are user defined RBAC roles associated with this + project + items: + description: ProjectRole represents a role that has access to a + project + properties: + description: + description: Description is a description of the role + type: string + groups: + description: Groups are a list of OIDC group claims bound to + this role + items: + type: string + type: array + jwtTokens: + description: JWTTokens are a list of generated JWT tokens bound + to this role + items: + description: JWTToken holds the issuedAt and expiresAt values + of a token + properties: + exp: + format: int64 + type: integer + iat: + format: int64 + type: integer + id: + type: string + required: + - iat + type: object + type: array + name: + description: Name is a name for this role + type: string + policies: + description: Policies Stores a list of casbin formated strings + that define access policies for the role in the project + items: + type: string + type: array + required: + - name + type: object + type: array + signatureKeys: + description: SignatureKeys contains a list of PGP key IDs that commits + in Git must be signed with in order to be allowed for sync + items: + description: SignatureKey is the specification of a key required + to verify commit signatures with + properties: + keyID: + description: The ID of the key in hexadecimal notation + type: string + required: + - keyID + type: object + type: array + sourceRepos: + description: SourceRepos contains list of repository URLs which can + be used for deployment + items: + type: string + type: array + syncWindows: + description: SyncWindows controls when syncs can be run for apps in + this project + items: + description: SyncWindow contains the kind, time, duration and attributes + that are used to assign the syncWindows to apps + properties: + applications: + description: Applications contains a list of applications that + the window will apply to + items: + type: string + type: array + clusters: + description: Clusters contains a list of clusters that the window + will apply to + items: + type: string + type: array + duration: + description: Duration is the amount of time the sync window + will be open + type: string + kind: + description: Kind defines if the window allows or blocks syncs + type: string + manualSync: + description: ManualSync enables manual syncs when they would + otherwise be blocked + type: boolean + namespaces: + description: Namespaces contains a list of namespaces that the + window will apply to + items: + type: string + type: array + schedule: + description: Schedule is the time the window will begin, specified + in cron format + type: string + type: object + type: array + type: object + status: + description: AppProjectStatus contains status information for AppProject + CRs + properties: + jwtTokensByRole: + additionalProperties: + description: JWTTokens represents a list of JWT tokens + properties: + items: + items: + description: JWTToken holds the issuedAt and expiresAt values + of a token + properties: + exp: + format: int64 + type: integer + iat: + format: int64 + type: integer + id: + type: string + required: + - iat + type: object + type: array + type: object + description: JWTTokensByRole contains a list of JWT tokens issued + for a given role + type: object + type: object + required: + - metadata + - spec + type: object + served: true + storage: true +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + labels: + app.kubernetes.io/component: controller + app.kubernetes.io/name: argocd-applicationset-controller + app.kubernetes.io/part-of: argocd-applicationset + name: argocd-applicationset-controller + namespace: argocd +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + labels: + app.kubernetes.io/component: application-controller + app.kubernetes.io/name: argocd-application-controller + app.kubernetes.io/part-of: argocd + name: argocd-application-controller +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + labels: + app.kubernetes.io/component: dex-server + app.kubernetes.io/name: argocd-dex-server + app.kubernetes.io/part-of: argocd + name: argocd-dex-server +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + labels: + app.kubernetes.io/component: redis + app.kubernetes.io/name: argocd-redis + app.kubernetes.io/part-of: argocd + name: argocd-redis +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + labels: + app.kubernetes.io/component: server + app.kubernetes.io/name: argocd-server + app.kubernetes.io/part-of: argocd + name: argocd-server +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + labels: + app.kubernetes.io/component: controller + app.kubernetes.io/name: argocd-applicationset-controller + app.kubernetes.io/part-of: argocd-applicationset + name: argocd-applicationset-controller + namespace: argocd +rules: +- apiGroups: + - argoproj.io + resources: + - applications + - appprojects + - applicationsets + - applicationsets/finalizers + verbs: + - create + - delete + - get + - list + - patch + - update + - watch +- apiGroups: + - argoproj.io + resources: + - applicationsets/status + verbs: + - get + - patch + - update +- apiGroups: + - "" + resources: + - events + verbs: + - create + - get + - list + - patch + - watch +- apiGroups: + - "" + resources: + - secrets + - configmaps + verbs: + - get + - list + - watch +- apiGroups: + - apps + - extensions + resources: + - deployments + verbs: + - get + - list + - watch +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + labels: + app.kubernetes.io/component: application-controller + app.kubernetes.io/name: argocd-application-controller + app.kubernetes.io/part-of: argocd + name: argocd-application-controller +rules: +- apiGroups: + - "" + resources: + - secrets + - configmaps + verbs: + - get + - list + - watch +- apiGroups: + - argoproj.io + resources: + - applications + - appprojects + verbs: + - create + - get + - list + - watch + - update + - patch + - delete +- apiGroups: + - "" + resources: + - events + verbs: + - create + - list +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + labels: + app.kubernetes.io/component: dex-server + app.kubernetes.io/name: argocd-dex-server + app.kubernetes.io/part-of: argocd + name: argocd-dex-server +rules: +- apiGroups: + - "" + resources: + - secrets + - configmaps + verbs: + - get + - list + - watch +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + labels: + app.kubernetes.io/component: redis + app.kubernetes.io/name: argocd-redis + app.kubernetes.io/part-of: argocd + name: argocd-redis +rules: +- apiGroups: + - security.openshift.io + resourceNames: + - nonroot + resources: + - securitycontextconstraints + verbs: + - use +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + labels: + app.kubernetes.io/component: server + app.kubernetes.io/name: argocd-server + app.kubernetes.io/part-of: argocd + name: argocd-server +rules: +- apiGroups: + - "" + resources: + - secrets + - configmaps + verbs: + - create + - get + - list + - watch + - update + - patch + - delete +- apiGroups: + - argoproj.io + resources: + - applications + - appprojects + verbs: + - create + - get + - list + - watch + - update + - delete + - patch +- apiGroups: + - "" + resources: + - events + verbs: + - create + - list +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + labels: + app.kubernetes.io/component: application-controller + app.kubernetes.io/name: argocd-application-controller + app.kubernetes.io/part-of: argocd + name: argocd-application-controller +rules: +- apiGroups: + - '*' + resources: + - '*' + verbs: + - '*' +- nonResourceURLs: + - '*' + verbs: + - '*' +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + labels: + app.kubernetes.io/component: server + app.kubernetes.io/name: argocd-server + app.kubernetes.io/part-of: argocd + name: argocd-server +rules: +- apiGroups: + - '*' + resources: + - '*' + verbs: + - delete + - get + - patch +- apiGroups: + - "" + resources: + - events + verbs: + - list +- apiGroups: + - "" + resources: + - pods + - pods/log + verbs: + - get +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + labels: + app.kubernetes.io/component: controller + app.kubernetes.io/name: argocd-applicationset-controller + app.kubernetes.io/part-of: argocd-applicationset + name: argocd-applicationset-controller + namespace: argocd +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: argocd-applicationset-controller +subjects: +- kind: ServiceAccount + name: argocd-applicationset-controller + namespace: argocd +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + labels: + app.kubernetes.io/component: application-controller + app.kubernetes.io/name: argocd-application-controller + app.kubernetes.io/part-of: argocd + name: argocd-application-controller +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: argocd-application-controller +subjects: +- kind: ServiceAccount + name: argocd-application-controller +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + labels: + app.kubernetes.io/component: dex-server + app.kubernetes.io/name: argocd-dex-server + app.kubernetes.io/part-of: argocd + name: argocd-dex-server +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: argocd-dex-server +subjects: +- kind: ServiceAccount + name: argocd-dex-server +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + labels: + app.kubernetes.io/component: redis + app.kubernetes.io/name: argocd-redis + app.kubernetes.io/part-of: argocd + name: argocd-redis +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: argocd-redis +subjects: +- kind: ServiceAccount + name: argocd-redis +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + labels: + app.kubernetes.io/component: server + app.kubernetes.io/name: argocd-server + app.kubernetes.io/part-of: argocd + name: argocd-server +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: Role + name: argocd-server +subjects: +- kind: ServiceAccount + name: argocd-server +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + labels: + app.kubernetes.io/component: application-controller + app.kubernetes.io/name: argocd-application-controller + app.kubernetes.io/part-of: argocd + name: argocd-application-controller +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: argocd-application-controller +subjects: +- kind: ServiceAccount + name: argocd-application-controller + namespace: default +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + labels: + app.kubernetes.io/component: server + app.kubernetes.io/name: argocd-server + app.kubernetes.io/part-of: argocd + name: argocd-server +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: argocd-server +subjects: +- kind: ServiceAccount + name: argocd-server + namespace: default +--- +apiVersion: v1 +data: + timeout.reconciliation: 20s +kind: ConfigMap +metadata: + labels: + app.kubernetes.io/name: argocd-cm + app.kubernetes.io/part-of: argocd + name: argocd-cm +--- +apiVersion: v1 +kind: ConfigMap +metadata: + labels: + app.kubernetes.io/name: argocd-gpg-keys-cm + app.kubernetes.io/part-of: argocd + name: argocd-gpg-keys-cm +--- +apiVersion: v1 +kind: ConfigMap +metadata: + labels: + app.kubernetes.io/name: argocd-rbac-cm + app.kubernetes.io/part-of: argocd + name: argocd-rbac-cm +--- +apiVersion: v1 +data: + ssh_known_hosts: | + bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw== + github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== + gitlab.com ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFSMqzJeV9rUzU4kWitGjeR4PWSa29SPqJ1fVkhtj3Hw9xjLVXVYrU9QlYWrOLXBpQ6KWjbjTDTdDkoohFzgbEY= + gitlab.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAfuCHKVTjquxvt6CM6tdG4SLp1Btn/nOeHHE5UOzRdf + gitlab.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCsj2bNKTBSpIYDEGk9KxsGh3mySTRgMtXL583qmBpzeQ+jqCMRgBqB98u3z++J1sKlXHWfM9dyhSevkMwSbhoR8XIq/U0tCNyokEi/ueaBMCvbcTHhO7FcwzY92WK4Yt0aGROY5qX2UKSeOvuP4D6TPqKF1onrSzH9bx9XUf2lEdWT/ia1NEKjunUqu1xOB/StKDHMoX4/OKyIzuS0q/T1zOATthvasJFoPrAjkohTyaDUz2LN5JoH839hViyEG82yB+MjcFV5MU3N1l1QL3cVUCh93xSaua1N85qivl+siMkPGbO5xR/En4iEY6K2XPASUEMaieWVNTRCtJ4S8H+9 + ssh.dev.azure.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC7Hr1oTWqNqOlzGJOfGJ4NakVyIzf1rXYd4d7wo6jBlkLvCA4odBlL0mDUyZ0/QUfTTqeu+tm22gOsv+VrVTMk6vwRU75gY/y9ut5Mb3bR5BV58dKXyq9A9UeB5Cakehn5Zgm6x1mKoVyf+FFn26iYqXJRgzIZZcZ5V6hrE0Qg39kZm4az48o0AUbf6Sp4SLdvnuMa2sVNwHBboS7EJkm57XQPVU3/QpyNLHbWDdzwtrlS+ez30S3AdYhLKEOxAG8weOnyrtLJAUen9mTkol8oII1edf7mWWbWVf0nBmly21+nZcmCTISQBtdcyPaEno7fFQMDD26/s0lfKob4Kw8H + vs-ssh.visualstudio.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC7Hr1oTWqNqOlzGJOfGJ4NakVyIzf1rXYd4d7wo6jBlkLvCA4odBlL0mDUyZ0/QUfTTqeu+tm22gOsv+VrVTMk6vwRU75gY/y9ut5Mb3bR5BV58dKXyq9A9UeB5Cakehn5Zgm6x1mKoVyf+FFn26iYqXJRgzIZZcZ5V6hrE0Qg39kZm4az48o0AUbf6Sp4SLdvnuMa2sVNwHBboS7EJkm57XQPVU3/QpyNLHbWDdzwtrlS+ez30S3AdYhLKEOxAG8weOnyrtLJAUen9mTkol8oII1edf7mWWbWVf0nBmly21+nZcmCTISQBtdcyPaEno7fFQMDD26/s0lfKob4Kw8H +kind: ConfigMap +metadata: + labels: + app.kubernetes.io/name: argocd-ssh-known-hosts-cm + app.kubernetes.io/part-of: argocd + name: argocd-ssh-known-hosts-cm +--- +apiVersion: v1 +data: null +kind: ConfigMap +metadata: + labels: + app.kubernetes.io/name: argocd-tls-certs-cm + app.kubernetes.io/part-of: argocd + name: argocd-tls-certs-cm +--- +apiVersion: v1 +kind: Secret +metadata: + labels: + app.kubernetes.io/name: argocd-secret + app.kubernetes.io/part-of: argocd + name: argocd-secret +type: Opaque +--- +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/component: dex-server + app.kubernetes.io/name: argocd-dex-server + app.kubernetes.io/part-of: argocd + name: argocd-dex-server +spec: + ports: + - name: http + port: 5556 + protocol: TCP + targetPort: 5556 + - name: grpc + port: 5557 + protocol: TCP + targetPort: 5557 + - name: metrics + port: 5558 + protocol: TCP + targetPort: 5558 + selector: + app.kubernetes.io/name: argocd-dex-server +--- +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/component: metrics + app.kubernetes.io/name: argocd-metrics + app.kubernetes.io/part-of: argocd + name: argocd-metrics +spec: + ports: + - name: metrics + port: 8082 + protocol: TCP + targetPort: 8082 + selector: + app.kubernetes.io/name: argocd-application-controller +--- +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/component: redis + app.kubernetes.io/name: argocd-redis + app.kubernetes.io/part-of: argocd + name: argocd-redis +spec: + ports: + - name: tcp-redis + port: 6379 + targetPort: 6379 + selector: + app.kubernetes.io/name: argocd-redis +--- +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/component: repo-server + app.kubernetes.io/name: argocd-repo-server + app.kubernetes.io/part-of: argocd + name: argocd-repo-server +spec: + ports: + - name: server + port: 8081 + protocol: TCP + targetPort: 8081 + - name: metrics + port: 8084 + protocol: TCP + targetPort: 8084 + selector: + app.kubernetes.io/name: argocd-repo-server +--- +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/component: server + app.kubernetes.io/name: argocd-server + app.kubernetes.io/part-of: argocd + name: argocd-server +spec: + ports: + - name: http + port: 80 + protocol: TCP + targetPort: 8080 + - name: https + port: 443 + protocol: TCP + targetPort: 8080 + selector: + app.kubernetes.io/name: argocd-server +--- +apiVersion: v1 +kind: Service +metadata: + labels: + app.kubernetes.io/component: server + app.kubernetes.io/name: argocd-server-metrics + app.kubernetes.io/part-of: argocd + name: argocd-server-metrics +spec: + ports: + - name: metrics + port: 8083 + protocol: TCP + targetPort: 8083 + selector: + app.kubernetes.io/name: argocd-server +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app.kubernetes.io/component: controller + app.kubernetes.io/name: argocd-applicationset-controller + app.kubernetes.io/part-of: argocd-applicationset + name: argocd-applicationset-controller + namespace: argocd +spec: + selector: + matchLabels: + app.kubernetes.io/name: argocd-applicationset-controller + template: + metadata: + labels: + app.kubernetes.io/name: argocd-applicationset-controller + spec: + containers: + - command: + - applicationset-controller + env: + - name: NAMESPACE + valueFrom: + fieldRef: + fieldPath: metadata.namespace + image: quay.io/argoproj/argocd-applicationset:latest + imagePullPolicy: Always + name: argocd-applicationset-controller + volumeMounts: + - mountPath: /app/config/ssh + name: ssh-known-hosts + - mountPath: /app/config/tls + name: tls-certs + - mountPath: /app/config/gpg/source + name: gpg-keys + - mountPath: /app/config/gpg/keys + name: gpg-keyring + serviceAccountName: argocd-applicationset-controller + volumes: + - configMap: + name: argocd-ssh-known-hosts-cm + name: ssh-known-hosts + - configMap: + name: argocd-tls-certs-cm + name: tls-certs + - configMap: + name: argocd-gpg-keys-cm + name: gpg-keys + - emptyDir: {} + name: gpg-keyring +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app.kubernetes.io/component: dex-server + app.kubernetes.io/name: argocd-dex-server + app.kubernetes.io/part-of: argocd + name: argocd-dex-server +spec: + selector: + matchLabels: + app.kubernetes.io/name: argocd-dex-server + template: + metadata: + labels: + app.kubernetes.io/name: argocd-dex-server + spec: + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - podAffinityTerm: + labelSelector: + matchLabels: + app.kubernetes.io/part-of: argocd + topologyKey: kubernetes.io/hostname + weight: 5 + containers: + - command: + - /shared/argocd-dex + - rundex + image: ghcr.io/dexidp/dex:v2.27.0 + imagePullPolicy: Always + name: dex + ports: + - containerPort: 5556 + - containerPort: 5557 + - containerPort: 5558 + volumeMounts: + - mountPath: /shared + name: static-files + initContainers: + - command: + - cp + - -n + - /usr/local/bin/argocd + - /shared/argocd-dex + image: quay.io/argoproj/argocd:v2.0.4 + imagePullPolicy: Always + name: copyutil + volumeMounts: + - mountPath: /shared + name: static-files + serviceAccountName: argocd-dex-server + volumes: + - emptyDir: {} + name: static-files +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app.kubernetes.io/component: redis + app.kubernetes.io/name: argocd-redis + app.kubernetes.io/part-of: argocd + name: argocd-redis +spec: + selector: + matchLabels: + app.kubernetes.io/name: argocd-redis + template: + metadata: + labels: + app.kubernetes.io/name: argocd-redis + spec: + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - podAffinityTerm: + labelSelector: + matchLabels: + app.kubernetes.io/name: argocd-redis + topologyKey: kubernetes.io/hostname + weight: 100 + - podAffinityTerm: + labelSelector: + matchLabels: + app.kubernetes.io/part-of: argocd + topologyKey: kubernetes.io/hostname + weight: 5 + containers: + - args: + - --save + - "" + - --appendonly + - "no" + image: redis:6.2.4-alpine + imagePullPolicy: Always + name: redis + ports: + - containerPort: 6379 + securityContext: + fsGroup: 1000 + runAsGroup: 1000 + runAsNonRoot: true + runAsUser: 1000 + serviceAccountName: argocd-redis +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app.kubernetes.io/component: repo-server + app.kubernetes.io/name: argocd-repo-server + app.kubernetes.io/part-of: argocd + name: argocd-repo-server +spec: + selector: + matchLabels: + app.kubernetes.io/name: argocd-repo-server + template: + metadata: + labels: + app.kubernetes.io/name: argocd-repo-server + spec: + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - podAffinityTerm: + labelSelector: + matchLabels: + app.kubernetes.io/name: argocd-repo-server + topologyKey: kubernetes.io/hostname + weight: 100 + - podAffinityTerm: + labelSelector: + matchLabels: + app.kubernetes.io/part-of: argocd + topologyKey: kubernetes.io/hostname + weight: 5 + automountServiceAccountToken: false + containers: + - command: + - uid_entrypoint.sh + - argocd-repo-server + - --redis + - argocd-redis:6379 + image: quay.io/argoproj/argocd:v2.0.4 + imagePullPolicy: Always + livenessProbe: + failureThreshold: 3 + httpGet: + path: /healthz?full=true + port: 8084 + initialDelaySeconds: 30 + periodSeconds: 5 + name: argocd-repo-server + ports: + - containerPort: 8081 + - containerPort: 8084 + readinessProbe: + httpGet: + path: /healthz + port: 8084 + initialDelaySeconds: 5 + periodSeconds: 10 + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - all + volumeMounts: + - mountPath: /app/config/ssh + name: ssh-known-hosts + - mountPath: /app/config/tls + name: tls-certs + - mountPath: /app/config/gpg/source + name: gpg-keys + - mountPath: /app/config/gpg/keys + name: gpg-keyring + - mountPath: /app/config/reposerver/tls + name: argocd-repo-server-tls + volumes: + - configMap: + name: argocd-ssh-known-hosts-cm + name: ssh-known-hosts + - configMap: + name: argocd-tls-certs-cm + name: tls-certs + - configMap: + name: argocd-gpg-keys-cm + name: gpg-keys + - emptyDir: {} + name: gpg-keyring + - name: argocd-repo-server-tls + secret: + items: + - key: tls.crt + path: tls.crt + - key: tls.key + path: tls.key + - key: ca.crt + path: ca.crt + optional: true + secretName: argocd-repo-server-tls +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app.kubernetes.io/component: server + app.kubernetes.io/name: argocd-server + app.kubernetes.io/part-of: argocd + name: argocd-server +spec: + selector: + matchLabels: + app.kubernetes.io/name: argocd-server + template: + metadata: + labels: + app.kubernetes.io/name: argocd-server + spec: + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - podAffinityTerm: + labelSelector: + matchLabels: + app.kubernetes.io/name: argocd-server + topologyKey: kubernetes.io/hostname + weight: 100 + - podAffinityTerm: + labelSelector: + matchLabels: + app.kubernetes.io/part-of: argocd + topologyKey: kubernetes.io/hostname + weight: 5 + containers: + - command: + - argocd-server + - --staticassets + - /shared/app + image: quay.io/argoproj/argocd:v2.0.4 + imagePullPolicy: Always + livenessProbe: + httpGet: + path: /healthz?full=true + port: 8080 + initialDelaySeconds: 3 + periodSeconds: 30 + name: argocd-server + ports: + - containerPort: 8080 + - containerPort: 8083 + readinessProbe: + httpGet: + path: /healthz + port: 8080 + initialDelaySeconds: 3 + periodSeconds: 30 + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - all + volumeMounts: + - mountPath: /app/config/ssh + name: ssh-known-hosts + - mountPath: /app/config/tls + name: tls-certs + - mountPath: /app/config/server/tls + name: argocd-repo-server-tls + serviceAccountName: argocd-server + volumes: + - emptyDir: {} + name: static-files + - configMap: + name: argocd-ssh-known-hosts-cm + name: ssh-known-hosts + - configMap: + name: argocd-tls-certs-cm + name: tls-certs + - name: argocd-repo-server-tls + secret: + items: + - key: tls.crt + path: tls.crt + - key: tls.key + path: tls.key + - key: ca.crt + path: ca.crt + optional: true + secretName: argocd-repo-server-tls +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + labels: + app.kubernetes.io/component: application-controller + app.kubernetes.io/name: argocd-application-controller + app.kubernetes.io/part-of: argocd + name: argocd-application-controller +spec: + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: argocd-application-controller + serviceName: argocd-application-controller + template: + metadata: + labels: + app.kubernetes.io/name: argocd-application-controller + spec: + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - podAffinityTerm: + labelSelector: + matchLabels: + app.kubernetes.io/name: argocd-application-controller + topologyKey: kubernetes.io/hostname + weight: 100 + - podAffinityTerm: + labelSelector: + matchLabels: + app.kubernetes.io/part-of: argocd + topologyKey: kubernetes.io/hostname + weight: 5 + containers: + - command: + - argocd-application-controller + - --status-processors + - "20" + - --operation-processors + - "10" + - --app-resync + - "20" + image: quay.io/argoproj/argocd:v2.0.4 + imagePullPolicy: Always + livenessProbe: + httpGet: + path: /healthz + port: 8082 + initialDelaySeconds: 5 + periodSeconds: 10 + name: argocd-application-controller + ports: + - containerPort: 8082 + readinessProbe: + httpGet: + path: /healthz + port: 8082 + initialDelaySeconds: 5 + periodSeconds: 10 + securityContext: + allowPrivilegeEscalation: false + capabilities: + drop: + - all + volumeMounts: + - mountPath: /app/config/controller/tls + name: argocd-repo-server-tls + serviceAccountName: argocd-application-controller + volumes: + - name: argocd-repo-server-tls + secret: + items: + - key: tls.crt + path: tls.crt + - key: tls.key + path: tls.key + - key: ca.crt + path: ca.crt + optional: true + secretName: argocd-repo-server-tls +--- +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: argocd-application-controller-network-policy +spec: + ingress: + - from: + - namespaceSelector: {} + ports: + - port: 8082 + podSelector: + matchLabels: + app.kubernetes.io/name: argocd-application-controller + policyTypes: + - Ingress +--- +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: argocd-dex-server-network-policy +spec: + ingress: + - from: + - podSelector: + matchLabels: + app.kubernetes.io/name: argocd-server + ports: + - port: 5556 + protocol: TCP + - port: 5557 + protocol: TCP + - from: + - namespaceSelector: {} + ports: + - port: 5558 + protocol: TCP + podSelector: + matchLabels: + app.kubernetes.io/name: argocd-dex-server + policyTypes: + - Ingress +--- +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: argocd-redis-network-policy +spec: + ingress: + - from: + - podSelector: + matchLabels: + app.kubernetes.io/name: argocd-server + - podSelector: + matchLabels: + app.kubernetes.io/name: argocd-repo-server + - podSelector: + matchLabels: + app.kubernetes.io/name: argocd-application-controller + ports: + - port: 6379 + protocol: TCP + podSelector: + matchLabels: + app.kubernetes.io/name: argocd-redis + policyTypes: + - Ingress +--- +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: argocd-repo-server-network-policy +spec: + ingress: + - from: + - podSelector: + matchLabels: + app.kubernetes.io/name: argocd-server + - podSelector: + matchLabels: + app.kubernetes.io/name: argocd-application-controller + ports: + - port: 8081 + protocol: TCP + - from: + - namespaceSelector: {} + ports: + - port: 8084 + podSelector: + matchLabels: + app.kubernetes.io/name: argocd-repo-server + policyTypes: + - Ingress +--- +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: argocd-server-network-policy +spec: + ingress: + - {} + podSelector: + matchLabels: + app.kubernetes.io/name: argocd-server + policyTypes: + - Ingress diff --git a/cmd/commands/common.go b/cmd/commands/common.go index 97c168de..b7d767ad 100644 --- a/cmd/commands/common.go +++ b/cmd/commands/common.go @@ -43,20 +43,20 @@ var ( } prepareRepo = func(ctx context.Context, cloneOpts *git.CloneOptions, projectName string) (git.Repository, fs.FS, error) { - log.G().WithFields(log.Fields{ + log.G(ctx).WithFields(log.Fields{ "repoURL": cloneOpts.URL(), "revision": cloneOpts.Revision(), }).Debug("starting with options: ") // clone repo - log.G().Infof("cloning git repository: %s", cloneOpts.URL()) + log.G(ctx).Infof("cloning git repository: %s", cloneOpts.URL()) r, repofs, err := getRepo(ctx, cloneOpts) if err != nil { return nil, nil, fmt.Errorf("Failed cloning the repository: %w", err) } root := repofs.Root() - log.G().Infof("using revision: \"%s\", installation path: \"%s\"", cloneOpts.Revision(), root) + log.G(ctx).Infof("using revision: \"%s\", installation path: \"%s\"", cloneOpts.Revision(), root) if !repofs.ExistsOrDie(store.Default.BootsrtrapDir) { return nil, nil, fmt.Errorf("Bootstrap directory not found, please execute `repo bootstrap` command") } @@ -68,7 +68,7 @@ var ( } } - log.G().Debug("repository is ok") + log.G(ctx).Debug("repository is ok") return r, repofs, nil } @@ -98,8 +98,8 @@ func createApp(opts *createAppOptions) ([]byte, error) { Namespace: opts.namespace, Name: opts.name, Labels: map[string]string{ - "app.kubernetes.io/managed-by": store.Default.ManagedBy, - "app.kubernetes.io/name": opts.name, + store.Default.LabelKeyAppManagedBy: store.Default.LabelValueManagedBy, + "app.kubernetes.io/name": opts.name, }, Finalizers: []string{ "resources-finalizer.argocd.argoproj.io", @@ -237,8 +237,8 @@ func createAppSet(o *createAppSetOptions) ([]byte, error) { if o.appLabels == nil { // default labels appSet.Spec.Template.ApplicationSetTemplateMeta.Labels = map[string]string{ - "app.kubernetes.io/managed-by": store.Default.ManagedBy, - "app.kubernetes.io/name": o.appName, + store.Default.LabelKeyAppManagedBy: store.Default.LabelValueManagedBy, + "app.kubernetes.io/name": o.appName, } } diff --git a/cmd/commands/project.go b/cmd/commands/project.go index c356d808..d3433ae8 100644 --- a/cmd/commands/project.go +++ b/cmd/commands/project.go @@ -108,11 +108,12 @@ func NewProjectCreateCommand(cloneOpts *git.CloneOptions) *cobra.Command { `), PreRun: func(_ *cobra.Command, _ []string) { cloneOpts.Parse() }, RunE: func(cmd *cobra.Command, args []string) error { + ctx := cmd.Context() if len(args) < 1 { - log.G().Fatal("must enter project name") + log.G(ctx).Fatal("must enter project name") } - return RunProjectCreate(cmd.Context(), &ProjectCreateOptions{ + return RunProjectCreate(ctx, &ProjectCreateOptions{ CloneOpts: cloneOpts, ProjectName: args[0], DestKubeContext: kubeContext, @@ -152,7 +153,7 @@ func RunProjectCreate(ctx context.Context, opts *ProjectCreateOptions) error { return fmt.Errorf("project '%s' already exists", opts.ProjectName) } - log.G().Debug("repository is ok") + log.G(ctx).Debug("repository is ok") destServer := store.Default.DestServer if opts.DestKubeContext != "" { @@ -176,14 +177,14 @@ func RunProjectCreate(ctx context.Context, opts *ProjectCreateOptions) error { } if opts.DryRun { - log.G().Printf("%s", util.JoinManifests(projectYAML, appsetYAML)) + log.G(ctx).Printf("%s", util.JoinManifests(projectYAML, appsetYAML)) return nil } bulkWrites := []fsutils.BulkWriteRequest{} if opts.DestKubeContext != "" { - log.G().Infof("adding cluster: %s", opts.DestKubeContext) + log.G(ctx).Infof("adding cluster: %s", opts.DestKubeContext) if err = opts.AddCmd.Execute(ctx, opts.DestKubeContext); err != nil { return fmt.Errorf("failed to add new cluster credentials: %w", err) } @@ -213,12 +214,12 @@ func RunProjectCreate(ctx context.Context, opts *ProjectCreateOptions) error { return err } - log.G().Infof("pushing new project manifest to repo") + log.G(ctx).Infof("pushing new project manifest to repo") if _, err = r.Persist(ctx, &git.PushOptions{CommitMsg: fmt.Sprintf("Added project '%s'", opts.ProjectName)}); err != nil { return err } - log.G().Infof("project created: '%s'", opts.ProjectName) + log.G(ctx).Infof("project created: '%s'", opts.ProjectName) return nil } @@ -280,8 +281,8 @@ func generateProjectManifests(o *GenerateProjectOptions) (projectYAML, appSetYAM prune: true, preserveResourcesOnDeletion: false, appLabels: map[string]string{ - "app.kubernetes.io/managed-by": store.Default.ManagedBy, - "app.kubernetes.io/name": "{{ appName }}", + store.Default.LabelKeyAppManagedBy: store.Default.LabelValueManagedBy, + "app.kubernetes.io/name": "{{ appName }}", }, generators: []appset.ApplicationSetGenerator{ { @@ -403,11 +404,12 @@ func NewProjectDeleteCommand(cloneOpts *git.CloneOptions) *cobra.Command { `), PreRun: func(_ *cobra.Command, _ []string) { cloneOpts.Parse() }, RunE: func(cmd *cobra.Command, args []string) error { + ctx := cmd.Context() if len(args) < 1 { - log.G().Fatal("must enter project name") + log.G(ctx).Fatal("must enter project name") } - return RunProjectDelete(cmd.Context(), &ProjectDeleteOptions{ + return RunProjectDelete(ctx, &ProjectDeleteOptions{ CloneOpts: cloneOpts, ProjectName: args[0], }) @@ -440,7 +442,7 @@ func RunProjectDelete(ctx context.Context, opts *ProjectDeleteOptions) error { return fmt.Errorf("failed to delete project '%s': %w", opts.ProjectName, err) } - log.G().Info("committing changes to gitops repo...") + log.G(ctx).Info("committing changes to gitops repo...") if _, err = r.Persist(ctx, &git.PushOptions{CommitMsg: fmt.Sprintf("Deleted project '%s'", opts.ProjectName)}); err != nil { return fmt.Errorf("failed to push to repo: %w", err) } diff --git a/cmd/commands/repo.go b/cmd/commands/repo.go index 98a7dced..ade97c9b 100644 --- a/cmd/commands/repo.go +++ b/cmd/commands/repo.go @@ -20,9 +20,11 @@ import ( "github.com/argoproj-labs/argocd-autopilot/pkg/util" appset "github.com/argoproj-labs/applicationset/api/v1alpha1" + argocdcommon "github.com/argoproj/argo-cd/v2/common" argocdsettings "github.com/argoproj/argo-cd/v2/util/settings" "github.com/ghodss/yaml" "github.com/go-git/go-billy/v5/memfs" + billyUtils "github.com/go-git/go-billy/v5/util" "github.com/spf13/cobra" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -168,7 +170,7 @@ func RunRepoBootstrap(ctx context.Context, opts *RepoBootstrapOptions) error { return err } - log.G().WithFields(log.Fields{ + log.G(ctx).WithFields(log.Fields{ "repo-url": opts.CloneOptions.URL(), "revision": opts.CloneOptions.Revision(), "namespace": opts.Namespace, @@ -198,7 +200,7 @@ func RunRepoBootstrap(ctx context.Context, opts *RepoBootstrapOptions) error { return nil } - log.G().Infof("cloning repo: %s", opts.CloneOptions.URL()) + log.G(ctx).Infof("cloning repo: %s", opts.CloneOptions.URL()) // clone GitOps repo r, repofs, err := getRepo(ctx, opts.CloneOptions) @@ -206,16 +208,16 @@ func RunRepoBootstrap(ctx context.Context, opts *RepoBootstrapOptions) error { return err } - log.G().Infof("using revision: \"%s\", installation path: \"%s\"", opts.CloneOptions.Revision(), opts.CloneOptions.Path()) + log.G(ctx).Infof("using revision: \"%s\", installation path: \"%s\"", opts.CloneOptions.Revision(), opts.CloneOptions.Path()) if err = validateRepo(repofs); err != nil { return err } - log.G().Debug("repository is ok") + log.G(ctx).Debug("repository is ok") // apply built manifest to k8s cluster - log.G().Infof("using context: \"%s\", namespace: \"%s\"", opts.KubeContext, opts.Namespace) - log.G().Infof("applying bootstrap manifests to cluster...") + log.G(ctx).Infof("using context: \"%s\", namespace: \"%s\"", opts.KubeContext, opts.Namespace) + log.G(ctx).Infof("applying bootstrap manifests to cluster...") if err = opts.KubeFactory.Apply(ctx, opts.Namespace, util.JoinManifests(manifests.namespace, manifests.applyManifests, manifests.repoCreds)); err != nil { return fmt.Errorf("failed to apply bootstrap manifests to cluster: %w", err) } @@ -236,7 +238,7 @@ func RunRepoBootstrap(ctx context.Context, opts *RepoBootstrapOptions) error { stop() // push results to repo - log.G().Infof("pushing bootstrap manifests to repo") + log.G(ctx).Infof("pushing bootstrap manifests to repo") commitMsg := "Autopilot Bootstrap" if opts.CloneOptions.Path() != "" { commitMsg = "Autopilot Bootstrap at " + opts.CloneOptions.Path() @@ -247,7 +249,7 @@ func RunRepoBootstrap(ctx context.Context, opts *RepoBootstrapOptions) error { } // apply "Argo-CD" Application that references "bootstrap/argo-cd" - log.G().Infof("applying argo-cd bootstrap application") + log.G(ctx).Infof("applying argo-cd bootstrap application") if err = opts.KubeFactory.Apply(ctx, opts.Namespace, manifests.bootstrapApp); err != nil { return err } @@ -257,7 +259,7 @@ func RunRepoBootstrap(ctx context.Context, opts *RepoBootstrapOptions) error { return err } - log.G().Infof("running argocd login to initialize argocd config") + log.G(ctx).Infof("running argocd login to initialize argocd config") err = argocdLogin(&argocd.LoginOptions{ Namespace: opts.Namespace, Username: "admin", @@ -331,36 +333,51 @@ func RunRepoUninstall(ctx context.Context, opts *RepoUninstallOptions) error { return err } - log.G().WithFields(log.Fields{ + log.G(ctx).WithFields(log.Fields{ "repo-url": opts.CloneOptions.URL(), "revision": opts.CloneOptions.Revision(), "namespace": opts.Namespace, "kube-context": opts.KubeContext, }).Debug("starting with options: ") - log.G().Infof("cloning repo: %s", opts.CloneOptions.URL()) - - // clone GitOps repo + log.G(ctx).Infof("cloning repo: %s", opts.CloneOptions.URL()) r, repofs, err := getRepo(ctx, opts.CloneOptions) if err != nil { return err } - if err = clearBootstrapFolder(repofs); err != nil { + log.G(ctx).Debug("deleting files from repo") + if err = deleteGitOpsFiles(repofs); err != nil { return err } + log.G(ctx).Debug("pushing changes to remote") revision, err := r.Persist(ctx, &git.PushOptions{CommitMsg: "Autopilot Uninstall"}) if err != nil { return err } + stop := util.WithSpinner(ctx, fmt.Sprintf("waiting for '%s' to be finish syncing", store.Default.BootsrtrapAppName)) if err = waitAppSynced(ctx, opts.KubeFactory, opts.Timeout, store.Default.BootsrtrapAppName, opts.Namespace, revision); err != nil { + stop() + return err + } + + stop() + log.G(ctx).Debug("Deleting cluster resources") + if err = deleteClusterResources(ctx, opts.KubeFactory); err != nil { return err } - // delete bootstrap app - // delete bootstrap|projects|apps folders + commit/push + log.G(ctx).Debug("Deleting leftovers from repo") + if err = billyUtils.RemoveAll(repofs, store.Default.BootsrtrapDir); err != nil { + return err + } + + log.G(ctx).Debug("pushing final commit to remote") + if _, err := r.Persist(ctx, &git.PushOptions{CommitMsg: "Autopilot Uninstall, deleted leftovers"}); err != nil { + return err + } return nil } @@ -432,6 +449,9 @@ func getRepoCredsSecret(token, namespace string) ([]byte, error) { ObjectMeta: metav1.ObjectMeta{ Name: store.Default.RepoCredsSecretName, Namespace: namespace, + Labels: map[string]string{ + store.Default.LabelKeyAppManagedBy: store.Default.LabelValueManagedBy, + }, }, Data: map[string][]byte{ "git_username": []byte(store.Default.GitUsername), @@ -654,13 +674,13 @@ func createCreds(repoUrl string) ([]byte, error) { URL: host, UsernameSecret: &v1.SecretKeySelector{ LocalObjectReference: v1.LocalObjectReference{ - Name: "autopilot-secret", + Name: store.Default.RepoCredsSecretName, }, Key: "git_username", }, PasswordSecret: &v1.SecretKeySelector{ LocalObjectReference: v1.LocalObjectReference{ - Name: "autopilot-secret", + Name: store.Default.RepoCredsSecretName, }, Key: "git_token", }, @@ -686,20 +706,42 @@ func setUninstallOptsDefaults(opts RepoUninstallOptions) (*RepoUninstallOptions, return &opts, nil } -func clearBootstrapFolder(repofs fs.FS) error { - files, err := repofs.ReadDir(store.Default.BootsrtrapDir) - if err != nil { +func deleteGitOpsFiles(repofs fs.FS) error { + var err error + if err = billyUtils.RemoveAll(repofs, store.Default.AppsDir); err != nil { return err } - for _, f := range files { - if f.IsDir() { - continue - } + if err = billyUtils.RemoveAll(repofs, store.Default.BootsrtrapDir); err != nil { + return err + } - if err = repofs.Remove(repofs.Join(store.Default.BootsrtrapDir, f.Name())); err != nil { - return err - } + if err = billyUtils.RemoveAll(repofs, store.Default.ProjectsDir); err != nil { + return err + } + + return billyUtils.WriteFile(repofs, repofs.Join(store.Default.BootsrtrapDir, store.Default.DummyName), []byte{}, 0666) +} + +func deleteClusterResources(ctx context.Context, f kube.Factory) error { + if err := f.Delete2(ctx, []string{"applications"}, store.Default.LabelKeyAppManagedBy+"="+store.Default.LabelValueManagedBy); err != nil { + return fmt.Errorf("Failed deleting 'autopilot-bootstrap' Application: %w", err) + } + + if err := f.Delete2(ctx, []string{ + "all", + "configmaps", + "secrets", + "serviceaccounts", + "networkpolicies", + "rolebindings", + "roles", + }, argocdcommon.LabelKeyAppInstance+"=argo-cd"); err != nil { + return fmt.Errorf("Failed deleting Argo-CD resources: %w", err) + } + + if err := f.Delete2(ctx, []string{"secrets"}, store.Default.LabelKeyAppManagedBy+"="+store.Default.LabelValueManagedBy); err != nil { + return fmt.Errorf("Failed deleting 'autopilot-secret' Secret: %w", err) } return nil diff --git a/pkg/argocd/argocd.go b/pkg/argocd/argocd.go index 069022b7..49890426 100644 --- a/pkg/argocd/argocd.go +++ b/pkg/argocd/argocd.go @@ -12,7 +12,7 @@ import ( "github.com/argoproj/argo-cd/v2/cmd/argocd/commands" "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1" - argocdcd "github.com/argoproj/argo-cd/v2/pkg/client/clientset/versioned" + argocdcs "github.com/argoproj/argo-cd/v2/pkg/client/clientset/versioned" "github.com/argoproj/gitops-engine/pkg/health" "github.com/spf13/cobra" "k8s.io/apimachinery/pkg/api/errors" @@ -62,7 +62,7 @@ func GetAppSyncFn(revision string) kube.WaitFunc { return false, err } - c, err := argocdcd.NewForConfig(rc) + c, err := argocdcs.NewForConfig(rc) if err != nil { return false, err } @@ -84,7 +84,7 @@ func GetAppSyncFn(revision string) kube.WaitFunc { atRevision = revision == app.Status.Sync.Revision } - log.G().Debugf("Application found, Sync Status: %s, Health Status: %s, Revision: %s", app.Status.Sync.Status, app.Status.Health.Status, app.Status.Sync.Revision) + log.G(ctx).Debugf("Application found, Sync Status: %s, Health Status: %s, Revision: %s", app.Status.Sync.Status, app.Status.Health.Status, app.Status.Sync.Revision) return synced && healthy && atRevision, nil } } diff --git a/pkg/kube/kube.go b/pkg/kube/kube.go index ad366c0e..88dc5a1d 100644 --- a/pkg/kube/kube.go +++ b/pkg/kube/kube.go @@ -3,6 +3,7 @@ package kube import ( "context" "os" + "strings" "time" "github.com/argoproj-labs/argocd-autopilot/pkg/log" @@ -18,6 +19,7 @@ import ( restclient "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" "k8s.io/kubectl/pkg/cmd/apply" + del "k8s.io/kubectl/pkg/cmd/delete" cmdutil "k8s.io/kubectl/pkg/cmd/util" ) @@ -57,6 +59,10 @@ type ( // Apply applies the provided manifests on the specified namespace Apply(ctx context.Context, namespace string, manifests []byte) error + Delete(ctx context.Context, manifests []byte) error + + Delete2(ctx context.Context, resourceTypes []string, labelSelector string) error + // Wait waits for all of the provided `Resources` to be ready by calling // the `WaitFunc` of each resource until all of them returns `true` Wait(context.Context, *WaitOptions) error @@ -160,7 +166,7 @@ func (f *factory) Apply(ctx context.Context, namespace string, manifests []byte) defer func() { os.Stdin = stdin }() cmd := &cobra.Command{ - RunE: func(cmd *cobra.Command, args []string) error { + RunE: func(cmd *cobra.Command, _ []string) error { o.DeleteFlags.FileNameFlags.Filenames = &[]string{"-"} o.Overwrite = true @@ -205,6 +211,87 @@ func (f *factory) Apply(ctx context.Context, namespace string, manifests []byte) return cmd.ExecuteContext(ctx) } +func (f *factory) Delete(ctx context.Context, manifests []byte) error { + reader, buf, err := os.Pipe() + if err != nil { + return err + } + + o := &del.DeleteOptions{ + CascadingStrategy: metav1.DeletePropagationForeground, + WaitForDeletion: true, + Quiet: true, + } + + stdin := os.Stdin + os.Stdin = reader + defer func() { os.Stdin = stdin }() + + cmd := &cobra.Command{ + RunE: func(cmd *cobra.Command, _ []string) error { + o.Filenames = []string{"-"} + if err := o.Complete(f.f, []string{}, cmd); err != nil { + return err + } + + errc := make(chan error) + go func() { + if _, err = buf.Write(manifests); err != nil { + errc <- err + } + if err = buf.Close(); err != nil { + errc <- err + } + close(errc) + }() + + if err = o.RunDelete(f.f); err != nil { + return err + } + + return <-errc + }, + SilenceErrors: true, + SilenceUsage: true, + } + + cmdutil.AddDryRunFlag(cmd) + + cmd.SetArgs([]string{}) + + return cmd.ExecuteContext(ctx) +} + +func (f *factory) Delete2(ctx context.Context, resourceTypes []string, labelSelector string) error { + o := &del.DeleteOptions{ + IOStreams: DefaultIOStreams(), + CascadingStrategy: metav1.DeletePropagationForeground, + DeleteAllNamespaces: true, + LabelSelector: labelSelector, + WaitForDeletion: true, + Quiet: true, + } + + cmd := &cobra.Command{ + RunE: func(cmd *cobra.Command, _ []string) error { + args := strings.Join(resourceTypes, ",") + if err := o.Complete(f.f, []string{args}, cmd); err != nil { + return err + } + + return o.RunDelete(f.f) + }, + SilenceErrors: true, + SilenceUsage: true, + } + + cmdutil.AddDryRunFlag(cmd) + + cmd.SetArgs([]string{}) + + return cmd.ExecuteContext(ctx) +} + func (f *factory) Wait(ctx context.Context, opts *WaitOptions) error { itr := 0 resources := map[*Resource]bool{} diff --git a/pkg/store/store.go b/pkg/store/store.go index 1cf54c96..5e7d4775 100644 --- a/pkg/store/store.go +++ b/pkg/store/store.go @@ -34,42 +34,45 @@ type Store struct { } var Default = struct { - BootsrtrapDir string AppsDir string - OverlaysDir string - BaseDir string - ClusterResourcesDir string ArgoCDName string ArgoCDNamespace string + BaseDir string BootsrtrapAppName string + BootsrtrapDir string + ClusterContextName string + ClusterResourcesDir string + DestServer string DummyName string + DestServerAnnotation string + GitUsername string + LabelKeyAppManagedBy string + LabelValueManagedBy string + OverlaysDir string ProjectsDir string - ManagedBy string RootAppName string RepoCredsSecretName string - GitUsername string WaitInterval time.Duration - DestServer string - DestServerAnnotation string - ClusterContextName string }{ AppsDir: "apps", - BootsrtrapDir: "bootstrap", - OverlaysDir: "overlays", - BaseDir: "base", - ClusterResourcesDir: "cluster-resources", ArgoCDName: "argo-cd", ArgoCDNamespace: "argocd", + BaseDir: "base", BootsrtrapAppName: "autopilot-bootstrap", + BootsrtrapDir: "bootstrap", + ClusterContextName: "in-cluster", + ClusterResourcesDir: "cluster-resources", + DestServer: "https://kubernetes.default.svc", + DestServerAnnotation: "argocd-autopilot.argoproj-labs.io/default-dest-server", + DummyName: "DUMMY", + GitUsername: "username", + LabelKeyAppManagedBy: "app.kubernetes.io/managed-by", + LabelValueManagedBy: "argocd-autopilot", + OverlaysDir: "overlays", ProjectsDir: "projects", - ManagedBy: "argo-autopilot", RootAppName: "root", RepoCredsSecretName: "autopilot-secret", - GitUsername: "username", WaitInterval: time.Second * 3, - DestServer: "https://kubernetes.default.svc", - DestServerAnnotation: "argocd-autopilot.argoproj-labs.io/default-dest-server", - ClusterContextName: "in-cluster", } // Get returns the global store From 750748d9236fc651086d676ae8a04e643785fa24 Mon Sep 17 00:00:00 2001 From: Noam Gal Date: Sun, 4 Jul 2021 17:09:08 +0300 Subject: [PATCH 05/14] ran codegen --- cmd/commands/repo.go | 6 ++--- pkg/kube/kube.go | 57 ++---------------------------------------- pkg/kube/mocks/kube.go | 14 +++++++++++ 3 files changed, 19 insertions(+), 58 deletions(-) diff --git a/cmd/commands/repo.go b/cmd/commands/repo.go index ade97c9b..fad898f6 100644 --- a/cmd/commands/repo.go +++ b/cmd/commands/repo.go @@ -724,11 +724,11 @@ func deleteGitOpsFiles(repofs fs.FS) error { } func deleteClusterResources(ctx context.Context, f kube.Factory) error { - if err := f.Delete2(ctx, []string{"applications"}, store.Default.LabelKeyAppManagedBy+"="+store.Default.LabelValueManagedBy); err != nil { + if err := f.Delete(ctx, []string{"applications"}, store.Default.LabelKeyAppManagedBy+"="+store.Default.LabelValueManagedBy); err != nil { return fmt.Errorf("Failed deleting 'autopilot-bootstrap' Application: %w", err) } - if err := f.Delete2(ctx, []string{ + if err := f.Delete(ctx, []string{ "all", "configmaps", "secrets", @@ -740,7 +740,7 @@ func deleteClusterResources(ctx context.Context, f kube.Factory) error { return fmt.Errorf("Failed deleting Argo-CD resources: %w", err) } - if err := f.Delete2(ctx, []string{"secrets"}, store.Default.LabelKeyAppManagedBy+"="+store.Default.LabelValueManagedBy); err != nil { + if err := f.Delete(ctx, []string{"secrets"}, store.Default.LabelKeyAppManagedBy+"="+store.Default.LabelValueManagedBy); err != nil { return fmt.Errorf("Failed deleting 'autopilot-secret' Secret: %w", err) } diff --git a/pkg/kube/kube.go b/pkg/kube/kube.go index 88dc5a1d..e4ef104d 100644 --- a/pkg/kube/kube.go +++ b/pkg/kube/kube.go @@ -59,9 +59,7 @@ type ( // Apply applies the provided manifests on the specified namespace Apply(ctx context.Context, namespace string, manifests []byte) error - Delete(ctx context.Context, manifests []byte) error - - Delete2(ctx context.Context, resourceTypes []string, labelSelector string) error + Delete(ctx context.Context, resourceTypes []string, labelSelector string) error // Wait waits for all of the provided `Resources` to be ready by calling // the `WaitFunc` of each resource until all of them returns `true` @@ -211,58 +209,7 @@ func (f *factory) Apply(ctx context.Context, namespace string, manifests []byte) return cmd.ExecuteContext(ctx) } -func (f *factory) Delete(ctx context.Context, manifests []byte) error { - reader, buf, err := os.Pipe() - if err != nil { - return err - } - - o := &del.DeleteOptions{ - CascadingStrategy: metav1.DeletePropagationForeground, - WaitForDeletion: true, - Quiet: true, - } - - stdin := os.Stdin - os.Stdin = reader - defer func() { os.Stdin = stdin }() - - cmd := &cobra.Command{ - RunE: func(cmd *cobra.Command, _ []string) error { - o.Filenames = []string{"-"} - if err := o.Complete(f.f, []string{}, cmd); err != nil { - return err - } - - errc := make(chan error) - go func() { - if _, err = buf.Write(manifests); err != nil { - errc <- err - } - if err = buf.Close(); err != nil { - errc <- err - } - close(errc) - }() - - if err = o.RunDelete(f.f); err != nil { - return err - } - - return <-errc - }, - SilenceErrors: true, - SilenceUsage: true, - } - - cmdutil.AddDryRunFlag(cmd) - - cmd.SetArgs([]string{}) - - return cmd.ExecuteContext(ctx) -} - -func (f *factory) Delete2(ctx context.Context, resourceTypes []string, labelSelector string) error { +func (f *factory) Delete(ctx context.Context, resourceTypes []string, labelSelector string) error { o := &del.DeleteOptions{ IOStreams: DefaultIOStreams(), CascadingStrategy: metav1.DeletePropagationForeground, diff --git a/pkg/kube/mocks/kube.go b/pkg/kube/mocks/kube.go index 5d5d293d..6133ad9a 100644 --- a/pkg/kube/mocks/kube.go +++ b/pkg/kube/mocks/kube.go @@ -32,6 +32,20 @@ func (_m *Factory) Apply(ctx context.Context, namespace string, manifests []byte return r0 } +// Delete provides a mock function with given fields: ctx, resourceTypes, labelSelector +func (_m *Factory) Delete(ctx context.Context, resourceTypes []string, labelSelector string) error { + ret := _m.Called(ctx, resourceTypes, labelSelector) + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, []string, string) error); ok { + r0 = rf(ctx, resourceTypes, labelSelector) + } else { + r0 = ret.Error(0) + } + + return r0 +} + // KubernetesClientSet provides a mock function with given fields: func (_m *Factory) KubernetesClientSet() (kubernetes.Interface, error) { ret := _m.Called() From 0f65a7268b493fc11e51fb5e423acda01d32505d Mon Sep 17 00:00:00 2001 From: Noam Gal Date: Sun, 4 Jul 2021 17:41:44 +0300 Subject: [PATCH 06/14] fixed tests --- cmd/commands/app_test.go | 28 ++++++++++++++-------------- cmd/commands/project_test.go | 20 ++++++++++++-------- cmd/commands/repo_test.go | 4 ++-- 3 files changed, 28 insertions(+), 24 deletions(-) diff --git a/cmd/commands/app_test.go b/cmd/commands/app_test.go index dcdb7c58..91bedcfd 100644 --- a/cmd/commands/app_test.go +++ b/cmd/commands/app_test.go @@ -117,7 +117,7 @@ func TestRunAppCreate(t *testing.T) { mockRepo := &gitmocks.Repository{} mockRepo.On("Persist", mock.Anything, &git.PushOptions{ CommitMsg: "installed app 'app' on project 'project' installation-path: '/'", - }).Return(fmt.Errorf("some error")) + }).Return("", fmt.Errorf("some error")) return mockRepo, fs.Create(memfs.New()), nil }, }, @@ -129,7 +129,7 @@ func TestRunAppCreate(t *testing.T) { mockRepo := &gitmocks.Repository{} mockRepo.On("Persist", mock.Anything, &git.PushOptions{ CommitMsg: "installed app 'app' on project 'project' installation-path: '/'", - }).Return(fmt.Errorf("some error")) + }).Return("", fmt.Errorf("some error")) return mockRepo, fs.Create(memfs), nil }, }, @@ -142,7 +142,7 @@ func TestRunAppCreate(t *testing.T) { mockRepo := &gitmocks.Repository{} mockRepo.On("Persist", mock.Anything, &git.PushOptions{ CommitMsg: "installed app 'app' on project 'project' installation-path: '/'", - }).Return(nil) + }).Return("revision", nil) return mockRepo, fs.Create(memfs), nil }, getInstallationNamespace: func(repofs fs.FS) (string, error) { @@ -161,7 +161,7 @@ func TestRunAppCreate(t *testing.T) { mockRepo := &gitmocks.Repository{} mockRepo.On("Persist", mock.Anything, &git.PushOptions{ CommitMsg: "installed app 'app' on project 'project' installation-path: '/'", - }).Return(nil) + }).Return("revision", nil) return mockRepo, fs.Create(memfs), nil }, getInstallationNamespace: func(repofs fs.FS) (string, error) { @@ -177,14 +177,14 @@ func TestRunAppCreate(t *testing.T) { mockRepo := &gitmocks.Repository{} mockRepo.On("Persist", mock.Anything, &git.PushOptions{ CommitMsg: "installed app 'app' on project 'project' installation-path: '/'", - }).Return(nil) + }).Return("revision", nil) return mockRepo, fs.Create(memfs), nil }, getRepo: func(_ *testing.T, _ *git.CloneOptions) (git.Repository, fs.FS, error) { mockRepo := &gitmocks.Repository{} mockRepo.On("Persist", mock.Anything, &git.PushOptions{ CommitMsg: "installed app 'app' on project 'project' installation-path: '/'", - }).Return(nil) + }).Return("revision", nil) return mockRepo, fs.Create(memfs.New()), nil }, assertFn: func(t *testing.T, gitopsRepo git.Repository, appsRepo git.Repository) { @@ -200,7 +200,7 @@ func TestRunAppCreate(t *testing.T) { mockRepo := &gitmocks.Repository{} mockRepo.On("Persist", mock.Anything, &git.PushOptions{ CommitMsg: "installed app 'app' on project 'project' installation-path: '/'", - }).Return(nil) + }).Return("revision", nil) return mockRepo, fs.Create(memfs), nil }, assertFn: func(t *testing.T, gitopsRepo git.Repository, appsRepo git.Repository) { @@ -219,7 +219,7 @@ func TestRunAppCreate(t *testing.T) { mockRepo := &gitmocks.Repository{} mockRepo.On("Persist", mock.Anything, &git.PushOptions{ CommitMsg: "installed app 'app' on project 'project' installation-path: '/'", - }).Return(nil) + }).Return("revision", nil) return mockRepo, fs.Create(memfs), nil }, getInstallationNamespace: func(repofs fs.FS) (string, error) { @@ -462,7 +462,7 @@ func TestRunAppDelete(t *testing.T) { mockRepo := &gitmocks.Repository{} mockRepo.On("Persist", mock.Anything, &git.PushOptions{ CommitMsg: "Deleted app 'app'", - }).Return(nil) + }).Return("revision", nil) return mockRepo, fs.Create(memfs), nil }, assertFn: func(t *testing.T, repo git.Repository, repofs fs.FS) { @@ -506,7 +506,7 @@ func TestRunAppDelete(t *testing.T) { mockRepo := &gitmocks.Repository{} mockRepo.On("Persist", mock.Anything, &git.PushOptions{ CommitMsg: "Deleted app 'app' from project 'project'", - }).Return(nil) + }).Return("revision", nil) return mockRepo, fs.Create(memfs), nil }, assertFn: func(t *testing.T, repo git.Repository, repofs fs.FS) { @@ -524,7 +524,7 @@ func TestRunAppDelete(t *testing.T) { mockRepo := &gitmocks.Repository{} mockRepo.On("Persist", mock.Anything, &git.PushOptions{ CommitMsg: "Deleted app 'app'", - }).Return(nil) + }).Return("revision", nil) return mockRepo, fs.Create(memfs), nil }, assertFn: func(t *testing.T, repo git.Repository, repofs fs.FS) { @@ -542,7 +542,7 @@ func TestRunAppDelete(t *testing.T) { mockRepo := &gitmocks.Repository{} mockRepo.On("Persist", mock.Anything, &git.PushOptions{ CommitMsg: "Deleted app 'app' from project 'project'", - }).Return(nil) + }).Return("revision", nil) return mockRepo, fs.Create(memfs), nil }, assertFn: func(t *testing.T, repo git.Repository, repofs fs.FS) { @@ -560,7 +560,7 @@ func TestRunAppDelete(t *testing.T) { mockRepo := &gitmocks.Repository{} mockRepo.On("Persist", mock.Anything, &git.PushOptions{ CommitMsg: "Deleted app 'app'", - }).Return(nil) + }).Return("revision", nil) return mockRepo, fs.Create(memfs), nil }, assertFn: func(t *testing.T, repo git.Repository, repofs fs.FS) { @@ -578,7 +578,7 @@ func TestRunAppDelete(t *testing.T) { mockRepo := &gitmocks.Repository{} mockRepo.On("Persist", mock.Anything, &git.PushOptions{ CommitMsg: "Deleted app 'app'", - }).Return(fmt.Errorf("some error")) + }).Return("", fmt.Errorf("some error")) return mockRepo, fs.Create(memfs), nil }, assertFn: func(t *testing.T, repo git.Repository, repofs fs.FS) { diff --git a/cmd/commands/project_test.go b/cmd/commands/project_test.go index 9b5106a1..1836b51c 100644 --- a/cmd/commands/project_test.go +++ b/cmd/commands/project_test.go @@ -87,7 +87,9 @@ func TestRunProjectCreate(t *testing.T) { prepareRepo: func() (git.Repository, fs.FS, error) { memfs := memfs.New() mockedRepo := &gitmocks.Repository{} - mockedRepo.On("Persist", mock.AnythingOfType("*context.emptyCtx"), &git.PushOptions{CommitMsg: "Added project 'project'"}).Return(fmt.Errorf("failed to persist")) + mockedRepo.On("Persist", mock.AnythingOfType("*context.emptyCtx"), &git.PushOptions{ + CommitMsg: "Added project 'project'", + }).Return("", fmt.Errorf("failed to persist")) return mockedRepo, fs.Create(memfs), nil }, getInstallationNamespace: func(_ fs.FS) (string, error) { @@ -100,7 +102,9 @@ func TestRunProjectCreate(t *testing.T) { prepareRepo: func() (git.Repository, fs.FS, error) { memfs := memfs.New() mockedRepo := &gitmocks.Repository{} - mockedRepo.On("Persist", mock.AnythingOfType("*context.emptyCtx"), &git.PushOptions{CommitMsg: "Added project 'project'"}).Return(nil) + mockedRepo.On("Persist", mock.AnythingOfType("*context.emptyCtx"), &git.PushOptions{ + CommitMsg: "Added project 'project'", + }).Return("revision", nil) return mockedRepo, fs.Create(memfs), nil }, getInstallationNamespace: func(_ fs.FS) (string, error) { @@ -512,7 +516,7 @@ func TestRunProjectDelete(t *testing.T) { mockRepo := &gitmocks.Repository{} mockRepo.On("Persist", mock.AnythingOfType("*context.emptyCtx"), &git.PushOptions{ CommitMsg: "Deleted project 'project'", - }).Return(fmt.Errorf("some error")) + }).Return("revision", fmt.Errorf("some error")) return mockRepo, fs.Create(memfs), nil }, }, @@ -526,7 +530,7 @@ func TestRunProjectDelete(t *testing.T) { mockRepo := &gitmocks.Repository{} mockRepo.On("Persist", mock.AnythingOfType("*context.emptyCtx"), &git.PushOptions{ CommitMsg: "Deleted project 'project'", - }).Return(fmt.Errorf("some error")) + }).Return("", fmt.Errorf("some error")) return mockRepo, fs.Create(memfs), nil }, }, @@ -539,7 +543,7 @@ func TestRunProjectDelete(t *testing.T) { mockRepo := &gitmocks.Repository{} mockRepo.On("Persist", mock.AnythingOfType("*context.emptyCtx"), &git.PushOptions{ CommitMsg: "Deleted project 'project'", - }).Return(nil) + }).Return("revision", nil) return mockRepo, fs.Create(memfs), nil }, assertFn: func(t *testing.T, repo git.Repository, repofs fs.FS) { @@ -557,7 +561,7 @@ func TestRunProjectDelete(t *testing.T) { mockRepo := &gitmocks.Repository{} mockRepo.On("Persist", mock.AnythingOfType("*context.emptyCtx"), &git.PushOptions{ CommitMsg: "Deleted project 'project'", - }).Return(nil) + }).Return("revision", nil) return mockRepo, fs.Create(memfs), nil }, assertFn: func(t *testing.T, repo git.Repository, repofs fs.FS) { @@ -575,7 +579,7 @@ func TestRunProjectDelete(t *testing.T) { mockRepo := &gitmocks.Repository{} mockRepo.On("Persist", mock.AnythingOfType("*context.emptyCtx"), &git.PushOptions{ CommitMsg: "Deleted project 'project'", - }).Return(nil) + }).Return("revision", nil) return mockRepo, fs.Create(memfs), nil }, assertFn: func(t *testing.T, repo git.Repository, repofs fs.FS) { @@ -597,7 +601,7 @@ func TestRunProjectDelete(t *testing.T) { mockRepo := &gitmocks.Repository{} mockRepo.On("Persist", mock.AnythingOfType("*context.emptyCtx"), &git.PushOptions{ CommitMsg: "Deleted project 'project'", - }).Return(nil) + }).Return("revision", nil) return mockRepo, fs.Create(memfs), nil }, assertFn: func(t *testing.T, repo git.Repository, repofs fs.FS) { diff --git a/cmd/commands/repo_test.go b/cmd/commands/repo_test.go index 177bdb35..a9e235b1 100644 --- a/cmd/commands/repo_test.go +++ b/cmd/commands/repo_test.go @@ -280,7 +280,7 @@ func TestRunRepoBootstrap(t *testing.T) { f.On("Wait", mock.Anything, mock.Anything).Return(nil) f.On("KubernetesClientSetOrDie").Return(mockCS) - r.On("Persist", mock.Anything, mock.Anything).Return(nil) + r.On("Persist", mock.Anything, mock.Anything).Return("revision", nil) }, assertFn: func(t *testing.T, r *gitmocks.Repository, repofs fs.FS, f *kubemocks.Factory, ret error) { @@ -343,7 +343,7 @@ func TestRunRepoBootstrap(t *testing.T) { f.On("Apply", mock.Anything, mock.Anything, mock.Anything).Return(nil) f.On("Wait", mock.Anything, mock.Anything).Return(nil) f.On("KubernetesClientSetOrDie").Return(mockCS) - r.On("Persist", mock.Anything, mock.Anything).Return(nil) + r.On("Persist", mock.Anything, mock.Anything).Return("revision", nil) }, assertFn: func(t *testing.T, r *gitmocks.Repository, repofs fs.FS, f *kubemocks.Factory, ret error) { assert.NoError(t, ret) From 77c5beebeb1aff2ffcd947d49072857f594c48dd Mon Sep 17 00:00:00 2001 From: Noam Gal Date: Sun, 4 Jul 2021 18:37:47 +0300 Subject: [PATCH 07/14] added tests --- cmd/commands/repo.go | 29 ++++---- cmd/commands/repo_test.go | 143 +++++++++++++++++++++++++++++++++++++- 2 files changed, 156 insertions(+), 16 deletions(-) diff --git a/cmd/commands/repo.go b/cmd/commands/repo.go index fad898f6..a6fba7c8 100644 --- a/cmd/commands/repo.go +++ b/cmd/commands/repo.go @@ -707,25 +707,28 @@ func setUninstallOptsDefaults(opts RepoUninstallOptions) (*RepoUninstallOptions, } func deleteGitOpsFiles(repofs fs.FS) error { - var err error - if err = billyUtils.RemoveAll(repofs, store.Default.AppsDir); err != nil { - return err + if err := billyUtils.RemoveAll(repofs, store.Default.AppsDir); err != nil { + return fmt.Errorf("failed deleting '%s' folder: %w", store.Default.AppsDir, err) } - if err = billyUtils.RemoveAll(repofs, store.Default.BootsrtrapDir); err != nil { - return err + if err := billyUtils.RemoveAll(repofs, store.Default.BootsrtrapDir); err != nil { + return fmt.Errorf("failed deleting '%s' folder: %w", store.Default.BootsrtrapDir, err) } - if err = billyUtils.RemoveAll(repofs, store.Default.ProjectsDir); err != nil { - return err + if err := billyUtils.RemoveAll(repofs, store.Default.ProjectsDir); err != nil { + return fmt.Errorf("failed deleting '%s' folder: %w", store.Default.ProjectsDir, err) } - return billyUtils.WriteFile(repofs, repofs.Join(store.Default.BootsrtrapDir, store.Default.DummyName), []byte{}, 0666) + if err := billyUtils.WriteFile(repofs, repofs.Join(store.Default.BootsrtrapDir, store.Default.DummyName), []byte{}, 0666); err != nil { + return fmt.Errorf("failed creating '%s' file in '%s' folder: %w", store.Default.DummyName, store.Default.ProjectsDir, err) + } + + return nil } func deleteClusterResources(ctx context.Context, f kube.Factory) error { - if err := f.Delete(ctx, []string{"applications"}, store.Default.LabelKeyAppManagedBy+"="+store.Default.LabelValueManagedBy); err != nil { - return fmt.Errorf("Failed deleting 'autopilot-bootstrap' Application: %w", err) + if err := f.Delete(ctx, []string{"applications", "secrets"}, store.Default.LabelKeyAppManagedBy+"="+store.Default.LabelValueManagedBy); err != nil { + return fmt.Errorf("failed deleting argocd-autopilot resources: %w", err) } if err := f.Delete(ctx, []string{ @@ -736,13 +739,9 @@ func deleteClusterResources(ctx context.Context, f kube.Factory) error { "networkpolicies", "rolebindings", "roles", - }, argocdcommon.LabelKeyAppInstance+"=argo-cd"); err != nil { + }, argocdcommon.LabelKeyAppInstance+"="+store.Default.ArgoCDName); err != nil { return fmt.Errorf("Failed deleting Argo-CD resources: %w", err) } - if err := f.Delete(ctx, []string{"secrets"}, store.Default.LabelKeyAppManagedBy+"="+store.Default.LabelValueManagedBy); err != nil { - return fmt.Errorf("Failed deleting 'autopilot-secret' Secret: %w", err) - } - return nil } diff --git a/cmd/commands/repo_test.go b/cmd/commands/repo_test.go index a9e235b1..e82d7ee9 100644 --- a/cmd/commands/repo_test.go +++ b/cmd/commands/repo_test.go @@ -2,6 +2,7 @@ package commands import ( "context" + "errors" "fmt" "path/filepath" "testing" @@ -10,12 +11,14 @@ import ( "github.com/argoproj-labs/argocd-autopilot/pkg/fs" "github.com/argoproj-labs/argocd-autopilot/pkg/git" gitmocks "github.com/argoproj-labs/argocd-autopilot/pkg/git/mocks" + "github.com/argoproj-labs/argocd-autopilot/pkg/kube" kubemocks "github.com/argoproj-labs/argocd-autopilot/pkg/kube/mocks" "github.com/argoproj-labs/argocd-autopilot/pkg/store" - + argocdcommon "github.com/argoproj/argo-cd/v2/common" argocdv1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1" "github.com/ghodss/yaml" "github.com/go-git/go-billy/v5/memfs" + billyUtils "github.com/go-git/go-billy/v5/util" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" v1 "k8s.io/api/core/v1" @@ -420,3 +423,141 @@ func TestRunRepoBootstrap(t *testing.T) { }) } } + +func Test_setUninstallOptsDefaults(t *testing.T) { + tests := map[string]struct { + opts RepoUninstallOptions + want *RepoUninstallOptions + wantErr string + currentKubeContext func() (string, error) + }{ + "Should not change anything, if all options are set": { + opts: RepoUninstallOptions{ + Namespace: "namespace", + KubeContext: "context", + }, + want: &RepoUninstallOptions{ + Namespace: "namespace", + KubeContext: "context", + }, + }, + "Should set default argocd namespace, if it is not set": { + opts: RepoUninstallOptions{ + KubeContext: "context", + }, + want: &RepoUninstallOptions{ + Namespace: store.Default.ArgoCDNamespace, + KubeContext: "context", + }, + }, + "Should get current kube context, if it is not set": { + opts: RepoUninstallOptions{ + Namespace: "namespace", + }, + want: &RepoUninstallOptions{ + Namespace: "namespace", + KubeContext: "currentContext", + }, + currentKubeContext: func() (string, error) { + return "currentContext", nil + }, + }, + "Should fail, if getting current context fails": { + opts: RepoUninstallOptions{}, + wantErr: "some error", + currentKubeContext: func() (string, error) { + return "", errors.New("some error") + }, + }, + } + origCurrentKubeContext := currentKubeContext + defer func() { currentKubeContext = origCurrentKubeContext }() + for name, tt := range tests { + t.Run(name, func(t *testing.T) { + if tt.currentKubeContext != nil { + currentKubeContext = tt.currentKubeContext + } + + got, err := setUninstallOptsDefaults(tt.opts) + if err != nil { + if tt.wantErr != "" { + assert.EqualError(t, err, tt.wantErr) + } else { + t.Errorf("setUninstallOptsDefaults() error = %v", err) + } + + return + } + + assert.Equal(t, tt.want, got) + }) + } +} + +func Test_deleteGitOpsFiles(t *testing.T) { + tests := map[string]struct { + wantErr string + beforeFn func() fs.FS + assertFn func(*testing.T, fs.FS, error) + }{ + "Should remove apps|project folders, and keep only bootstrap/DUMMY file": { + beforeFn: func() fs.FS { + repofs := memfs.New() + _ = billyUtils.WriteFile(repofs, repofs.Join(store.Default.AppsDir, "some_file"), []byte{}, 0666) + _ = billyUtils.WriteFile(repofs, repofs.Join(store.Default.BootsrtrapDir, "some_file"), []byte{}, 0666) + _ = billyUtils.WriteFile(repofs, repofs.Join(store.Default.ProjectsDir, "some_file"), []byte{}, 0666) + return fs.Create(repofs) + }, + assertFn: func(t *testing.T, repofs fs.FS, err error) { + assert.Nil(t, err) + assert.False(t, repofs.ExistsOrDie(store.Default.AppsDir)) + assert.True(t, repofs.ExistsOrDie(repofs.Join(store.Default.BootsrtrapDir, store.Default.DummyName))) + assert.False(t, repofs.ExistsOrDie(store.Default.ProjectsDir)) + fi, _ := repofs.ReadDir(store.Default.BootsrtrapDir) + assert.Len(t, fi, 1) + }, + }, + } + for name, tt := range tests { + t.Run(name, func(t *testing.T) { + fs := tt.beforeFn() + err := deleteGitOpsFiles(fs) + tt.assertFn(t, fs, err) + }) + } +} + +func Test_deleteClusterResources(t *testing.T) { + tests := map[string]struct { + beforeFn func() kube.Factory + assertFn func(*testing.T, kube.Factory, error) + }{ + "Should delete all resources": { + beforeFn: func() kube.Factory { + mf := &kubemocks.Factory{} + mf.On("Delete", mock.Anything, []string{"applications", "secrets"}, store.Default.LabelKeyAppManagedBy+"="+store.Default.LabelValueManagedBy).Return(nil) + mf.On("Delete", mock.Anything, []string{ + "all", + "configmaps", + "secrets", + "serviceaccounts", + "networkpolicies", + "rolebindings", + "roles", + }, argocdcommon.LabelKeyAppInstance+"="+store.Default.ArgoCDName).Return(nil) + return mf + }, + assertFn: func(t *testing.T, f kube.Factory, err error) { + assert.Nil(t, err) + f.(*kubemocks.Factory).AssertExpectations(t) + }, + }, + } + for name, tt := range tests { + t.Run(name, func(t *testing.T) { + f := tt.beforeFn() + err := deleteClusterResources(context.Background(), f) + tt.assertFn(t, f, err) + }) + } +} From c2633af7c437d892b6e5cc983122e1a3a7ee726c Mon Sep 17 00:00:00 2001 From: Noam Gal Date: Mon, 5 Jul 2021 11:23:29 +0300 Subject: [PATCH 08/14] added tests --- cmd/commands/repo.go | 3 +- cmd/commands/repo_test.go | 218 ++++++++++++++++++++++++++++++-------- 2 files changed, 173 insertions(+), 48 deletions(-) diff --git a/cmd/commands/repo.go b/cmd/commands/repo.go index a6fba7c8..39fc51b5 100644 --- a/cmd/commands/repo.go +++ b/cmd/commands/repo.go @@ -268,6 +268,7 @@ func RunRepoBootstrap(ctx context.Context, opts *RepoBootstrapOptions) error { if err != nil { return err } + if !opts.HidePassword { log.G(ctx).Printf("") log.G(ctx).Infof("argocd initialized. password: %s", passwd) @@ -740,7 +741,7 @@ func deleteClusterResources(ctx context.Context, f kube.Factory) error { "rolebindings", "roles", }, argocdcommon.LabelKeyAppInstance+"="+store.Default.ArgoCDName); err != nil { - return fmt.Errorf("Failed deleting Argo-CD resources: %w", err) + return fmt.Errorf("failed deleting Argo-CD resources: %w", err) } return nil diff --git a/cmd/commands/repo_test.go b/cmd/commands/repo_test.go index e82d7ee9..561f226f 100644 --- a/cmd/commands/repo_test.go +++ b/cmd/commands/repo_test.go @@ -14,6 +14,7 @@ import ( "github.com/argoproj-labs/argocd-autopilot/pkg/kube" kubemocks "github.com/argoproj-labs/argocd-autopilot/pkg/kube/mocks" "github.com/argoproj-labs/argocd-autopilot/pkg/store" + argocdcommon "github.com/argoproj/argo-cd/v2/common" argocdv1alpha1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1" "github.com/ghodss/yaml" @@ -240,8 +241,8 @@ func TestRunRepoBootstrap(t *testing.T) { exitCalled := false tests := map[string]struct { opts *RepoBootstrapOptions - preFn func(r *gitmocks.Repository, repofs fs.FS, f *kubemocks.Factory) - assertFn func(t *testing.T, r *gitmocks.Repository, repofs fs.FS, f *kubemocks.Factory, ret error) + beforeFn func(*gitmocks.Repository, *kubemocks.Factory) + assertFn func(*testing.T, fs.FS, error) }{ "DryRun": { opts: &RepoBootstrapOptions{ @@ -254,7 +255,8 @@ func TestRunRepoBootstrap(t *testing.T) { Auth: git.Auth{Password: "test"}, }, }, - assertFn: func(t *testing.T, _ *gitmocks.Repository, _ fs.FS, _ *kubemocks.Factory, ret error) { + beforeFn: func(*gitmocks.Repository, *kubemocks.Factory) {}, + assertFn: func(t *testing.T, _ fs.FS, ret error) { assert.NoError(t, ret) assert.True(t, exitCalled) }, @@ -269,7 +271,7 @@ func TestRunRepoBootstrap(t *testing.T) { Auth: git.Auth{Password: "test"}, }, }, - preFn: func(r *gitmocks.Repository, _ fs.FS, f *kubemocks.Factory) { + beforeFn: func(r *gitmocks.Repository, f *kubemocks.Factory) { mockCS := fake.NewSimpleClientset(&v1.Secret{ ObjectMeta: metav1.ObjectMeta{ Name: "argocd-initial-admin-secret", @@ -279,21 +281,14 @@ func TestRunRepoBootstrap(t *testing.T) { "password": []byte("foo"), }, }) + r.On("Persist", mock.Anything, mock.Anything).Return("revision", nil) f.On("Apply", mock.Anything, mock.Anything, mock.Anything).Return(nil) f.On("Wait", mock.Anything, mock.Anything).Return(nil) f.On("KubernetesClientSetOrDie").Return(mockCS) - - r.On("Persist", mock.Anything, mock.Anything).Return("revision", nil) - }, - assertFn: func(t *testing.T, r *gitmocks.Repository, repofs fs.FS, f *kubemocks.Factory, ret error) { + assertFn: func(t *testing.T, repofs fs.FS, ret error) { assert.NoError(t, ret) assert.False(t, exitCalled) - r.AssertCalled(t, "Persist", mock.Anything, mock.Anything) - f.AssertCalled(t, "Apply", mock.Anything, "bar", mock.Anything) - f.AssertCalled(t, "Wait", mock.Anything, mock.Anything) - f.AssertCalled(t, "KubernetesClientSetOrDie") - f.AssertNumberOfCalls(t, "Apply", 2) // bootstrap dir assert.True(t, repofs.ExistsOrDie(repofs.Join( @@ -333,7 +328,7 @@ func TestRunRepoBootstrap(t *testing.T) { Auth: git.Auth{Password: "test"}, }, }, - preFn: func(r *gitmocks.Repository, _ fs.FS, f *kubemocks.Factory) { + beforeFn: func(r *gitmocks.Repository, f *kubemocks.Factory) { mockCS := fake.NewSimpleClientset(&v1.Secret{ ObjectMeta: metav1.ObjectMeta{ Name: "argocd-initial-admin-secret", @@ -343,19 +338,14 @@ func TestRunRepoBootstrap(t *testing.T) { "password": []byte("foo"), }, }) + r.On("Persist", mock.Anything, &git.PushOptions{CommitMsg: "Autopilot Bootstrap"}).Return("revision", nil) f.On("Apply", mock.Anything, mock.Anything, mock.Anything).Return(nil) f.On("Wait", mock.Anything, mock.Anything).Return(nil) f.On("KubernetesClientSetOrDie").Return(mockCS) - r.On("Persist", mock.Anything, mock.Anything).Return("revision", nil) }, - assertFn: func(t *testing.T, r *gitmocks.Repository, repofs fs.FS, f *kubemocks.Factory, ret error) { + assertFn: func(t *testing.T, repofs fs.FS, ret error) { assert.NoError(t, ret) assert.False(t, exitCalled) - r.AssertCalled(t, "Persist", mock.Anything, mock.Anything) - f.AssertCalled(t, "Apply", mock.Anything, "bar", mock.Anything) - f.AssertCalled(t, "Wait", mock.Anything, mock.Anything) - f.AssertCalled(t, "KubernetesClientSetOrDie") - f.AssertNumberOfCalls(t, "Apply", 2) // bootstrap dir assert.True(t, repofs.ExistsOrDie(repofs.Join( @@ -387,39 +377,34 @@ func TestRunRepoBootstrap(t *testing.T) { }, } - orgExit := exit - orgClone := getRepo - orgRunKustomizeBuild := runKustomizeBuild - orgArgoLogin := argocdLogin + origExit, origGetRepo, origRunKustomizeBuild, origArgoLogin := exit, getRepo, runKustomizeBuild, argocdLogin + defer func() { + exit = origExit + getRepo = origGetRepo + runKustomizeBuild = origRunKustomizeBuild + argocdLogin = origArgoLogin + }() + exit = func(_ int) { exitCalled = true } + runKustomizeBuild = func(k *kusttypes.Kustomization) ([]byte, error) { return []byte("test"), nil } + argocdLogin = func(opts *argocd.LoginOptions) error { return nil } for tname, tt := range tests { t.Run(tname, func(t *testing.T) { - exitCalled = false - mockRepo := &gitmocks.Repository{} - mockFactory := &kubemocks.Factory{} + r := &gitmocks.Repository{} repofs := fs.Create(memfs.New()) + f := &kubemocks.Factory{} + exitCalled = false - if tt.preFn != nil { - tt.preFn(mockRepo, repofs, mockFactory) - } - - tt.opts.KubeFactory = mockFactory - - exit = func(_ int) { exitCalled = true } - getRepo = func(ctx context.Context, cloneOpts *git.CloneOptions) (git.Repository, fs.FS, error) { - return mockRepo, repofs, nil + tt.beforeFn(r, f) + tt.opts.KubeFactory = f + getRepo = func(_ context.Context, _ *git.CloneOptions) (git.Repository, fs.FS, error) { + return r, repofs, nil } - runKustomizeBuild = func(k *kusttypes.Kustomization) ([]byte, error) { return []byte("test"), nil } - argocdLogin = func(opts *argocd.LoginOptions) error { return nil } - - defer func() { - exit = orgExit - getRepo = orgClone - runKustomizeBuild = orgRunKustomizeBuild - argocdLogin = orgArgoLogin - }() - tt.assertFn(t, mockRepo, repofs, mockFactory, RunRepoBootstrap(context.Background(), tt.opts)) + err := RunRepoBootstrap(context.Background(), tt.opts) + tt.assertFn(t, repofs, err) + r.AssertExpectations(t) + f.AssertExpectations(t) }) } } @@ -552,6 +537,37 @@ func Test_deleteClusterResources(t *testing.T) { f.(*kubemocks.Factory).AssertExpectations(t) }, }, + "Should fail if failed to delete argocd-autopilot resources": { + beforeFn: func() kube.Factory { + mf := &kubemocks.Factory{} + mf.On("Delete", mock.Anything, []string{"applications", "secrets"}, store.Default.LabelKeyAppManagedBy+"="+store.Default.LabelValueManagedBy).Return(errors.New("some error")) + return mf + }, + assertFn: func(t *testing.T, f kube.Factory, err error) { + assert.EqualError(t, err, "failed deleting argocd-autopilot resources: some error") + f.(*kubemocks.Factory).AssertExpectations(t) + }, + }, + "Should fail if failed to delete Argo-CD resources": { + beforeFn: func() kube.Factory { + mf := &kubemocks.Factory{} + mf.On("Delete", mock.Anything, []string{"applications", "secrets"}, store.Default.LabelKeyAppManagedBy+"="+store.Default.LabelValueManagedBy).Return(nil) + mf.On("Delete", mock.Anything, []string{ + "all", + "configmaps", + "secrets", + "serviceaccounts", + "networkpolicies", + "rolebindings", + "roles", + }, argocdcommon.LabelKeyAppInstance+"="+store.Default.ArgoCDName).Return(errors.New("some error")) + return mf + }, + assertFn: func(t *testing.T, f kube.Factory, err error) { + assert.EqualError(t, err, "failed deleting Argo-CD resources: some error") + f.(*kubemocks.Factory).AssertExpectations(t) + }, + }, } for name, tt := range tests { t.Run(name, func(t *testing.T) { @@ -561,3 +577,111 @@ func Test_deleteClusterResources(t *testing.T) { }) } } + +func TestRunRepoUninstall(t *testing.T) { + tests := map[string]struct { + currentKubeContextErr error + getRepoErr error + wantErr string + beforeFn func(*gitmocks.Repository, *kubemocks.Factory) + }{ + "Should fail if getCurrentKubeContext fails": { + currentKubeContextErr: errors.New("some error"), + wantErr: "some error", + }, + "Should fail if getRepo fails": { + getRepoErr: errors.New("some error"), + wantErr: "some error", + }, + "Should fail if Persist fails": { + wantErr: "some error", + beforeFn: func(r *gitmocks.Repository, _ *kubemocks.Factory) { + r.On("Persist", mock.Anything, &git.PushOptions{CommitMsg: "Autopilot Uninstall"}).Return("", errors.New("some error")) + }, + }, + "Should fail if Wait fails": { + wantErr: "some error", + beforeFn: func(r *gitmocks.Repository, f *kubemocks.Factory) { + r.On("Persist", mock.Anything, &git.PushOptions{CommitMsg: "Autopilot Uninstall"}).Return("revision", nil) + f.On("Wait", mock.Anything, mock.Anything).Return(errors.New("some error")) + }, + }, + "Should fail if deleteClusterResources fails": { + wantErr: "failed deleting argocd-autopilot resources: some error", + beforeFn: func(r *gitmocks.Repository, f *kubemocks.Factory) { + r.On("Persist", mock.Anything, &git.PushOptions{CommitMsg: "Autopilot Uninstall"}).Return("revision", nil) + f.On("Wait", mock.Anything, mock.Anything).Return(nil) + f.On("Delete", mock.Anything, mock.Anything, mock.Anything).Return(errors.New("some error")) + }, + }, + "Should fail if 2nd Persist fails": { + wantErr: "some error", + beforeFn: func(r *gitmocks.Repository, f *kubemocks.Factory) { + r.On("Persist", mock.Anything, &git.PushOptions{CommitMsg: "Autopilot Uninstall"}).Return("revision", nil) + r.On("Persist", mock.Anything, &git.PushOptions{CommitMsg: "Autopilot Uninstall, deleted leftovers"}).Return("", errors.New("some error")) + f.On("Wait", mock.Anything, mock.Anything).Return(nil) + f.On("Delete", mock.Anything, mock.Anything, store.Default.LabelKeyAppManagedBy+"="+store.Default.LabelValueManagedBy).Return(nil) + f.On("Delete", mock.Anything, mock.Anything, argocdcommon.LabelKeyAppInstance+"="+store.Default.ArgoCDName).Return(nil) + }, + }, + "Should succeed if no errors": { + beforeFn: func(r *gitmocks.Repository, f *kubemocks.Factory) { + r.On("Persist", mock.Anything, &git.PushOptions{CommitMsg: "Autopilot Uninstall"}).Return("revision", nil) + r.On("Persist", mock.Anything, &git.PushOptions{CommitMsg: "Autopilot Uninstall, deleted leftovers"}).Return("", nil) + f.On("Wait", mock.Anything, mock.Anything).Return(nil) + f.On("Delete", mock.Anything, mock.Anything, store.Default.LabelKeyAppManagedBy+"="+store.Default.LabelValueManagedBy).Return(nil) + f.On("Delete", mock.Anything, mock.Anything, argocdcommon.LabelKeyAppInstance+"="+store.Default.ArgoCDName).Return(nil) + }, + }, + } + + origGetRepo, origCurrentKubeContext := getRepo, currentKubeContext + defer func() { getRepo, currentKubeContext = origGetRepo, origCurrentKubeContext }() + for name, tt := range tests { + t.Run(name, func(t *testing.T) { + r := &gitmocks.Repository{} + repofs := fs.Create(memfs.New()) + f := &kubemocks.Factory{} + + if tt.beforeFn != nil { + tt.beforeFn(r, f) + } + + getRepo = func(_ context.Context, _ *git.CloneOptions) (git.Repository, fs.FS, error) { + if tt.getRepoErr != nil { + return nil, nil, tt.getRepoErr + } + + return r, repofs, nil + } + currentKubeContext = func() (string, error) { + if tt.currentKubeContextErr != nil { + return "", tt.currentKubeContextErr + } + + return "context", nil + } + + opts := &RepoUninstallOptions{ + CloneOptions: &git.CloneOptions{ + Repo: "https://github.com/owner/name", + }, + KubeFactory: f, + } + opts.CloneOptions.Parse() + err := RunRepoUninstall(context.Background(), opts) + if err != nil { + if tt.wantErr != "" { + assert.EqualError(t, err, tt.wantErr) + } else { + t.Errorf("RunRepoUninstall() error = %v", err) + } + + return + } + + r.AssertExpectations(t) + f.AssertExpectations(t) + }) + } +} From e50528fb55b6fe1087d4511394c429160b729021 Mon Sep 17 00:00:00 2001 From: Noam Gal Date: Mon, 5 Jul 2021 11:34:35 +0300 Subject: [PATCH 09/14] removed file --- a.yaml | 9073 -------------------------------------------------------- 1 file changed, 9073 deletions(-) delete mode 100644 a.yaml diff --git a/a.yaml b/a.yaml deleted file mode 100644 index 2cdfa069..00000000 --- a/a.yaml +++ /dev/null @@ -1,9073 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - labels: - app.kubernetes.io/name: applications.argoproj.io - app.kubernetes.io/part-of: argocd - name: applications.argoproj.io -spec: - group: argoproj.io - names: - kind: Application - listKind: ApplicationList - plural: applications - shortNames: - - app - - apps - singular: application - scope: Namespaced - versions: - - additionalPrinterColumns: - - jsonPath: .status.sync.status - name: Sync Status - type: string - - jsonPath: .status.health.status - name: Health Status - type: string - - jsonPath: .status.sync.revision - name: Revision - priority: 10 - type: string - name: v1alpha1 - schema: - openAPIV3Schema: - description: Application is a definition of Application resource. - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - operation: - description: Operation contains information about a requested or running - operation - properties: - info: - description: Info is a list of informational items for this operation - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - initiatedBy: - description: InitiatedBy contains information about who initiated - the operations - properties: - automated: - description: Automated is set to true if operation was initiated - automatically by the application controller. - type: boolean - username: - description: Username contains the name of a user who started - operation - type: string - type: object - retry: - description: Retry controls the strategy to apply if a sync fails - properties: - backoff: - description: Backoff controls how to backoff on subsequent retries - of failed syncs - properties: - duration: - description: Duration is the amount to back off. Default unit - is seconds, but could also be a duration (e.g. "2m", "1h") - type: string - factor: - description: Factor is a factor to multiply the base duration - after each failed retry - format: int64 - type: integer - maxDuration: - description: MaxDuration is the maximum amount of time allowed - for the backoff strategy - type: string - type: object - limit: - description: Limit is the maximum number of attempts for retrying - a failed sync. If set to 0, no retries will be performed. - format: int64 - type: integer - type: object - sync: - description: Sync contains parameters for the operation - properties: - dryRun: - description: DryRun specifies to perform a `kubectl apply --dry-run` - without actually performing the sync - type: boolean - manifests: - description: Manifests is an optional field that overrides sync - source with a local directory for development - items: - type: string - type: array - prune: - description: Prune specifies to delete resources from the cluster - that are no longer tracked in git - type: boolean - resources: - description: Resources describes which resources shall be part - of the sync - items: - description: SyncOperationResource contains resources to sync. - properties: - group: - type: string - kind: - type: string - name: - type: string - namespace: - type: string - required: - - kind - - name - type: object - type: array - revision: - description: Revision is the revision (Git) or chart version (Helm) - which to sync the application to If omitted, will use the revision - specified in app spec. - type: string - source: - description: Source overrides the source definition set in the - application. This is typically set in a Rollback operation and - is nil during a Sync operation - properties: - chart: - description: Chart is a Helm chart name, and must be specified - for applications sourced from a Helm repo. - type: string - directory: - description: Directory holds path/directory specific options - properties: - exclude: - description: Exclude contains a glob pattern to match - paths against that should be explicitly excluded from - being used during manifest generation - type: string - include: - description: Include contains a glob pattern to match - paths against that should be explicitly included during - manifest generation - type: string - jsonnet: - description: Jsonnet holds options specific to Jsonnet - properties: - extVars: - description: ExtVars is a list of Jsonnet External - Variables - items: - description: JsonnetVar represents a variable to - be passed to jsonnet during manifest generation - properties: - code: - type: boolean - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - libs: - description: Additional library search dirs - items: - type: string - type: array - tlas: - description: TLAS is a list of Jsonnet Top-level Arguments - items: - description: JsonnetVar represents a variable to - be passed to jsonnet during manifest generation - properties: - code: - type: boolean - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - type: object - recurse: - description: Recurse specifies whether to scan a directory - recursively for manifests - type: boolean - type: object - helm: - description: Helm holds helm specific options - properties: - fileParameters: - description: FileParameters are file parameters to the - helm template - items: - description: HelmFileParameter is a file parameter that's - passed to helm template during manifest generation - properties: - name: - description: Name is the name of the Helm parameter - type: string - path: - description: Path is the path to the file containing - the values for the Helm parameter - type: string - type: object - type: array - parameters: - description: Parameters is a list of Helm parameters which - are passed to the helm template command upon manifest - generation - items: - description: HelmParameter is a parameter that's passed - to helm template during manifest generation - properties: - forceString: - description: ForceString determines whether to tell - Helm to interpret booleans and numbers as strings - type: boolean - name: - description: Name is the name of the Helm parameter - type: string - value: - description: Value is the value for the Helm parameter - type: string - type: object - type: array - releaseName: - description: ReleaseName is the Helm release name to use. - If omitted it will use the application name - type: string - valueFiles: - description: ValuesFiles is a list of Helm value files - to use when generating a template - items: - type: string - type: array - values: - description: Values specifies Helm values to be passed - to helm template, typically defined as a block - type: string - version: - description: Version is the Helm version to use for templating - (either "2" or "3") - type: string - type: object - ksonnet: - description: Ksonnet holds ksonnet specific options - properties: - environment: - description: Environment is a ksonnet application environment - name - type: string - parameters: - description: Parameters are a list of ksonnet component - parameter override values - items: - description: KsonnetParameter is a ksonnet component - parameter - properties: - component: - type: string - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - type: object - kustomize: - description: Kustomize holds kustomize specific options - properties: - commonAnnotations: - additionalProperties: - type: string - description: CommonAnnotations is a list of additional - annotations to add to rendered manifests - type: object - commonLabels: - additionalProperties: - type: string - description: CommonLabels is a list of additional labels - to add to rendered manifests - type: object - images: - description: Images is a list of Kustomize image override - specifications - items: - description: KustomizeImage represents a Kustomize image - definition in the format [old_image_name=]: - type: string - type: array - namePrefix: - description: NamePrefix is a prefix appended to resources - for Kustomize apps - type: string - nameSuffix: - description: NameSuffix is a suffix appended to resources - for Kustomize apps - type: string - version: - description: Version controls which version of Kustomize - to use for rendering manifests - type: string - type: object - path: - description: Path is a directory path within the Git repository, - and is only valid for applications sourced from Git. - type: string - plugin: - description: ConfigManagementPlugin holds config management - plugin specific options - properties: - env: - description: Env is a list of environment variable entries - items: - description: EnvEntry represents an entry in the application's - environment - properties: - name: - description: Name is the name of the variable, usually - expressed in uppercase - type: string - value: - description: Value is the value of the variable - type: string - required: - - name - - value - type: object - type: array - name: - type: string - type: object - repoURL: - description: RepoURL is the URL to the repository (Git or - Helm) that contains the application manifests - type: string - targetRevision: - description: TargetRevision defines the revision of the source - to sync the application to. In case of Git, this can be - commit, tag, or branch. If omitted, will equal to HEAD. - In case of Helm, this is a semver tag for the Chart's version. - type: string - required: - - repoURL - type: object - syncOptions: - description: SyncOptions provide per-sync sync-options, e.g. Validate=false - items: - type: string - type: array - syncStrategy: - description: SyncStrategy describes how to perform the sync - properties: - apply: - description: Apply will perform a `kubectl apply` to perform - the sync. - properties: - force: - description: Force indicates whether or not to supply - the --force flag to `kubectl apply`. The --force flag - deletes and re-create the resource, when PATCH encounters - conflict and has retried for 5 times. - type: boolean - type: object - hook: - description: Hook will submit any referenced resources to - perform the sync. This is the default strategy - properties: - force: - description: Force indicates whether or not to supply - the --force flag to `kubectl apply`. The --force flag - deletes and re-create the resource, when PATCH encounters - conflict and has retried for 5 times. - type: boolean - type: object - type: object - type: object - type: object - spec: - description: ApplicationSpec represents desired application state. Contains - link to repository with application definition and additional parameters - link definition revision. - properties: - destination: - description: Destination is a reference to the target Kubernetes server - and namespace - properties: - name: - description: Name is an alternate way of specifying the target - cluster by its symbolic name - type: string - namespace: - description: Namespace specifies the target namespace for the - application's resources. The namespace will only be set for - namespace-scoped resources that have not set a value for .metadata.namespace - type: string - server: - description: Server specifies the URL of the target cluster and - must be set to the Kubernetes control plane API - type: string - type: object - ignoreDifferences: - description: IgnoreDifferences is a list of resources and their fields - which should be ignored during comparison - items: - description: ResourceIgnoreDifferences contains resource filter - and list of json paths which should be ignored during comparison - with live state. - properties: - group: - type: string - jsonPointers: - items: - type: string - type: array - kind: - type: string - name: - type: string - namespace: - type: string - required: - - jsonPointers - - kind - type: object - type: array - info: - description: Info contains a list of information (URLs, email addresses, - and plain text) that relates to the application - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - project: - description: Project is a reference to the project this application - belongs to. The empty string means that application belongs to the - 'default' project. - type: string - revisionHistoryLimit: - description: RevisionHistoryLimit limits the number of items kept - in the application's revision history, which is used for informational - purposes as well as for rollbacks to previous versions. This should - only be changed in exceptional circumstances. Setting to zero will - store no history. This will reduce storage used. Increasing will - increase the space used to store the history, so we do not recommend - increasing it. Default is 10. - format: int64 - type: integer - source: - description: Source is a reference to the location of the application's - manifests or chart - properties: - chart: - description: Chart is a Helm chart name, and must be specified - for applications sourced from a Helm repo. - type: string - directory: - description: Directory holds path/directory specific options - properties: - exclude: - description: Exclude contains a glob pattern to match paths - against that should be explicitly excluded from being used - during manifest generation - type: string - include: - description: Include contains a glob pattern to match paths - against that should be explicitly included during manifest - generation - type: string - jsonnet: - description: Jsonnet holds options specific to Jsonnet - properties: - extVars: - description: ExtVars is a list of Jsonnet External Variables - items: - description: JsonnetVar represents a variable to be - passed to jsonnet during manifest generation - properties: - code: - type: boolean - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - libs: - description: Additional library search dirs - items: - type: string - type: array - tlas: - description: TLAS is a list of Jsonnet Top-level Arguments - items: - description: JsonnetVar represents a variable to be - passed to jsonnet during manifest generation - properties: - code: - type: boolean - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - type: object - recurse: - description: Recurse specifies whether to scan a directory - recursively for manifests - type: boolean - type: object - helm: - description: Helm holds helm specific options - properties: - fileParameters: - description: FileParameters are file parameters to the helm - template - items: - description: HelmFileParameter is a file parameter that's - passed to helm template during manifest generation - properties: - name: - description: Name is the name of the Helm parameter - type: string - path: - description: Path is the path to the file containing - the values for the Helm parameter - type: string - type: object - type: array - parameters: - description: Parameters is a list of Helm parameters which - are passed to the helm template command upon manifest generation - items: - description: HelmParameter is a parameter that's passed - to helm template during manifest generation - properties: - forceString: - description: ForceString determines whether to tell - Helm to interpret booleans and numbers as strings - type: boolean - name: - description: Name is the name of the Helm parameter - type: string - value: - description: Value is the value for the Helm parameter - type: string - type: object - type: array - releaseName: - description: ReleaseName is the Helm release name to use. - If omitted it will use the application name - type: string - valueFiles: - description: ValuesFiles is a list of Helm value files to - use when generating a template - items: - type: string - type: array - values: - description: Values specifies Helm values to be passed to - helm template, typically defined as a block - type: string - version: - description: Version is the Helm version to use for templating - (either "2" or "3") - type: string - type: object - ksonnet: - description: Ksonnet holds ksonnet specific options - properties: - environment: - description: Environment is a ksonnet application environment - name - type: string - parameters: - description: Parameters are a list of ksonnet component parameter - override values - items: - description: KsonnetParameter is a ksonnet component parameter - properties: - component: - type: string - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - type: object - kustomize: - description: Kustomize holds kustomize specific options - properties: - commonAnnotations: - additionalProperties: - type: string - description: CommonAnnotations is a list of additional annotations - to add to rendered manifests - type: object - commonLabels: - additionalProperties: - type: string - description: CommonLabels is a list of additional labels to - add to rendered manifests - type: object - images: - description: Images is a list of Kustomize image override - specifications - items: - description: KustomizeImage represents a Kustomize image - definition in the format [old_image_name=]: - type: string - type: array - namePrefix: - description: NamePrefix is a prefix appended to resources - for Kustomize apps - type: string - nameSuffix: - description: NameSuffix is a suffix appended to resources - for Kustomize apps - type: string - version: - description: Version controls which version of Kustomize to - use for rendering manifests - type: string - type: object - path: - description: Path is a directory path within the Git repository, - and is only valid for applications sourced from Git. - type: string - plugin: - description: ConfigManagementPlugin holds config management plugin - specific options - properties: - env: - description: Env is a list of environment variable entries - items: - description: EnvEntry represents an entry in the application's - environment - properties: - name: - description: Name is the name of the variable, usually - expressed in uppercase - type: string - value: - description: Value is the value of the variable - type: string - required: - - name - - value - type: object - type: array - name: - type: string - type: object - repoURL: - description: RepoURL is the URL to the repository (Git or Helm) - that contains the application manifests - type: string - targetRevision: - description: TargetRevision defines the revision of the source - to sync the application to. In case of Git, this can be commit, - tag, or branch. If omitted, will equal to HEAD. In case of Helm, - this is a semver tag for the Chart's version. - type: string - required: - - repoURL - type: object - syncPolicy: - description: SyncPolicy controls when and how a sync will be performed - properties: - automated: - description: Automated will keep an application synced to the - target revision - properties: - allowEmpty: - description: 'AllowEmpty allows apps have zero live resources - (default: false)' - type: boolean - prune: - description: 'Prune specifies whether to delete resources - from the cluster that are not found in the sources anymore - as part of automated sync (default: false)' - type: boolean - selfHeal: - description: 'SelfHeal specifes whether to revert resources - back to their desired state upon modification in the cluster - (default: false)' - type: boolean - type: object - retry: - description: Retry controls failed sync retry behavior - properties: - backoff: - description: Backoff controls how to backoff on subsequent - retries of failed syncs - properties: - duration: - description: Duration is the amount to back off. Default - unit is seconds, but could also be a duration (e.g. - "2m", "1h") - type: string - factor: - description: Factor is a factor to multiply the base duration - after each failed retry - format: int64 - type: integer - maxDuration: - description: MaxDuration is the maximum amount of time - allowed for the backoff strategy - type: string - type: object - limit: - description: Limit is the maximum number of attempts for retrying - a failed sync. If set to 0, no retries will be performed. - format: int64 - type: integer - type: object - syncOptions: - description: Options allow you to specify whole app sync-options - items: - type: string - type: array - type: object - required: - - destination - - project - - source - type: object - status: - description: ApplicationStatus contains status information for the application - properties: - conditions: - description: Conditions is a list of currently observed application - conditions - items: - description: ApplicationCondition contains details about an application - condition, which is usally an error or warning - properties: - lastTransitionTime: - description: LastTransitionTime is the time the condition was - last observed - format: date-time - type: string - message: - description: Message contains human-readable message indicating - details about condition - type: string - type: - description: Type is an application condition type - type: string - required: - - message - - type - type: object - type: array - health: - description: Health contains information about the application's current - health status - properties: - message: - description: Message is a human-readable informational message - describing the health status - type: string - status: - description: Status holds the status code of the application or - resource - type: string - type: object - history: - description: History contains information about the application's - sync history - items: - description: RevisionHistory contains history information about - a previous sync - properties: - deployStartedAt: - description: DeployStartedAt holds the time the sync operation - started - format: date-time - type: string - deployedAt: - description: DeployedAt holds the time the sync operation completed - format: date-time - type: string - id: - description: ID is an auto incrementing identifier of the RevisionHistory - format: int64 - type: integer - revision: - description: Revision holds the revision the sync was performed - against - type: string - source: - description: Source is a reference to the application source - used for the sync operation - properties: - chart: - description: Chart is a Helm chart name, and must be specified - for applications sourced from a Helm repo. - type: string - directory: - description: Directory holds path/directory specific options - properties: - exclude: - description: Exclude contains a glob pattern to match - paths against that should be explicitly excluded from - being used during manifest generation - type: string - include: - description: Include contains a glob pattern to match - paths against that should be explicitly included during - manifest generation - type: string - jsonnet: - description: Jsonnet holds options specific to Jsonnet - properties: - extVars: - description: ExtVars is a list of Jsonnet External - Variables - items: - description: JsonnetVar represents a variable - to be passed to jsonnet during manifest generation - properties: - code: - type: boolean - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - libs: - description: Additional library search dirs - items: - type: string - type: array - tlas: - description: TLAS is a list of Jsonnet Top-level - Arguments - items: - description: JsonnetVar represents a variable - to be passed to jsonnet during manifest generation - properties: - code: - type: boolean - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - type: object - recurse: - description: Recurse specifies whether to scan a directory - recursively for manifests - type: boolean - type: object - helm: - description: Helm holds helm specific options - properties: - fileParameters: - description: FileParameters are file parameters to the - helm template - items: - description: HelmFileParameter is a file parameter - that's passed to helm template during manifest generation - properties: - name: - description: Name is the name of the Helm parameter - type: string - path: - description: Path is the path to the file containing - the values for the Helm parameter - type: string - type: object - type: array - parameters: - description: Parameters is a list of Helm parameters - which are passed to the helm template command upon - manifest generation - items: - description: HelmParameter is a parameter that's passed - to helm template during manifest generation - properties: - forceString: - description: ForceString determines whether to - tell Helm to interpret booleans and numbers - as strings - type: boolean - name: - description: Name is the name of the Helm parameter - type: string - value: - description: Value is the value for the Helm parameter - type: string - type: object - type: array - releaseName: - description: ReleaseName is the Helm release name to - use. If omitted it will use the application name - type: string - valueFiles: - description: ValuesFiles is a list of Helm value files - to use when generating a template - items: - type: string - type: array - values: - description: Values specifies Helm values to be passed - to helm template, typically defined as a block - type: string - version: - description: Version is the Helm version to use for - templating (either "2" or "3") - type: string - type: object - ksonnet: - description: Ksonnet holds ksonnet specific options - properties: - environment: - description: Environment is a ksonnet application environment - name - type: string - parameters: - description: Parameters are a list of ksonnet component - parameter override values - items: - description: KsonnetParameter is a ksonnet component - parameter - properties: - component: - type: string - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - type: object - kustomize: - description: Kustomize holds kustomize specific options - properties: - commonAnnotations: - additionalProperties: - type: string - description: CommonAnnotations is a list of additional - annotations to add to rendered manifests - type: object - commonLabels: - additionalProperties: - type: string - description: CommonLabels is a list of additional labels - to add to rendered manifests - type: object - images: - description: Images is a list of Kustomize image override - specifications - items: - description: KustomizeImage represents a Kustomize - image definition in the format [old_image_name=]: - type: string - type: array - namePrefix: - description: NamePrefix is a prefix appended to resources - for Kustomize apps - type: string - nameSuffix: - description: NameSuffix is a suffix appended to resources - for Kustomize apps - type: string - version: - description: Version controls which version of Kustomize - to use for rendering manifests - type: string - type: object - path: - description: Path is a directory path within the Git repository, - and is only valid for applications sourced from Git. - type: string - plugin: - description: ConfigManagementPlugin holds config management - plugin specific options - properties: - env: - description: Env is a list of environment variable entries - items: - description: EnvEntry represents an entry in the application's - environment - properties: - name: - description: Name is the name of the variable, - usually expressed in uppercase - type: string - value: - description: Value is the value of the variable - type: string - required: - - name - - value - type: object - type: array - name: - type: string - type: object - repoURL: - description: RepoURL is the URL to the repository (Git or - Helm) that contains the application manifests - type: string - targetRevision: - description: TargetRevision defines the revision of the - source to sync the application to. In case of Git, this - can be commit, tag, or branch. If omitted, will equal - to HEAD. In case of Helm, this is a semver tag for the - Chart's version. - type: string - required: - - repoURL - type: object - required: - - deployedAt - - id - - revision - type: object - type: array - observedAt: - description: 'ObservedAt indicates when the application state was - updated without querying latest git state Deprecated: controller - no longer updates ObservedAt field' - format: date-time - type: string - operationState: - description: OperationState contains information about any ongoing - operations, such as a sync - properties: - finishedAt: - description: FinishedAt contains time of operation completion - format: date-time - type: string - message: - description: Message holds any pertinent messages when attempting - to perform operation (typically errors). - type: string - operation: - description: Operation is the original requested operation - properties: - info: - description: Info is a list of informational items for this - operation - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - initiatedBy: - description: InitiatedBy contains information about who initiated - the operations - properties: - automated: - description: Automated is set to true if operation was - initiated automatically by the application controller. - type: boolean - username: - description: Username contains the name of a user who - started operation - type: string - type: object - retry: - description: Retry controls the strategy to apply if a sync - fails - properties: - backoff: - description: Backoff controls how to backoff on subsequent - retries of failed syncs - properties: - duration: - description: Duration is the amount to back off. Default - unit is seconds, but could also be a duration (e.g. - "2m", "1h") - type: string - factor: - description: Factor is a factor to multiply the base - duration after each failed retry - format: int64 - type: integer - maxDuration: - description: MaxDuration is the maximum amount of - time allowed for the backoff strategy - type: string - type: object - limit: - description: Limit is the maximum number of attempts for - retrying a failed sync. If set to 0, no retries will - be performed. - format: int64 - type: integer - type: object - sync: - description: Sync contains parameters for the operation - properties: - dryRun: - description: DryRun specifies to perform a `kubectl apply - --dry-run` without actually performing the sync - type: boolean - manifests: - description: Manifests is an optional field that overrides - sync source with a local directory for development - items: - type: string - type: array - prune: - description: Prune specifies to delete resources from - the cluster that are no longer tracked in git - type: boolean - resources: - description: Resources describes which resources shall - be part of the sync - items: - description: SyncOperationResource contains resources - to sync. - properties: - group: - type: string - kind: - type: string - name: - type: string - namespace: - type: string - required: - - kind - - name - type: object - type: array - revision: - description: Revision is the revision (Git) or chart version - (Helm) which to sync the application to If omitted, - will use the revision specified in app spec. - type: string - source: - description: Source overrides the source definition set - in the application. This is typically set in a Rollback - operation and is nil during a Sync operation - properties: - chart: - description: Chart is a Helm chart name, and must - be specified for applications sourced from a Helm - repo. - type: string - directory: - description: Directory holds path/directory specific - options - properties: - exclude: - description: Exclude contains a glob pattern to - match paths against that should be explicitly - excluded from being used during manifest generation - type: string - include: - description: Include contains a glob pattern to - match paths against that should be explicitly - included during manifest generation - type: string - jsonnet: - description: Jsonnet holds options specific to - Jsonnet - properties: - extVars: - description: ExtVars is a list of Jsonnet - External Variables - items: - description: JsonnetVar represents a variable - to be passed to jsonnet during manifest - generation - properties: - code: - type: boolean - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - libs: - description: Additional library search dirs - items: - type: string - type: array - tlas: - description: TLAS is a list of Jsonnet Top-level - Arguments - items: - description: JsonnetVar represents a variable - to be passed to jsonnet during manifest - generation - properties: - code: - type: boolean - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - type: object - recurse: - description: Recurse specifies whether to scan - a directory recursively for manifests - type: boolean - type: object - helm: - description: Helm holds helm specific options - properties: - fileParameters: - description: FileParameters are file parameters - to the helm template - items: - description: HelmFileParameter is a file parameter - that's passed to helm template during manifest - generation - properties: - name: - description: Name is the name of the Helm - parameter - type: string - path: - description: Path is the path to the file - containing the values for the Helm parameter - type: string - type: object - type: array - parameters: - description: Parameters is a list of Helm parameters - which are passed to the helm template command - upon manifest generation - items: - description: HelmParameter is a parameter that's - passed to helm template during manifest generation - properties: - forceString: - description: ForceString determines whether - to tell Helm to interpret booleans and - numbers as strings - type: boolean - name: - description: Name is the name of the Helm - parameter - type: string - value: - description: Value is the value for the - Helm parameter - type: string - type: object - type: array - releaseName: - description: ReleaseName is the Helm release name - to use. If omitted it will use the application - name - type: string - valueFiles: - description: ValuesFiles is a list of Helm value - files to use when generating a template - items: - type: string - type: array - values: - description: Values specifies Helm values to be - passed to helm template, typically defined as - a block - type: string - version: - description: Version is the Helm version to use - for templating (either "2" or "3") - type: string - type: object - ksonnet: - description: Ksonnet holds ksonnet specific options - properties: - environment: - description: Environment is a ksonnet application - environment name - type: string - parameters: - description: Parameters are a list of ksonnet - component parameter override values - items: - description: KsonnetParameter is a ksonnet component - parameter - properties: - component: - type: string - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - type: object - kustomize: - description: Kustomize holds kustomize specific options - properties: - commonAnnotations: - additionalProperties: - type: string - description: CommonAnnotations is a list of additional - annotations to add to rendered manifests - type: object - commonLabels: - additionalProperties: - type: string - description: CommonLabels is a list of additional - labels to add to rendered manifests - type: object - images: - description: Images is a list of Kustomize image - override specifications - items: - description: KustomizeImage represents a Kustomize - image definition in the format [old_image_name=]: - type: string - type: array - namePrefix: - description: NamePrefix is a prefix appended to - resources for Kustomize apps - type: string - nameSuffix: - description: NameSuffix is a suffix appended to - resources for Kustomize apps - type: string - version: - description: Version controls which version of - Kustomize to use for rendering manifests - type: string - type: object - path: - description: Path is a directory path within the Git - repository, and is only valid for applications sourced - from Git. - type: string - plugin: - description: ConfigManagementPlugin holds config management - plugin specific options - properties: - env: - description: Env is a list of environment variable - entries - items: - description: EnvEntry represents an entry in - the application's environment - properties: - name: - description: Name is the name of the variable, - usually expressed in uppercase - type: string - value: - description: Value is the value of the variable - type: string - required: - - name - - value - type: object - type: array - name: - type: string - type: object - repoURL: - description: RepoURL is the URL to the repository - (Git or Helm) that contains the application manifests - type: string - targetRevision: - description: TargetRevision defines the revision of - the source to sync the application to. In case of - Git, this can be commit, tag, or branch. If omitted, - will equal to HEAD. In case of Helm, this is a semver - tag for the Chart's version. - type: string - required: - - repoURL - type: object - syncOptions: - description: SyncOptions provide per-sync sync-options, - e.g. Validate=false - items: - type: string - type: array - syncStrategy: - description: SyncStrategy describes how to perform the - sync - properties: - apply: - description: Apply will perform a `kubectl apply` - to perform the sync. - properties: - force: - description: Force indicates whether or not to - supply the --force flag to `kubectl apply`. - The --force flag deletes and re-create the resource, - when PATCH encounters conflict and has retried - for 5 times. - type: boolean - type: object - hook: - description: Hook will submit any referenced resources - to perform the sync. This is the default strategy - properties: - force: - description: Force indicates whether or not to - supply the --force flag to `kubectl apply`. - The --force flag deletes and re-create the resource, - when PATCH encounters conflict and has retried - for 5 times. - type: boolean - type: object - type: object - type: object - type: object - phase: - description: Phase is the current phase of the operation - type: string - retryCount: - description: RetryCount contains time of operation retries - format: int64 - type: integer - startedAt: - description: StartedAt contains time of operation start - format: date-time - type: string - syncResult: - description: SyncResult is the result of a Sync operation - properties: - resources: - description: Resources contains a list of sync result items - for each individual resource in a sync operation - items: - description: ResourceResult holds the operation result details - of a specific resource - properties: - group: - description: Group specifies the API group of the resource - type: string - hookPhase: - description: HookPhase contains the state of any operation - associated with this resource OR hook This can also - contain values for non-hook resources. - type: string - hookType: - description: HookType specifies the type of the hook. - Empty for non-hook resources - type: string - kind: - description: Kind specifies the API kind of the resource - type: string - message: - description: Message contains an informational or error - message for the last sync OR operation - type: string - name: - description: Name specifies the name of the resource - type: string - namespace: - description: Namespace specifies the target namespace - of the resource - type: string - status: - description: Status holds the final result of the sync. - Will be empty if the resources is yet to be applied/pruned - and is always zero-value for hooks - type: string - syncPhase: - description: SyncPhase indicates the particular phase - of the sync that this result was acquired in - type: string - version: - description: Version specifies the API version of the - resource - type: string - required: - - group - - kind - - name - - namespace - - version - type: object - type: array - revision: - description: Revision holds the revision this sync operation - was performed to - type: string - source: - description: Source records the application source information - of the sync, used for comparing auto-sync - properties: - chart: - description: Chart is a Helm chart name, and must be specified - for applications sourced from a Helm repo. - type: string - directory: - description: Directory holds path/directory specific options - properties: - exclude: - description: Exclude contains a glob pattern to match - paths against that should be explicitly excluded - from being used during manifest generation - type: string - include: - description: Include contains a glob pattern to match - paths against that should be explicitly included - during manifest generation - type: string - jsonnet: - description: Jsonnet holds options specific to Jsonnet - properties: - extVars: - description: ExtVars is a list of Jsonnet External - Variables - items: - description: JsonnetVar represents a variable - to be passed to jsonnet during manifest generation - properties: - code: - type: boolean - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - libs: - description: Additional library search dirs - items: - type: string - type: array - tlas: - description: TLAS is a list of Jsonnet Top-level - Arguments - items: - description: JsonnetVar represents a variable - to be passed to jsonnet during manifest generation - properties: - code: - type: boolean - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - type: object - recurse: - description: Recurse specifies whether to scan a directory - recursively for manifests - type: boolean - type: object - helm: - description: Helm holds helm specific options - properties: - fileParameters: - description: FileParameters are file parameters to - the helm template - items: - description: HelmFileParameter is a file parameter - that's passed to helm template during manifest - generation - properties: - name: - description: Name is the name of the Helm parameter - type: string - path: - description: Path is the path to the file containing - the values for the Helm parameter - type: string - type: object - type: array - parameters: - description: Parameters is a list of Helm parameters - which are passed to the helm template command upon - manifest generation - items: - description: HelmParameter is a parameter that's - passed to helm template during manifest generation - properties: - forceString: - description: ForceString determines whether - to tell Helm to interpret booleans and numbers - as strings - type: boolean - name: - description: Name is the name of the Helm parameter - type: string - value: - description: Value is the value for the Helm - parameter - type: string - type: object - type: array - releaseName: - description: ReleaseName is the Helm release name - to use. If omitted it will use the application name - type: string - valueFiles: - description: ValuesFiles is a list of Helm value files - to use when generating a template - items: - type: string - type: array - values: - description: Values specifies Helm values to be passed - to helm template, typically defined as a block - type: string - version: - description: Version is the Helm version to use for - templating (either "2" or "3") - type: string - type: object - ksonnet: - description: Ksonnet holds ksonnet specific options - properties: - environment: - description: Environment is a ksonnet application - environment name - type: string - parameters: - description: Parameters are a list of ksonnet component - parameter override values - items: - description: KsonnetParameter is a ksonnet component - parameter - properties: - component: - type: string - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - type: object - kustomize: - description: Kustomize holds kustomize specific options - properties: - commonAnnotations: - additionalProperties: - type: string - description: CommonAnnotations is a list of additional - annotations to add to rendered manifests - type: object - commonLabels: - additionalProperties: - type: string - description: CommonLabels is a list of additional - labels to add to rendered manifests - type: object - images: - description: Images is a list of Kustomize image override - specifications - items: - description: KustomizeImage represents a Kustomize - image definition in the format [old_image_name=]: - type: string - type: array - namePrefix: - description: NamePrefix is a prefix appended to resources - for Kustomize apps - type: string - nameSuffix: - description: NameSuffix is a suffix appended to resources - for Kustomize apps - type: string - version: - description: Version controls which version of Kustomize - to use for rendering manifests - type: string - type: object - path: - description: Path is a directory path within the Git repository, - and is only valid for applications sourced from Git. - type: string - plugin: - description: ConfigManagementPlugin holds config management - plugin specific options - properties: - env: - description: Env is a list of environment variable - entries - items: - description: EnvEntry represents an entry in the - application's environment - properties: - name: - description: Name is the name of the variable, - usually expressed in uppercase - type: string - value: - description: Value is the value of the variable - type: string - required: - - name - - value - type: object - type: array - name: - type: string - type: object - repoURL: - description: RepoURL is the URL to the repository (Git - or Helm) that contains the application manifests - type: string - targetRevision: - description: TargetRevision defines the revision of the - source to sync the application to. In case of Git, this - can be commit, tag, or branch. If omitted, will equal - to HEAD. In case of Helm, this is a semver tag for the - Chart's version. - type: string - required: - - repoURL - type: object - required: - - revision - type: object - required: - - operation - - phase - - startedAt - type: object - reconciledAt: - description: ReconciledAt indicates when the application state was - reconciled using the latest git version - format: date-time - type: string - resources: - description: Resources is a list of Kubernetes resources managed by - this application - items: - description: 'ResourceStatus holds the current sync and health status - of a resource TODO: describe members of this type' - properties: - group: - type: string - health: - description: HealthStatus contains information about the currently - observed health state of an application or resource - properties: - message: - description: Message is a human-readable informational message - describing the health status - type: string - status: - description: Status holds the status code of the application - or resource - type: string - type: object - hook: - type: boolean - kind: - type: string - name: - type: string - namespace: - type: string - requiresPruning: - type: boolean - status: - description: SyncStatusCode is a type which represents possible - comparison results - type: string - version: - type: string - type: object - type: array - sourceType: - description: SourceType specifies the type of this application - type: string - summary: - description: Summary contains a list of URLs and container images - used by this application - properties: - externalURLs: - description: ExternalURLs holds all external URLs of application - child resources. - items: - type: string - type: array - images: - description: Images holds all images of application child resources. - items: - type: string - type: array - type: object - sync: - description: Sync contains information about the application's current - sync status - properties: - comparedTo: - description: ComparedTo contains information about what has been - compared - properties: - destination: - description: Destination is a reference to the application's - destination used for comparison - properties: - name: - description: Name is an alternate way of specifying the - target cluster by its symbolic name - type: string - namespace: - description: Namespace specifies the target namespace - for the application's resources. The namespace will - only be set for namespace-scoped resources that have - not set a value for .metadata.namespace - type: string - server: - description: Server specifies the URL of the target cluster - and must be set to the Kubernetes control plane API - type: string - type: object - source: - description: Source is a reference to the application's source - used for comparison - properties: - chart: - description: Chart is a Helm chart name, and must be specified - for applications sourced from a Helm repo. - type: string - directory: - description: Directory holds path/directory specific options - properties: - exclude: - description: Exclude contains a glob pattern to match - paths against that should be explicitly excluded - from being used during manifest generation - type: string - include: - description: Include contains a glob pattern to match - paths against that should be explicitly included - during manifest generation - type: string - jsonnet: - description: Jsonnet holds options specific to Jsonnet - properties: - extVars: - description: ExtVars is a list of Jsonnet External - Variables - items: - description: JsonnetVar represents a variable - to be passed to jsonnet during manifest generation - properties: - code: - type: boolean - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - libs: - description: Additional library search dirs - items: - type: string - type: array - tlas: - description: TLAS is a list of Jsonnet Top-level - Arguments - items: - description: JsonnetVar represents a variable - to be passed to jsonnet during manifest generation - properties: - code: - type: boolean - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - type: object - recurse: - description: Recurse specifies whether to scan a directory - recursively for manifests - type: boolean - type: object - helm: - description: Helm holds helm specific options - properties: - fileParameters: - description: FileParameters are file parameters to - the helm template - items: - description: HelmFileParameter is a file parameter - that's passed to helm template during manifest - generation - properties: - name: - description: Name is the name of the Helm parameter - type: string - path: - description: Path is the path to the file containing - the values for the Helm parameter - type: string - type: object - type: array - parameters: - description: Parameters is a list of Helm parameters - which are passed to the helm template command upon - manifest generation - items: - description: HelmParameter is a parameter that's - passed to helm template during manifest generation - properties: - forceString: - description: ForceString determines whether - to tell Helm to interpret booleans and numbers - as strings - type: boolean - name: - description: Name is the name of the Helm parameter - type: string - value: - description: Value is the value for the Helm - parameter - type: string - type: object - type: array - releaseName: - description: ReleaseName is the Helm release name - to use. If omitted it will use the application name - type: string - valueFiles: - description: ValuesFiles is a list of Helm value files - to use when generating a template - items: - type: string - type: array - values: - description: Values specifies Helm values to be passed - to helm template, typically defined as a block - type: string - version: - description: Version is the Helm version to use for - templating (either "2" or "3") - type: string - type: object - ksonnet: - description: Ksonnet holds ksonnet specific options - properties: - environment: - description: Environment is a ksonnet application - environment name - type: string - parameters: - description: Parameters are a list of ksonnet component - parameter override values - items: - description: KsonnetParameter is a ksonnet component - parameter - properties: - component: - type: string - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - type: object - kustomize: - description: Kustomize holds kustomize specific options - properties: - commonAnnotations: - additionalProperties: - type: string - description: CommonAnnotations is a list of additional - annotations to add to rendered manifests - type: object - commonLabels: - additionalProperties: - type: string - description: CommonLabels is a list of additional - labels to add to rendered manifests - type: object - images: - description: Images is a list of Kustomize image override - specifications - items: - description: KustomizeImage represents a Kustomize - image definition in the format [old_image_name=]: - type: string - type: array - namePrefix: - description: NamePrefix is a prefix appended to resources - for Kustomize apps - type: string - nameSuffix: - description: NameSuffix is a suffix appended to resources - for Kustomize apps - type: string - version: - description: Version controls which version of Kustomize - to use for rendering manifests - type: string - type: object - path: - description: Path is a directory path within the Git repository, - and is only valid for applications sourced from Git. - type: string - plugin: - description: ConfigManagementPlugin holds config management - plugin specific options - properties: - env: - description: Env is a list of environment variable - entries - items: - description: EnvEntry represents an entry in the - application's environment - properties: - name: - description: Name is the name of the variable, - usually expressed in uppercase - type: string - value: - description: Value is the value of the variable - type: string - required: - - name - - value - type: object - type: array - name: - type: string - type: object - repoURL: - description: RepoURL is the URL to the repository (Git - or Helm) that contains the application manifests - type: string - targetRevision: - description: TargetRevision defines the revision of the - source to sync the application to. In case of Git, this - can be commit, tag, or branch. If omitted, will equal - to HEAD. In case of Helm, this is a semver tag for the - Chart's version. - type: string - required: - - repoURL - type: object - required: - - destination - - source - type: object - revision: - description: Revision contains information about the revision - the comparison has been performed to - type: string - status: - description: Status is the sync state of the comparison - type: string - required: - - status - type: object - type: object - required: - - metadata - - spec - type: object - served: true - storage: true - subresources: {} ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - annotations: - controller-gen.kubebuilder.io/version: v0.3.0 - creationTimestamp: null - name: applicationsets.argoproj.io -spec: - group: argoproj.io - names: - kind: ApplicationSet - listKind: ApplicationSetList - plural: applicationsets - shortNames: - - appset - - appsets - singular: applicationset - scope: Namespaced - versions: - - name: v1alpha1 - schema: - openAPIV3Schema: - description: ApplicationSet is a set of Application resources - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: ApplicationSetSpec represents a class of application set - state. - properties: - generators: - items: - description: ApplicationSetGenerator include list item info - properties: - clusterDecisionResource: - description: DuckType defines a generator to match against clusters - registered with ArgoCD. - properties: - configMapRef: - description: ConfigMapRef is a ConfigMap with the duck type - definitions needed to retreive the data this - includes apiVersion(group/version), kind, matchKey and - validation settings Name is the resource name of the kind, - group and version, defined in the ConfigMapRef RequeueAfterSeconds - is how long before the duckType will be rechecked for - a change - type: string - labelSelector: - description: A label selector is a label query over a set - of resources. The result of matchLabels and matchExpressions - are ANDed. An empty label selector matches all objects. - A null label selector matches no objects. - properties: - matchExpressions: - description: matchExpressions is a list of label selector - requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector - that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that the selector - applies to. - type: string - operator: - description: operator represents a key's relationship - to a set of values. Valid operators are In, - NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. - If the operator is In or NotIn, the values array - must be non-empty. If the operator is Exists - or DoesNotExist, the values array must be empty. - This array is replaced during a strategic merge - patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. - A single {key,value} in the matchLabels map is equivalent - to an element of matchExpressions, whose key field - is "key", the operator is "In", and the values array - contains only "value". The requirements are ANDed. - type: object - type: object - name: - type: string - requeueAfterSeconds: - format: int64 - type: integer - template: - description: ApplicationSetTemplate represents argocd ApplicationSpec - properties: - metadata: - description: ApplicationSetTemplateMeta represents the - Argo CD application fields that may be used for Applications - generated from the ApplicationSet (based on metav1.ObjectMeta) - properties: - annotations: - additionalProperties: - type: string - type: object - labels: - additionalProperties: - type: string - type: object - name: - type: string - namespace: - type: string - type: object - spec: - description: ApplicationSpec represents desired application - state. Contains link to repository with application - definition and additional parameters link definition - revision. - properties: - destination: - description: Destination overrides the kubernetes - server and namespace defined in the environment - ksonnet app.yaml - properties: - name: - description: Name of the destination cluster - which can be used instead of server (url) - field - type: string - namespace: - description: Namespace overrides the environment - namespace value in the ksonnet app.yaml - type: string - server: - description: Server overrides the environment - server value in the ksonnet app.yaml - type: string - type: object - ignoreDifferences: - description: IgnoreDifferences controls resources - fields which should be ignored during comparison - items: - description: ResourceIgnoreDifferences contains - resource filter and list of json paths which - should be ignored during comparison with live - state. - properties: - group: - type: string - jsonPointers: - items: - type: string - type: array - kind: - type: string - name: - type: string - namespace: - type: string - required: - - jsonPointers - - kind - type: object - type: array - info: - description: Infos contains a list of useful information - (URLs, email addresses, and plain text) that relates - to the application - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - project: - description: Project is a application project name. - Empty name means that application belongs to 'default' - project. - type: string - revisionHistoryLimit: - description: This limits this number of items kept - in the apps revision history. This should only - be changed in exceptional circumstances. Setting - to zero will store no history. This will reduce - storage used. Increasing will increase the space - used to store the history, so we do not recommend - increasing it. Default is 10. - format: int64 - type: integer - source: - description: Source is a reference to the location - ksonnet application definition - properties: - chart: - description: Chart is a Helm chart name - type: string - directory: - description: Directory holds path/directory - specific options - properties: - exclude: - type: string - jsonnet: - description: ApplicationSourceJsonnet holds - jsonnet specific options - properties: - extVars: - description: ExtVars is a list of Jsonnet - External Variables - items: - description: JsonnetVar is a jsonnet - variable - properties: - code: - type: boolean - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - libs: - description: Additional library search - dirs - items: - type: string - type: array - tlas: - description: TLAS is a list of Jsonnet - Top-level Arguments - items: - description: JsonnetVar is a jsonnet - variable - properties: - code: - type: boolean - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - type: object - recurse: - type: boolean - type: object - helm: - description: Helm holds helm specific options - properties: - fileParameters: - description: FileParameters are file parameters - to the helm template - items: - description: HelmFileParameter is a file - parameter to a helm template - properties: - name: - description: Name is the name of the - helm parameter - type: string - path: - description: Path is the path value - for the helm parameter - type: string - type: object - type: array - parameters: - description: Parameters are parameters to - the helm template - items: - description: HelmParameter is a parameter - to a helm template - properties: - forceString: - description: ForceString determines - whether to tell Helm to interpret - booleans and numbers as strings - type: boolean - name: - description: Name is the name of the - helm parameter - type: string - value: - description: Value is the value for - the helm parameter - type: string - type: object - type: array - releaseName: - description: The Helm release name. If omitted - it will use the application name - type: string - valueFiles: - description: ValuesFiles is a list of Helm - value files to use when generating a template - items: - type: string - type: array - values: - description: Values is Helm values, typically - defined as a block - type: string - version: - description: Version is the Helm version - to use for templating with - type: string - type: object - ksonnet: - description: Ksonnet holds ksonnet specific - options - properties: - environment: - description: Environment is a ksonnet application - environment name - type: string - parameters: - description: Parameters are a list of ksonnet - component parameter override values - items: - description: KsonnetParameter is a ksonnet - component parameter - properties: - component: - type: string - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - type: object - kustomize: - description: Kustomize holds kustomize specific - options - properties: - commonAnnotations: - additionalProperties: - type: string - description: CommonAnnotations adds additional - kustomize commonAnnotations - type: object - commonLabels: - additionalProperties: - type: string - description: CommonLabels adds additional - kustomize commonLabels - type: object - images: - description: Images are kustomize image - overrides - items: - type: string - type: array - namePrefix: - description: NamePrefix is a prefix appended - to resources for kustomize apps - type: string - nameSuffix: - description: NameSuffix is a suffix appended - to resources for kustomize apps - type: string - version: - description: Version contains optional Kustomize - version - type: string - type: object - path: - description: Path is a directory path within - the Git repository - type: string - plugin: - description: ConfigManagementPlugin holds config - management plugin specific options - properties: - env: - items: - properties: - name: - description: the name, usually uppercase - type: string - value: - description: the value - type: string - required: - - name - - value - type: object - type: array - name: - type: string - type: object - repoURL: - description: RepoURL is the repository URL of - the application manifests - type: string - targetRevision: - description: TargetRevision defines the commit, - tag, or branch in which to sync the application - to. If omitted, will sync to HEAD - type: string - required: - - repoURL - type: object - syncPolicy: - description: SyncPolicy controls when a sync will - be performed - properties: - automated: - description: Automated will keep an application - synced to the target revision - properties: - allowEmpty: - description: 'AllowEmpty allows apps have - zero live resources (default: false)' - type: boolean - prune: - description: 'Prune will prune resources - automatically as part of automated sync - (default: false)' - type: boolean - selfHeal: - description: 'SelfHeal enables auto-syncing - if (default: false)' - type: boolean - type: object - retry: - description: Retry controls failed sync retry - behavior - properties: - backoff: - description: Backoff is a backoff strategy - properties: - duration: - description: Duration is the amount - to back off. Default unit is seconds, - but could also be a duration (e.g. - "2m", "1h") - type: string - factor: - description: Factor is a factor to multiply - the base duration after each failed - retry - format: int64 - type: integer - maxDuration: - description: MaxDuration is the maximum - amount of time allowed for the backoff - strategy - type: string - type: object - limit: - description: Limit is the maximum number - of attempts when retrying a container - format: int64 - type: integer - type: object - syncOptions: - description: Options allow you to specify whole - app sync-options - items: - type: string - type: array - type: object - required: - - destination - - project - - source - type: object - required: - - metadata - - spec - type: object - values: - additionalProperties: - type: string - description: Values contains key/value pairs which are passed - directly as parameters to the template - type: object - required: - - configMapRef - type: object - clusters: - description: ClusterGenerator defines a generator to match against - clusters registered with ArgoCD. - properties: - selector: - description: Selector defines a label selector to match - against all clusters registered with ArgoCD. Clusters - today are stored as Kubernetes Secrets, thus the Secret - labels will be used for matching the selector. - properties: - matchExpressions: - description: matchExpressions is a list of label selector - requirements. The requirements are ANDed. - items: - description: A label selector requirement is a selector - that contains values, a key, and an operator that - relates the key and values. - properties: - key: - description: key is the label key that the selector - applies to. - type: string - operator: - description: operator represents a key's relationship - to a set of values. Valid operators are In, - NotIn, Exists and DoesNotExist. - type: string - values: - description: values is an array of string values. - If the operator is In or NotIn, the values array - must be non-empty. If the operator is Exists - or DoesNotExist, the values array must be empty. - This array is replaced during a strategic merge - patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} pairs. - A single {key,value} in the matchLabels map is equivalent - to an element of matchExpressions, whose key field - is "key", the operator is "In", and the values array - contains only "value". The requirements are ANDed. - type: object - type: object - template: - description: ApplicationSetTemplate represents argocd ApplicationSpec - properties: - metadata: - description: ApplicationSetTemplateMeta represents the - Argo CD application fields that may be used for Applications - generated from the ApplicationSet (based on metav1.ObjectMeta) - properties: - annotations: - additionalProperties: - type: string - type: object - labels: - additionalProperties: - type: string - type: object - name: - type: string - namespace: - type: string - type: object - spec: - description: ApplicationSpec represents desired application - state. Contains link to repository with application - definition and additional parameters link definition - revision. - properties: - destination: - description: Destination overrides the kubernetes - server and namespace defined in the environment - ksonnet app.yaml - properties: - name: - description: Name of the destination cluster - which can be used instead of server (url) - field - type: string - namespace: - description: Namespace overrides the environment - namespace value in the ksonnet app.yaml - type: string - server: - description: Server overrides the environment - server value in the ksonnet app.yaml - type: string - type: object - ignoreDifferences: - description: IgnoreDifferences controls resources - fields which should be ignored during comparison - items: - description: ResourceIgnoreDifferences contains - resource filter and list of json paths which - should be ignored during comparison with live - state. - properties: - group: - type: string - jsonPointers: - items: - type: string - type: array - kind: - type: string - name: - type: string - namespace: - type: string - required: - - jsonPointers - - kind - type: object - type: array - info: - description: Infos contains a list of useful information - (URLs, email addresses, and plain text) that relates - to the application - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - project: - description: Project is a application project name. - Empty name means that application belongs to 'default' - project. - type: string - revisionHistoryLimit: - description: This limits this number of items kept - in the apps revision history. This should only - be changed in exceptional circumstances. Setting - to zero will store no history. This will reduce - storage used. Increasing will increase the space - used to store the history, so we do not recommend - increasing it. Default is 10. - format: int64 - type: integer - source: - description: Source is a reference to the location - ksonnet application definition - properties: - chart: - description: Chart is a Helm chart name - type: string - directory: - description: Directory holds path/directory - specific options - properties: - exclude: - type: string - jsonnet: - description: ApplicationSourceJsonnet holds - jsonnet specific options - properties: - extVars: - description: ExtVars is a list of Jsonnet - External Variables - items: - description: JsonnetVar is a jsonnet - variable - properties: - code: - type: boolean - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - libs: - description: Additional library search - dirs - items: - type: string - type: array - tlas: - description: TLAS is a list of Jsonnet - Top-level Arguments - items: - description: JsonnetVar is a jsonnet - variable - properties: - code: - type: boolean - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - type: object - recurse: - type: boolean - type: object - helm: - description: Helm holds helm specific options - properties: - fileParameters: - description: FileParameters are file parameters - to the helm template - items: - description: HelmFileParameter is a file - parameter to a helm template - properties: - name: - description: Name is the name of the - helm parameter - type: string - path: - description: Path is the path value - for the helm parameter - type: string - type: object - type: array - parameters: - description: Parameters are parameters to - the helm template - items: - description: HelmParameter is a parameter - to a helm template - properties: - forceString: - description: ForceString determines - whether to tell Helm to interpret - booleans and numbers as strings - type: boolean - name: - description: Name is the name of the - helm parameter - type: string - value: - description: Value is the value for - the helm parameter - type: string - type: object - type: array - releaseName: - description: The Helm release name. If omitted - it will use the application name - type: string - valueFiles: - description: ValuesFiles is a list of Helm - value files to use when generating a template - items: - type: string - type: array - values: - description: Values is Helm values, typically - defined as a block - type: string - version: - description: Version is the Helm version - to use for templating with - type: string - type: object - ksonnet: - description: Ksonnet holds ksonnet specific - options - properties: - environment: - description: Environment is a ksonnet application - environment name - type: string - parameters: - description: Parameters are a list of ksonnet - component parameter override values - items: - description: KsonnetParameter is a ksonnet - component parameter - properties: - component: - type: string - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - type: object - kustomize: - description: Kustomize holds kustomize specific - options - properties: - commonAnnotations: - additionalProperties: - type: string - description: CommonAnnotations adds additional - kustomize commonAnnotations - type: object - commonLabels: - additionalProperties: - type: string - description: CommonLabels adds additional - kustomize commonLabels - type: object - images: - description: Images are kustomize image - overrides - items: - type: string - type: array - namePrefix: - description: NamePrefix is a prefix appended - to resources for kustomize apps - type: string - nameSuffix: - description: NameSuffix is a suffix appended - to resources for kustomize apps - type: string - version: - description: Version contains optional Kustomize - version - type: string - type: object - path: - description: Path is a directory path within - the Git repository - type: string - plugin: - description: ConfigManagementPlugin holds config - management plugin specific options - properties: - env: - items: - properties: - name: - description: the name, usually uppercase - type: string - value: - description: the value - type: string - required: - - name - - value - type: object - type: array - name: - type: string - type: object - repoURL: - description: RepoURL is the repository URL of - the application manifests - type: string - targetRevision: - description: TargetRevision defines the commit, - tag, or branch in which to sync the application - to. If omitted, will sync to HEAD - type: string - required: - - repoURL - type: object - syncPolicy: - description: SyncPolicy controls when a sync will - be performed - properties: - automated: - description: Automated will keep an application - synced to the target revision - properties: - allowEmpty: - description: 'AllowEmpty allows apps have - zero live resources (default: false)' - type: boolean - prune: - description: 'Prune will prune resources - automatically as part of automated sync - (default: false)' - type: boolean - selfHeal: - description: 'SelfHeal enables auto-syncing - if (default: false)' - type: boolean - type: object - retry: - description: Retry controls failed sync retry - behavior - properties: - backoff: - description: Backoff is a backoff strategy - properties: - duration: - description: Duration is the amount - to back off. Default unit is seconds, - but could also be a duration (e.g. - "2m", "1h") - type: string - factor: - description: Factor is a factor to multiply - the base duration after each failed - retry - format: int64 - type: integer - maxDuration: - description: MaxDuration is the maximum - amount of time allowed for the backoff - strategy - type: string - type: object - limit: - description: Limit is the maximum number - of attempts when retrying a container - format: int64 - type: integer - type: object - syncOptions: - description: Options allow you to specify whole - app sync-options - items: - type: string - type: array - type: object - required: - - destination - - project - - source - type: object - required: - - metadata - - spec - type: object - values: - additionalProperties: - type: string - description: Values contains key/value pairs which are passed - directly as parameters to the template - type: object - type: object - git: - properties: - directories: - items: - properties: - exclude: - type: boolean - path: - type: string - required: - - path - type: object - type: array - files: - items: - properties: - path: - type: string - required: - - path - type: object - type: array - repoURL: - type: string - requeueAfterSeconds: - format: int64 - type: integer - revision: - type: string - template: - description: ApplicationSetTemplate represents argocd ApplicationSpec - properties: - metadata: - description: ApplicationSetTemplateMeta represents the - Argo CD application fields that may be used for Applications - generated from the ApplicationSet (based on metav1.ObjectMeta) - properties: - annotations: - additionalProperties: - type: string - type: object - labels: - additionalProperties: - type: string - type: object - name: - type: string - namespace: - type: string - type: object - spec: - description: ApplicationSpec represents desired application - state. Contains link to repository with application - definition and additional parameters link definition - revision. - properties: - destination: - description: Destination overrides the kubernetes - server and namespace defined in the environment - ksonnet app.yaml - properties: - name: - description: Name of the destination cluster - which can be used instead of server (url) - field - type: string - namespace: - description: Namespace overrides the environment - namespace value in the ksonnet app.yaml - type: string - server: - description: Server overrides the environment - server value in the ksonnet app.yaml - type: string - type: object - ignoreDifferences: - description: IgnoreDifferences controls resources - fields which should be ignored during comparison - items: - description: ResourceIgnoreDifferences contains - resource filter and list of json paths which - should be ignored during comparison with live - state. - properties: - group: - type: string - jsonPointers: - items: - type: string - type: array - kind: - type: string - name: - type: string - namespace: - type: string - required: - - jsonPointers - - kind - type: object - type: array - info: - description: Infos contains a list of useful information - (URLs, email addresses, and plain text) that relates - to the application - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - project: - description: Project is a application project name. - Empty name means that application belongs to 'default' - project. - type: string - revisionHistoryLimit: - description: This limits this number of items kept - in the apps revision history. This should only - be changed in exceptional circumstances. Setting - to zero will store no history. This will reduce - storage used. Increasing will increase the space - used to store the history, so we do not recommend - increasing it. Default is 10. - format: int64 - type: integer - source: - description: Source is a reference to the location - ksonnet application definition - properties: - chart: - description: Chart is a Helm chart name - type: string - directory: - description: Directory holds path/directory - specific options - properties: - exclude: - type: string - jsonnet: - description: ApplicationSourceJsonnet holds - jsonnet specific options - properties: - extVars: - description: ExtVars is a list of Jsonnet - External Variables - items: - description: JsonnetVar is a jsonnet - variable - properties: - code: - type: boolean - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - libs: - description: Additional library search - dirs - items: - type: string - type: array - tlas: - description: TLAS is a list of Jsonnet - Top-level Arguments - items: - description: JsonnetVar is a jsonnet - variable - properties: - code: - type: boolean - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - type: object - recurse: - type: boolean - type: object - helm: - description: Helm holds helm specific options - properties: - fileParameters: - description: FileParameters are file parameters - to the helm template - items: - description: HelmFileParameter is a file - parameter to a helm template - properties: - name: - description: Name is the name of the - helm parameter - type: string - path: - description: Path is the path value - for the helm parameter - type: string - type: object - type: array - parameters: - description: Parameters are parameters to - the helm template - items: - description: HelmParameter is a parameter - to a helm template - properties: - forceString: - description: ForceString determines - whether to tell Helm to interpret - booleans and numbers as strings - type: boolean - name: - description: Name is the name of the - helm parameter - type: string - value: - description: Value is the value for - the helm parameter - type: string - type: object - type: array - releaseName: - description: The Helm release name. If omitted - it will use the application name - type: string - valueFiles: - description: ValuesFiles is a list of Helm - value files to use when generating a template - items: - type: string - type: array - values: - description: Values is Helm values, typically - defined as a block - type: string - version: - description: Version is the Helm version - to use for templating with - type: string - type: object - ksonnet: - description: Ksonnet holds ksonnet specific - options - properties: - environment: - description: Environment is a ksonnet application - environment name - type: string - parameters: - description: Parameters are a list of ksonnet - component parameter override values - items: - description: KsonnetParameter is a ksonnet - component parameter - properties: - component: - type: string - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - type: object - kustomize: - description: Kustomize holds kustomize specific - options - properties: - commonAnnotations: - additionalProperties: - type: string - description: CommonAnnotations adds additional - kustomize commonAnnotations - type: object - commonLabels: - additionalProperties: - type: string - description: CommonLabels adds additional - kustomize commonLabels - type: object - images: - description: Images are kustomize image - overrides - items: - type: string - type: array - namePrefix: - description: NamePrefix is a prefix appended - to resources for kustomize apps - type: string - nameSuffix: - description: NameSuffix is a suffix appended - to resources for kustomize apps - type: string - version: - description: Version contains optional Kustomize - version - type: string - type: object - path: - description: Path is a directory path within - the Git repository - type: string - plugin: - description: ConfigManagementPlugin holds config - management plugin specific options - properties: - env: - items: - properties: - name: - description: the name, usually uppercase - type: string - value: - description: the value - type: string - required: - - name - - value - type: object - type: array - name: - type: string - type: object - repoURL: - description: RepoURL is the repository URL of - the application manifests - type: string - targetRevision: - description: TargetRevision defines the commit, - tag, or branch in which to sync the application - to. If omitted, will sync to HEAD - type: string - required: - - repoURL - type: object - syncPolicy: - description: SyncPolicy controls when a sync will - be performed - properties: - automated: - description: Automated will keep an application - synced to the target revision - properties: - allowEmpty: - description: 'AllowEmpty allows apps have - zero live resources (default: false)' - type: boolean - prune: - description: 'Prune will prune resources - automatically as part of automated sync - (default: false)' - type: boolean - selfHeal: - description: 'SelfHeal enables auto-syncing - if (default: false)' - type: boolean - type: object - retry: - description: Retry controls failed sync retry - behavior - properties: - backoff: - description: Backoff is a backoff strategy - properties: - duration: - description: Duration is the amount - to back off. Default unit is seconds, - but could also be a duration (e.g. - "2m", "1h") - type: string - factor: - description: Factor is a factor to multiply - the base duration after each failed - retry - format: int64 - type: integer - maxDuration: - description: MaxDuration is the maximum - amount of time allowed for the backoff - strategy - type: string - type: object - limit: - description: Limit is the maximum number - of attempts when retrying a container - format: int64 - type: integer - type: object - syncOptions: - description: Options allow you to specify whole - app sync-options - items: - type: string - type: array - type: object - required: - - destination - - project - - source - type: object - required: - - metadata - - spec - type: object - required: - - repoURL - - revision - type: object - list: - description: ListGenerator include items info - properties: - elements: - items: - description: ListGeneratorElement include cluster and - url info - properties: - cluster: - type: string - url: - type: string - values: - additionalProperties: - type: string - description: Values contains key/value pairs which - are passed directly as parameters to the template - type: object - required: - - cluster - - url - type: object - type: array - template: - description: ApplicationSetTemplate represents argocd ApplicationSpec - properties: - metadata: - description: ApplicationSetTemplateMeta represents the - Argo CD application fields that may be used for Applications - generated from the ApplicationSet (based on metav1.ObjectMeta) - properties: - annotations: - additionalProperties: - type: string - type: object - labels: - additionalProperties: - type: string - type: object - name: - type: string - namespace: - type: string - type: object - spec: - description: ApplicationSpec represents desired application - state. Contains link to repository with application - definition and additional parameters link definition - revision. - properties: - destination: - description: Destination overrides the kubernetes - server and namespace defined in the environment - ksonnet app.yaml - properties: - name: - description: Name of the destination cluster - which can be used instead of server (url) - field - type: string - namespace: - description: Namespace overrides the environment - namespace value in the ksonnet app.yaml - type: string - server: - description: Server overrides the environment - server value in the ksonnet app.yaml - type: string - type: object - ignoreDifferences: - description: IgnoreDifferences controls resources - fields which should be ignored during comparison - items: - description: ResourceIgnoreDifferences contains - resource filter and list of json paths which - should be ignored during comparison with live - state. - properties: - group: - type: string - jsonPointers: - items: - type: string - type: array - kind: - type: string - name: - type: string - namespace: - type: string - required: - - jsonPointers - - kind - type: object - type: array - info: - description: Infos contains a list of useful information - (URLs, email addresses, and plain text) that relates - to the application - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - project: - description: Project is a application project name. - Empty name means that application belongs to 'default' - project. - type: string - revisionHistoryLimit: - description: This limits this number of items kept - in the apps revision history. This should only - be changed in exceptional circumstances. Setting - to zero will store no history. This will reduce - storage used. Increasing will increase the space - used to store the history, so we do not recommend - increasing it. Default is 10. - format: int64 - type: integer - source: - description: Source is a reference to the location - ksonnet application definition - properties: - chart: - description: Chart is a Helm chart name - type: string - directory: - description: Directory holds path/directory - specific options - properties: - exclude: - type: string - jsonnet: - description: ApplicationSourceJsonnet holds - jsonnet specific options - properties: - extVars: - description: ExtVars is a list of Jsonnet - External Variables - items: - description: JsonnetVar is a jsonnet - variable - properties: - code: - type: boolean - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - libs: - description: Additional library search - dirs - items: - type: string - type: array - tlas: - description: TLAS is a list of Jsonnet - Top-level Arguments - items: - description: JsonnetVar is a jsonnet - variable - properties: - code: - type: boolean - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - type: object - recurse: - type: boolean - type: object - helm: - description: Helm holds helm specific options - properties: - fileParameters: - description: FileParameters are file parameters - to the helm template - items: - description: HelmFileParameter is a file - parameter to a helm template - properties: - name: - description: Name is the name of the - helm parameter - type: string - path: - description: Path is the path value - for the helm parameter - type: string - type: object - type: array - parameters: - description: Parameters are parameters to - the helm template - items: - description: HelmParameter is a parameter - to a helm template - properties: - forceString: - description: ForceString determines - whether to tell Helm to interpret - booleans and numbers as strings - type: boolean - name: - description: Name is the name of the - helm parameter - type: string - value: - description: Value is the value for - the helm parameter - type: string - type: object - type: array - releaseName: - description: The Helm release name. If omitted - it will use the application name - type: string - valueFiles: - description: ValuesFiles is a list of Helm - value files to use when generating a template - items: - type: string - type: array - values: - description: Values is Helm values, typically - defined as a block - type: string - version: - description: Version is the Helm version - to use for templating with - type: string - type: object - ksonnet: - description: Ksonnet holds ksonnet specific - options - properties: - environment: - description: Environment is a ksonnet application - environment name - type: string - parameters: - description: Parameters are a list of ksonnet - component parameter override values - items: - description: KsonnetParameter is a ksonnet - component parameter - properties: - component: - type: string - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - type: object - kustomize: - description: Kustomize holds kustomize specific - options - properties: - commonAnnotations: - additionalProperties: - type: string - description: CommonAnnotations adds additional - kustomize commonAnnotations - type: object - commonLabels: - additionalProperties: - type: string - description: CommonLabels adds additional - kustomize commonLabels - type: object - images: - description: Images are kustomize image - overrides - items: - type: string - type: array - namePrefix: - description: NamePrefix is a prefix appended - to resources for kustomize apps - type: string - nameSuffix: - description: NameSuffix is a suffix appended - to resources for kustomize apps - type: string - version: - description: Version contains optional Kustomize - version - type: string - type: object - path: - description: Path is a directory path within - the Git repository - type: string - plugin: - description: ConfigManagementPlugin holds config - management plugin specific options - properties: - env: - items: - properties: - name: - description: the name, usually uppercase - type: string - value: - description: the value - type: string - required: - - name - - value - type: object - type: array - name: - type: string - type: object - repoURL: - description: RepoURL is the repository URL of - the application manifests - type: string - targetRevision: - description: TargetRevision defines the commit, - tag, or branch in which to sync the application - to. If omitted, will sync to HEAD - type: string - required: - - repoURL - type: object - syncPolicy: - description: SyncPolicy controls when a sync will - be performed - properties: - automated: - description: Automated will keep an application - synced to the target revision - properties: - allowEmpty: - description: 'AllowEmpty allows apps have - zero live resources (default: false)' - type: boolean - prune: - description: 'Prune will prune resources - automatically as part of automated sync - (default: false)' - type: boolean - selfHeal: - description: 'SelfHeal enables auto-syncing - if (default: false)' - type: boolean - type: object - retry: - description: Retry controls failed sync retry - behavior - properties: - backoff: - description: Backoff is a backoff strategy - properties: - duration: - description: Duration is the amount - to back off. Default unit is seconds, - but could also be a duration (e.g. - "2m", "1h") - type: string - factor: - description: Factor is a factor to multiply - the base duration after each failed - retry - format: int64 - type: integer - maxDuration: - description: MaxDuration is the maximum - amount of time allowed for the backoff - strategy - type: string - type: object - limit: - description: Limit is the maximum number - of attempts when retrying a container - format: int64 - type: integer - type: object - syncOptions: - description: Options allow you to specify whole - app sync-options - items: - type: string - type: array - type: object - required: - - destination - - project - - source - type: object - required: - - metadata - - spec - type: object - required: - - elements - type: object - matrix: - description: MatrixGenerator include Other generators - properties: - generators: - items: - description: ApplicationSetBaseGenerator include list - item info CRD dosn't support recursive types so we need - a different type for the matrix generator https://github.com/kubernetes-sigs/controller-tools/issues/477 - properties: - clusterDecisionResource: - description: DuckType defines a generator to match - against clusters registered with ArgoCD. - properties: - configMapRef: - description: ConfigMapRef is a ConfigMap with - the duck type definitions needed to retreive - the data this includes apiVersion(group/version), - kind, matchKey and validation settings Name - is the resource name of the kind, group and - version, defined in the ConfigMapRef RequeueAfterSeconds - is how long before the duckType will be rechecked - for a change - type: string - labelSelector: - description: A label selector is a label query - over a set of resources. The result of matchLabels - and matchExpressions are ANDed. An empty label - selector matches all objects. A null label selector - matches no objects. - properties: - matchExpressions: - description: matchExpressions is a list of - label selector requirements. The requirements - are ANDed. - items: - description: A label selector requirement - is a selector that contains values, a - key, and an operator that relates the - key and values. - properties: - key: - description: key is the label key that - the selector applies to. - type: string - operator: - description: operator represents a key's - relationship to a set of values. Valid - operators are In, NotIn, Exists and - DoesNotExist. - type: string - values: - description: values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. - If the operator is Exists or DoesNotExist, - the values array must be empty. This - array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is - "In", and the values array contains only - "value". The requirements are ANDed. - type: object - type: object - name: - type: string - requeueAfterSeconds: - format: int64 - type: integer - template: - description: ApplicationSetTemplate represents - argocd ApplicationSpec - properties: - metadata: - description: ApplicationSetTemplateMeta represents - the Argo CD application fields that may - be used for Applications generated from - the ApplicationSet (based on metav1.ObjectMeta) - properties: - annotations: - additionalProperties: - type: string - type: object - labels: - additionalProperties: - type: string - type: object - name: - type: string - namespace: - type: string - type: object - spec: - description: ApplicationSpec represents desired - application state. Contains link to repository - with application definition and additional - parameters link definition revision. - properties: - destination: - description: Destination overrides the - kubernetes server and namespace defined - in the environment ksonnet app.yaml - properties: - name: - description: Name of the destination - cluster which can be used instead - of server (url) field - type: string - namespace: - description: Namespace overrides the - environment namespace value in the - ksonnet app.yaml - type: string - server: - description: Server overrides the - environment server value in the - ksonnet app.yaml - type: string - type: object - ignoreDifferences: - description: IgnoreDifferences controls - resources fields which should be ignored - during comparison - items: - description: ResourceIgnoreDifferences - contains resource filter and list - of json paths which should be ignored - during comparison with live state. - properties: - group: - type: string - jsonPointers: - items: - type: string - type: array - kind: - type: string - name: - type: string - namespace: - type: string - required: - - jsonPointers - - kind - type: object - type: array - info: - description: Infos contains a list of - useful information (URLs, email addresses, - and plain text) that relates to the - application - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - project: - description: Project is a application - project name. Empty name means that - application belongs to 'default' project. - type: string - revisionHistoryLimit: - description: This limits this number of - items kept in the apps revision history. - This should only be changed in exceptional - circumstances. Setting to zero will - store no history. This will reduce storage - used. Increasing will increase the space - used to store the history, so we do - not recommend increasing it. Default - is 10. - format: int64 - type: integer - source: - description: Source is a reference to - the location ksonnet application definition - properties: - chart: - description: Chart is a Helm chart - name - type: string - directory: - description: Directory holds path/directory - specific options - properties: - exclude: - type: string - jsonnet: - description: ApplicationSourceJsonnet - holds jsonnet specific options - properties: - extVars: - description: ExtVars is a - list of Jsonnet External - Variables - items: - description: JsonnetVar - is a jsonnet variable - properties: - code: - type: boolean - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - libs: - description: Additional library - search dirs - items: - type: string - type: array - tlas: - description: TLAS is a list - of Jsonnet Top-level Arguments - items: - description: JsonnetVar - is a jsonnet variable - properties: - code: - type: boolean - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - type: object - recurse: - type: boolean - type: object - helm: - description: Helm holds helm specific - options - properties: - fileParameters: - description: FileParameters are - file parameters to the helm - template - items: - description: HelmFileParameter - is a file parameter to a helm - template - properties: - name: - description: Name is the - name of the helm parameter - type: string - path: - description: Path is the - path value for the helm - parameter - type: string - type: object - type: array - parameters: - description: Parameters are parameters - to the helm template - items: - description: HelmParameter is - a parameter to a helm template - properties: - forceString: - description: ForceString - determines whether to - tell Helm to interpret - booleans and numbers as - strings - type: boolean - name: - description: Name is the - name of the helm parameter - type: string - value: - description: Value is the - value for the helm parameter - type: string - type: object - type: array - releaseName: - description: The Helm release - name. If omitted it will use - the application name - type: string - valueFiles: - description: ValuesFiles is a - list of Helm value files to - use when generating a template - items: - type: string - type: array - values: - description: Values is Helm values, - typically defined as a block - type: string - version: - description: Version is the Helm - version to use for templating - with - type: string - type: object - ksonnet: - description: Ksonnet holds ksonnet - specific options - properties: - environment: - description: Environment is a - ksonnet application environment - name - type: string - parameters: - description: Parameters are a - list of ksonnet component parameter - override values - items: - description: KsonnetParameter - is a ksonnet component parameter - properties: - component: - type: string - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - type: object - kustomize: - description: Kustomize holds kustomize - specific options - properties: - commonAnnotations: - additionalProperties: - type: string - description: CommonAnnotations - adds additional kustomize commonAnnotations - type: object - commonLabels: - additionalProperties: - type: string - description: CommonLabels adds - additional kustomize commonLabels - type: object - images: - description: Images are kustomize - image overrides - items: - type: string - type: array - namePrefix: - description: NamePrefix is a prefix - appended to resources for kustomize - apps - type: string - nameSuffix: - description: NameSuffix is a suffix - appended to resources for kustomize - apps - type: string - version: - description: Version contains - optional Kustomize version - type: string - type: object - path: - description: Path is a directory path - within the Git repository - type: string - plugin: - description: ConfigManagementPlugin - holds config management plugin specific - options - properties: - env: - items: - properties: - name: - description: the name, usually - uppercase - type: string - value: - description: the value - type: string - required: - - name - - value - type: object - type: array - name: - type: string - type: object - repoURL: - description: RepoURL is the repository - URL of the application manifests - type: string - targetRevision: - description: TargetRevision defines - the commit, tag, or branch in which - to sync the application to. If omitted, - will sync to HEAD - type: string - required: - - repoURL - type: object - syncPolicy: - description: SyncPolicy controls when - a sync will be performed - properties: - automated: - description: Automated will keep an - application synced to the target - revision - properties: - allowEmpty: - description: 'AllowEmpty allows - apps have zero live resources - (default: false)' - type: boolean - prune: - description: 'Prune will prune - resources automatically as part - of automated sync (default: - false)' - type: boolean - selfHeal: - description: 'SelfHeal enables - auto-syncing if (default: false)' - type: boolean - type: object - retry: - description: Retry controls failed - sync retry behavior - properties: - backoff: - description: Backoff is a backoff - strategy - properties: - duration: - description: Duration is the - amount to back off. Default - unit is seconds, but could - also be a duration (e.g. - "2m", "1h") - type: string - factor: - description: Factor is a factor - to multiply the base duration - after each failed retry - format: int64 - type: integer - maxDuration: - description: MaxDuration is - the maximum amount of time - allowed for the backoff - strategy - type: string - type: object - limit: - description: Limit is the maximum - number of attempts when retrying - a container - format: int64 - type: integer - type: object - syncOptions: - description: Options allow you to - specify whole app sync-options - items: - type: string - type: array - type: object - required: - - destination - - project - - source - type: object - required: - - metadata - - spec - type: object - values: - additionalProperties: - type: string - description: Values contains key/value pairs which - are passed directly as parameters to the template - type: object - required: - - configMapRef - type: object - clusters: - description: ClusterGenerator defines a generator - to match against clusters registered with ArgoCD. - properties: - selector: - description: Selector defines a label selector - to match against all clusters registered with - ArgoCD. Clusters today are stored as Kubernetes - Secrets, thus the Secret labels will be used - for matching the selector. - properties: - matchExpressions: - description: matchExpressions is a list of - label selector requirements. The requirements - are ANDed. - items: - description: A label selector requirement - is a selector that contains values, a - key, and an operator that relates the - key and values. - properties: - key: - description: key is the label key that - the selector applies to. - type: string - operator: - description: operator represents a key's - relationship to a set of values. Valid - operators are In, NotIn, Exists and - DoesNotExist. - type: string - values: - description: values is an array of string - values. If the operator is In or NotIn, - the values array must be non-empty. - If the operator is Exists or DoesNotExist, - the values array must be empty. This - array is replaced during a strategic - merge patch. - items: - type: string - type: array - required: - - key - - operator - type: object - type: array - matchLabels: - additionalProperties: - type: string - description: matchLabels is a map of {key,value} - pairs. A single {key,value} in the matchLabels - map is equivalent to an element of matchExpressions, - whose key field is "key", the operator is - "In", and the values array contains only - "value". The requirements are ANDed. - type: object - type: object - template: - description: ApplicationSetTemplate represents - argocd ApplicationSpec - properties: - metadata: - description: ApplicationSetTemplateMeta represents - the Argo CD application fields that may - be used for Applications generated from - the ApplicationSet (based on metav1.ObjectMeta) - properties: - annotations: - additionalProperties: - type: string - type: object - labels: - additionalProperties: - type: string - type: object - name: - type: string - namespace: - type: string - type: object - spec: - description: ApplicationSpec represents desired - application state. Contains link to repository - with application definition and additional - parameters link definition revision. - properties: - destination: - description: Destination overrides the - kubernetes server and namespace defined - in the environment ksonnet app.yaml - properties: - name: - description: Name of the destination - cluster which can be used instead - of server (url) field - type: string - namespace: - description: Namespace overrides the - environment namespace value in the - ksonnet app.yaml - type: string - server: - description: Server overrides the - environment server value in the - ksonnet app.yaml - type: string - type: object - ignoreDifferences: - description: IgnoreDifferences controls - resources fields which should be ignored - during comparison - items: - description: ResourceIgnoreDifferences - contains resource filter and list - of json paths which should be ignored - during comparison with live state. - properties: - group: - type: string - jsonPointers: - items: - type: string - type: array - kind: - type: string - name: - type: string - namespace: - type: string - required: - - jsonPointers - - kind - type: object - type: array - info: - description: Infos contains a list of - useful information (URLs, email addresses, - and plain text) that relates to the - application - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - project: - description: Project is a application - project name. Empty name means that - application belongs to 'default' project. - type: string - revisionHistoryLimit: - description: This limits this number of - items kept in the apps revision history. - This should only be changed in exceptional - circumstances. Setting to zero will - store no history. This will reduce storage - used. Increasing will increase the space - used to store the history, so we do - not recommend increasing it. Default - is 10. - format: int64 - type: integer - source: - description: Source is a reference to - the location ksonnet application definition - properties: - chart: - description: Chart is a Helm chart - name - type: string - directory: - description: Directory holds path/directory - specific options - properties: - exclude: - type: string - jsonnet: - description: ApplicationSourceJsonnet - holds jsonnet specific options - properties: - extVars: - description: ExtVars is a - list of Jsonnet External - Variables - items: - description: JsonnetVar - is a jsonnet variable - properties: - code: - type: boolean - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - libs: - description: Additional library - search dirs - items: - type: string - type: array - tlas: - description: TLAS is a list - of Jsonnet Top-level Arguments - items: - description: JsonnetVar - is a jsonnet variable - properties: - code: - type: boolean - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - type: object - recurse: - type: boolean - type: object - helm: - description: Helm holds helm specific - options - properties: - fileParameters: - description: FileParameters are - file parameters to the helm - template - items: - description: HelmFileParameter - is a file parameter to a helm - template - properties: - name: - description: Name is the - name of the helm parameter - type: string - path: - description: Path is the - path value for the helm - parameter - type: string - type: object - type: array - parameters: - description: Parameters are parameters - to the helm template - items: - description: HelmParameter is - a parameter to a helm template - properties: - forceString: - description: ForceString - determines whether to - tell Helm to interpret - booleans and numbers as - strings - type: boolean - name: - description: Name is the - name of the helm parameter - type: string - value: - description: Value is the - value for the helm parameter - type: string - type: object - type: array - releaseName: - description: The Helm release - name. If omitted it will use - the application name - type: string - valueFiles: - description: ValuesFiles is a - list of Helm value files to - use when generating a template - items: - type: string - type: array - values: - description: Values is Helm values, - typically defined as a block - type: string - version: - description: Version is the Helm - version to use for templating - with - type: string - type: object - ksonnet: - description: Ksonnet holds ksonnet - specific options - properties: - environment: - description: Environment is a - ksonnet application environment - name - type: string - parameters: - description: Parameters are a - list of ksonnet component parameter - override values - items: - description: KsonnetParameter - is a ksonnet component parameter - properties: - component: - type: string - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - type: object - kustomize: - description: Kustomize holds kustomize - specific options - properties: - commonAnnotations: - additionalProperties: - type: string - description: CommonAnnotations - adds additional kustomize commonAnnotations - type: object - commonLabels: - additionalProperties: - type: string - description: CommonLabels adds - additional kustomize commonLabels - type: object - images: - description: Images are kustomize - image overrides - items: - type: string - type: array - namePrefix: - description: NamePrefix is a prefix - appended to resources for kustomize - apps - type: string - nameSuffix: - description: NameSuffix is a suffix - appended to resources for kustomize - apps - type: string - version: - description: Version contains - optional Kustomize version - type: string - type: object - path: - description: Path is a directory path - within the Git repository - type: string - plugin: - description: ConfigManagementPlugin - holds config management plugin specific - options - properties: - env: - items: - properties: - name: - description: the name, usually - uppercase - type: string - value: - description: the value - type: string - required: - - name - - value - type: object - type: array - name: - type: string - type: object - repoURL: - description: RepoURL is the repository - URL of the application manifests - type: string - targetRevision: - description: TargetRevision defines - the commit, tag, or branch in which - to sync the application to. If omitted, - will sync to HEAD - type: string - required: - - repoURL - type: object - syncPolicy: - description: SyncPolicy controls when - a sync will be performed - properties: - automated: - description: Automated will keep an - application synced to the target - revision - properties: - allowEmpty: - description: 'AllowEmpty allows - apps have zero live resources - (default: false)' - type: boolean - prune: - description: 'Prune will prune - resources automatically as part - of automated sync (default: - false)' - type: boolean - selfHeal: - description: 'SelfHeal enables - auto-syncing if (default: false)' - type: boolean - type: object - retry: - description: Retry controls failed - sync retry behavior - properties: - backoff: - description: Backoff is a backoff - strategy - properties: - duration: - description: Duration is the - amount to back off. Default - unit is seconds, but could - also be a duration (e.g. - "2m", "1h") - type: string - factor: - description: Factor is a factor - to multiply the base duration - after each failed retry - format: int64 - type: integer - maxDuration: - description: MaxDuration is - the maximum amount of time - allowed for the backoff - strategy - type: string - type: object - limit: - description: Limit is the maximum - number of attempts when retrying - a container - format: int64 - type: integer - type: object - syncOptions: - description: Options allow you to - specify whole app sync-options - items: - type: string - type: array - type: object - required: - - destination - - project - - source - type: object - required: - - metadata - - spec - type: object - values: - additionalProperties: - type: string - description: Values contains key/value pairs which - are passed directly as parameters to the template - type: object - type: object - git: - properties: - directories: - items: - properties: - exclude: - type: boolean - path: - type: string - required: - - path - type: object - type: array - files: - items: - properties: - path: - type: string - required: - - path - type: object - type: array - repoURL: - type: string - requeueAfterSeconds: - format: int64 - type: integer - revision: - type: string - template: - description: ApplicationSetTemplate represents - argocd ApplicationSpec - properties: - metadata: - description: ApplicationSetTemplateMeta represents - the Argo CD application fields that may - be used for Applications generated from - the ApplicationSet (based on metav1.ObjectMeta) - properties: - annotations: - additionalProperties: - type: string - type: object - labels: - additionalProperties: - type: string - type: object - name: - type: string - namespace: - type: string - type: object - spec: - description: ApplicationSpec represents desired - application state. Contains link to repository - with application definition and additional - parameters link definition revision. - properties: - destination: - description: Destination overrides the - kubernetes server and namespace defined - in the environment ksonnet app.yaml - properties: - name: - description: Name of the destination - cluster which can be used instead - of server (url) field - type: string - namespace: - description: Namespace overrides the - environment namespace value in the - ksonnet app.yaml - type: string - server: - description: Server overrides the - environment server value in the - ksonnet app.yaml - type: string - type: object - ignoreDifferences: - description: IgnoreDifferences controls - resources fields which should be ignored - during comparison - items: - description: ResourceIgnoreDifferences - contains resource filter and list - of json paths which should be ignored - during comparison with live state. - properties: - group: - type: string - jsonPointers: - items: - type: string - type: array - kind: - type: string - name: - type: string - namespace: - type: string - required: - - jsonPointers - - kind - type: object - type: array - info: - description: Infos contains a list of - useful information (URLs, email addresses, - and plain text) that relates to the - application - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - project: - description: Project is a application - project name. Empty name means that - application belongs to 'default' project. - type: string - revisionHistoryLimit: - description: This limits this number of - items kept in the apps revision history. - This should only be changed in exceptional - circumstances. Setting to zero will - store no history. This will reduce storage - used. Increasing will increase the space - used to store the history, so we do - not recommend increasing it. Default - is 10. - format: int64 - type: integer - source: - description: Source is a reference to - the location ksonnet application definition - properties: - chart: - description: Chart is a Helm chart - name - type: string - directory: - description: Directory holds path/directory - specific options - properties: - exclude: - type: string - jsonnet: - description: ApplicationSourceJsonnet - holds jsonnet specific options - properties: - extVars: - description: ExtVars is a - list of Jsonnet External - Variables - items: - description: JsonnetVar - is a jsonnet variable - properties: - code: - type: boolean - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - libs: - description: Additional library - search dirs - items: - type: string - type: array - tlas: - description: TLAS is a list - of Jsonnet Top-level Arguments - items: - description: JsonnetVar - is a jsonnet variable - properties: - code: - type: boolean - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - type: object - recurse: - type: boolean - type: object - helm: - description: Helm holds helm specific - options - properties: - fileParameters: - description: FileParameters are - file parameters to the helm - template - items: - description: HelmFileParameter - is a file parameter to a helm - template - properties: - name: - description: Name is the - name of the helm parameter - type: string - path: - description: Path is the - path value for the helm - parameter - type: string - type: object - type: array - parameters: - description: Parameters are parameters - to the helm template - items: - description: HelmParameter is - a parameter to a helm template - properties: - forceString: - description: ForceString - determines whether to - tell Helm to interpret - booleans and numbers as - strings - type: boolean - name: - description: Name is the - name of the helm parameter - type: string - value: - description: Value is the - value for the helm parameter - type: string - type: object - type: array - releaseName: - description: The Helm release - name. If omitted it will use - the application name - type: string - valueFiles: - description: ValuesFiles is a - list of Helm value files to - use when generating a template - items: - type: string - type: array - values: - description: Values is Helm values, - typically defined as a block - type: string - version: - description: Version is the Helm - version to use for templating - with - type: string - type: object - ksonnet: - description: Ksonnet holds ksonnet - specific options - properties: - environment: - description: Environment is a - ksonnet application environment - name - type: string - parameters: - description: Parameters are a - list of ksonnet component parameter - override values - items: - description: KsonnetParameter - is a ksonnet component parameter - properties: - component: - type: string - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - type: object - kustomize: - description: Kustomize holds kustomize - specific options - properties: - commonAnnotations: - additionalProperties: - type: string - description: CommonAnnotations - adds additional kustomize commonAnnotations - type: object - commonLabels: - additionalProperties: - type: string - description: CommonLabels adds - additional kustomize commonLabels - type: object - images: - description: Images are kustomize - image overrides - items: - type: string - type: array - namePrefix: - description: NamePrefix is a prefix - appended to resources for kustomize - apps - type: string - nameSuffix: - description: NameSuffix is a suffix - appended to resources for kustomize - apps - type: string - version: - description: Version contains - optional Kustomize version - type: string - type: object - path: - description: Path is a directory path - within the Git repository - type: string - plugin: - description: ConfigManagementPlugin - holds config management plugin specific - options - properties: - env: - items: - properties: - name: - description: the name, usually - uppercase - type: string - value: - description: the value - type: string - required: - - name - - value - type: object - type: array - name: - type: string - type: object - repoURL: - description: RepoURL is the repository - URL of the application manifests - type: string - targetRevision: - description: TargetRevision defines - the commit, tag, or branch in which - to sync the application to. If omitted, - will sync to HEAD - type: string - required: - - repoURL - type: object - syncPolicy: - description: SyncPolicy controls when - a sync will be performed - properties: - automated: - description: Automated will keep an - application synced to the target - revision - properties: - allowEmpty: - description: 'AllowEmpty allows - apps have zero live resources - (default: false)' - type: boolean - prune: - description: 'Prune will prune - resources automatically as part - of automated sync (default: - false)' - type: boolean - selfHeal: - description: 'SelfHeal enables - auto-syncing if (default: false)' - type: boolean - type: object - retry: - description: Retry controls failed - sync retry behavior - properties: - backoff: - description: Backoff is a backoff - strategy - properties: - duration: - description: Duration is the - amount to back off. Default - unit is seconds, but could - also be a duration (e.g. - "2m", "1h") - type: string - factor: - description: Factor is a factor - to multiply the base duration - after each failed retry - format: int64 - type: integer - maxDuration: - description: MaxDuration is - the maximum amount of time - allowed for the backoff - strategy - type: string - type: object - limit: - description: Limit is the maximum - number of attempts when retrying - a container - format: int64 - type: integer - type: object - syncOptions: - description: Options allow you to - specify whole app sync-options - items: - type: string - type: array - type: object - required: - - destination - - project - - source - type: object - required: - - metadata - - spec - type: object - required: - - repoURL - - revision - type: object - list: - description: ListGenerator include items info - properties: - elements: - items: - description: ListGeneratorElement include cluster - and url info - properties: - cluster: - type: string - url: - type: string - values: - additionalProperties: - type: string - description: Values contains key/value pairs - which are passed directly as parameters - to the template - type: object - required: - - cluster - - url - type: object - type: array - template: - description: ApplicationSetTemplate represents - argocd ApplicationSpec - properties: - metadata: - description: ApplicationSetTemplateMeta represents - the Argo CD application fields that may - be used for Applications generated from - the ApplicationSet (based on metav1.ObjectMeta) - properties: - annotations: - additionalProperties: - type: string - type: object - labels: - additionalProperties: - type: string - type: object - name: - type: string - namespace: - type: string - type: object - spec: - description: ApplicationSpec represents desired - application state. Contains link to repository - with application definition and additional - parameters link definition revision. - properties: - destination: - description: Destination overrides the - kubernetes server and namespace defined - in the environment ksonnet app.yaml - properties: - name: - description: Name of the destination - cluster which can be used instead - of server (url) field - type: string - namespace: - description: Namespace overrides the - environment namespace value in the - ksonnet app.yaml - type: string - server: - description: Server overrides the - environment server value in the - ksonnet app.yaml - type: string - type: object - ignoreDifferences: - description: IgnoreDifferences controls - resources fields which should be ignored - during comparison - items: - description: ResourceIgnoreDifferences - contains resource filter and list - of json paths which should be ignored - during comparison with live state. - properties: - group: - type: string - jsonPointers: - items: - type: string - type: array - kind: - type: string - name: - type: string - namespace: - type: string - required: - - jsonPointers - - kind - type: object - type: array - info: - description: Infos contains a list of - useful information (URLs, email addresses, - and plain text) that relates to the - application - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - project: - description: Project is a application - project name. Empty name means that - application belongs to 'default' project. - type: string - revisionHistoryLimit: - description: This limits this number of - items kept in the apps revision history. - This should only be changed in exceptional - circumstances. Setting to zero will - store no history. This will reduce storage - used. Increasing will increase the space - used to store the history, so we do - not recommend increasing it. Default - is 10. - format: int64 - type: integer - source: - description: Source is a reference to - the location ksonnet application definition - properties: - chart: - description: Chart is a Helm chart - name - type: string - directory: - description: Directory holds path/directory - specific options - properties: - exclude: - type: string - jsonnet: - description: ApplicationSourceJsonnet - holds jsonnet specific options - properties: - extVars: - description: ExtVars is a - list of Jsonnet External - Variables - items: - description: JsonnetVar - is a jsonnet variable - properties: - code: - type: boolean - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - libs: - description: Additional library - search dirs - items: - type: string - type: array - tlas: - description: TLAS is a list - of Jsonnet Top-level Arguments - items: - description: JsonnetVar - is a jsonnet variable - properties: - code: - type: boolean - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - type: object - recurse: - type: boolean - type: object - helm: - description: Helm holds helm specific - options - properties: - fileParameters: - description: FileParameters are - file parameters to the helm - template - items: - description: HelmFileParameter - is a file parameter to a helm - template - properties: - name: - description: Name is the - name of the helm parameter - type: string - path: - description: Path is the - path value for the helm - parameter - type: string - type: object - type: array - parameters: - description: Parameters are parameters - to the helm template - items: - description: HelmParameter is - a parameter to a helm template - properties: - forceString: - description: ForceString - determines whether to - tell Helm to interpret - booleans and numbers as - strings - type: boolean - name: - description: Name is the - name of the helm parameter - type: string - value: - description: Value is the - value for the helm parameter - type: string - type: object - type: array - releaseName: - description: The Helm release - name. If omitted it will use - the application name - type: string - valueFiles: - description: ValuesFiles is a - list of Helm value files to - use when generating a template - items: - type: string - type: array - values: - description: Values is Helm values, - typically defined as a block - type: string - version: - description: Version is the Helm - version to use for templating - with - type: string - type: object - ksonnet: - description: Ksonnet holds ksonnet - specific options - properties: - environment: - description: Environment is a - ksonnet application environment - name - type: string - parameters: - description: Parameters are a - list of ksonnet component parameter - override values - items: - description: KsonnetParameter - is a ksonnet component parameter - properties: - component: - type: string - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - type: object - kustomize: - description: Kustomize holds kustomize - specific options - properties: - commonAnnotations: - additionalProperties: - type: string - description: CommonAnnotations - adds additional kustomize commonAnnotations - type: object - commonLabels: - additionalProperties: - type: string - description: CommonLabels adds - additional kustomize commonLabels - type: object - images: - description: Images are kustomize - image overrides - items: - type: string - type: array - namePrefix: - description: NamePrefix is a prefix - appended to resources for kustomize - apps - type: string - nameSuffix: - description: NameSuffix is a suffix - appended to resources for kustomize - apps - type: string - version: - description: Version contains - optional Kustomize version - type: string - type: object - path: - description: Path is a directory path - within the Git repository - type: string - plugin: - description: ConfigManagementPlugin - holds config management plugin specific - options - properties: - env: - items: - properties: - name: - description: the name, usually - uppercase - type: string - value: - description: the value - type: string - required: - - name - - value - type: object - type: array - name: - type: string - type: object - repoURL: - description: RepoURL is the repository - URL of the application manifests - type: string - targetRevision: - description: TargetRevision defines - the commit, tag, or branch in which - to sync the application to. If omitted, - will sync to HEAD - type: string - required: - - repoURL - type: object - syncPolicy: - description: SyncPolicy controls when - a sync will be performed - properties: - automated: - description: Automated will keep an - application synced to the target - revision - properties: - allowEmpty: - description: 'AllowEmpty allows - apps have zero live resources - (default: false)' - type: boolean - prune: - description: 'Prune will prune - resources automatically as part - of automated sync (default: - false)' - type: boolean - selfHeal: - description: 'SelfHeal enables - auto-syncing if (default: false)' - type: boolean - type: object - retry: - description: Retry controls failed - sync retry behavior - properties: - backoff: - description: Backoff is a backoff - strategy - properties: - duration: - description: Duration is the - amount to back off. Default - unit is seconds, but could - also be a duration (e.g. - "2m", "1h") - type: string - factor: - description: Factor is a factor - to multiply the base duration - after each failed retry - format: int64 - type: integer - maxDuration: - description: MaxDuration is - the maximum amount of time - allowed for the backoff - strategy - type: string - type: object - limit: - description: Limit is the maximum - number of attempts when retrying - a container - format: int64 - type: integer - type: object - syncOptions: - description: Options allow you to - specify whole app sync-options - items: - type: string - type: array - type: object - required: - - destination - - project - - source - type: object - required: - - metadata - - spec - type: object - required: - - elements - type: object - scmProvider: - description: SCMProviderGenerator defines a generator - that scrapes a SCMaaS API to find candidate repos. - properties: - cloneProtocol: - description: Which protocol to use for the SCM - URL. Default is provider-specific but ssh if - possible. Not all providers necessarily support - all protocols. - type: string - filters: - description: TODO other providers. Filters for - which repos should be considered. - items: - description: SCMProviderGeneratorFilter is a - single repository filter. If multiple filter - types are set on a single struct, they will - be AND'd together. All filters must pass for - a repo to be included. - properties: - branchMatch: - description: A regex which must match the - branch name. - type: string - labelMatch: - description: A regex which must match at - least one label. - type: string - pathsExist: - description: An array of paths, all of which - must exist. - items: - type: string - type: array - repositoryMatch: - description: A regex for repo names. - type: string - type: object - type: array - github: - description: Which provider to use and config - for it. - properties: - allBranches: - description: Scan all branches instead of - just the default branch. - type: boolean - api: - description: The GitHub API URL to talk to. - If blank, use https://api.github.com/. - type: string - organization: - description: GitHub org to scan. Required. - type: string - tokenRef: - description: Authentication token reference. - properties: - key: - type: string - secretName: - type: string - required: - - key - - secretName - type: object - required: - - organization - type: object - requeueAfterSeconds: - description: Standard parameters. - format: int64 - type: integer - template: - description: ApplicationSetTemplate represents - argocd ApplicationSpec - properties: - metadata: - description: ApplicationSetTemplateMeta represents - the Argo CD application fields that may - be used for Applications generated from - the ApplicationSet (based on metav1.ObjectMeta) - properties: - annotations: - additionalProperties: - type: string - type: object - labels: - additionalProperties: - type: string - type: object - name: - type: string - namespace: - type: string - type: object - spec: - description: ApplicationSpec represents desired - application state. Contains link to repository - with application definition and additional - parameters link definition revision. - properties: - destination: - description: Destination overrides the - kubernetes server and namespace defined - in the environment ksonnet app.yaml - properties: - name: - description: Name of the destination - cluster which can be used instead - of server (url) field - type: string - namespace: - description: Namespace overrides the - environment namespace value in the - ksonnet app.yaml - type: string - server: - description: Server overrides the - environment server value in the - ksonnet app.yaml - type: string - type: object - ignoreDifferences: - description: IgnoreDifferences controls - resources fields which should be ignored - during comparison - items: - description: ResourceIgnoreDifferences - contains resource filter and list - of json paths which should be ignored - during comparison with live state. - properties: - group: - type: string - jsonPointers: - items: - type: string - type: array - kind: - type: string - name: - type: string - namespace: - type: string - required: - - jsonPointers - - kind - type: object - type: array - info: - description: Infos contains a list of - useful information (URLs, email addresses, - and plain text) that relates to the - application - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - project: - description: Project is a application - project name. Empty name means that - application belongs to 'default' project. - type: string - revisionHistoryLimit: - description: This limits this number of - items kept in the apps revision history. - This should only be changed in exceptional - circumstances. Setting to zero will - store no history. This will reduce storage - used. Increasing will increase the space - used to store the history, so we do - not recommend increasing it. Default - is 10. - format: int64 - type: integer - source: - description: Source is a reference to - the location ksonnet application definition - properties: - chart: - description: Chart is a Helm chart - name - type: string - directory: - description: Directory holds path/directory - specific options - properties: - exclude: - type: string - jsonnet: - description: ApplicationSourceJsonnet - holds jsonnet specific options - properties: - extVars: - description: ExtVars is a - list of Jsonnet External - Variables - items: - description: JsonnetVar - is a jsonnet variable - properties: - code: - type: boolean - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - libs: - description: Additional library - search dirs - items: - type: string - type: array - tlas: - description: TLAS is a list - of Jsonnet Top-level Arguments - items: - description: JsonnetVar - is a jsonnet variable - properties: - code: - type: boolean - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - type: object - recurse: - type: boolean - type: object - helm: - description: Helm holds helm specific - options - properties: - fileParameters: - description: FileParameters are - file parameters to the helm - template - items: - description: HelmFileParameter - is a file parameter to a helm - template - properties: - name: - description: Name is the - name of the helm parameter - type: string - path: - description: Path is the - path value for the helm - parameter - type: string - type: object - type: array - parameters: - description: Parameters are parameters - to the helm template - items: - description: HelmParameter is - a parameter to a helm template - properties: - forceString: - description: ForceString - determines whether to - tell Helm to interpret - booleans and numbers as - strings - type: boolean - name: - description: Name is the - name of the helm parameter - type: string - value: - description: Value is the - value for the helm parameter - type: string - type: object - type: array - releaseName: - description: The Helm release - name. If omitted it will use - the application name - type: string - valueFiles: - description: ValuesFiles is a - list of Helm value files to - use when generating a template - items: - type: string - type: array - values: - description: Values is Helm values, - typically defined as a block - type: string - version: - description: Version is the Helm - version to use for templating - with - type: string - type: object - ksonnet: - description: Ksonnet holds ksonnet - specific options - properties: - environment: - description: Environment is a - ksonnet application environment - name - type: string - parameters: - description: Parameters are a - list of ksonnet component parameter - override values - items: - description: KsonnetParameter - is a ksonnet component parameter - properties: - component: - type: string - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - type: object - kustomize: - description: Kustomize holds kustomize - specific options - properties: - commonAnnotations: - additionalProperties: - type: string - description: CommonAnnotations - adds additional kustomize commonAnnotations - type: object - commonLabels: - additionalProperties: - type: string - description: CommonLabels adds - additional kustomize commonLabels - type: object - images: - description: Images are kustomize - image overrides - items: - type: string - type: array - namePrefix: - description: NamePrefix is a prefix - appended to resources for kustomize - apps - type: string - nameSuffix: - description: NameSuffix is a suffix - appended to resources for kustomize - apps - type: string - version: - description: Version contains - optional Kustomize version - type: string - type: object - path: - description: Path is a directory path - within the Git repository - type: string - plugin: - description: ConfigManagementPlugin - holds config management plugin specific - options - properties: - env: - items: - properties: - name: - description: the name, usually - uppercase - type: string - value: - description: the value - type: string - required: - - name - - value - type: object - type: array - name: - type: string - type: object - repoURL: - description: RepoURL is the repository - URL of the application manifests - type: string - targetRevision: - description: TargetRevision defines - the commit, tag, or branch in which - to sync the application to. If omitted, - will sync to HEAD - type: string - required: - - repoURL - type: object - syncPolicy: - description: SyncPolicy controls when - a sync will be performed - properties: - automated: - description: Automated will keep an - application synced to the target - revision - properties: - allowEmpty: - description: 'AllowEmpty allows - apps have zero live resources - (default: false)' - type: boolean - prune: - description: 'Prune will prune - resources automatically as part - of automated sync (default: - false)' - type: boolean - selfHeal: - description: 'SelfHeal enables - auto-syncing if (default: false)' - type: boolean - type: object - retry: - description: Retry controls failed - sync retry behavior - properties: - backoff: - description: Backoff is a backoff - strategy - properties: - duration: - description: Duration is the - amount to back off. Default - unit is seconds, but could - also be a duration (e.g. - "2m", "1h") - type: string - factor: - description: Factor is a factor - to multiply the base duration - after each failed retry - format: int64 - type: integer - maxDuration: - description: MaxDuration is - the maximum amount of time - allowed for the backoff - strategy - type: string - type: object - limit: - description: Limit is the maximum - number of attempts when retrying - a container - format: int64 - type: integer - type: object - syncOptions: - description: Options allow you to - specify whole app sync-options - items: - type: string - type: array - type: object - required: - - destination - - project - - source - type: object - required: - - metadata - - spec - type: object - type: object - type: object - type: array - template: - description: ApplicationSetTemplate represents argocd ApplicationSpec - properties: - metadata: - description: ApplicationSetTemplateMeta represents the - Argo CD application fields that may be used for Applications - generated from the ApplicationSet (based on metav1.ObjectMeta) - properties: - annotations: - additionalProperties: - type: string - type: object - labels: - additionalProperties: - type: string - type: object - name: - type: string - namespace: - type: string - type: object - spec: - description: ApplicationSpec represents desired application - state. Contains link to repository with application - definition and additional parameters link definition - revision. - properties: - destination: - description: Destination overrides the kubernetes - server and namespace defined in the environment - ksonnet app.yaml - properties: - name: - description: Name of the destination cluster - which can be used instead of server (url) - field - type: string - namespace: - description: Namespace overrides the environment - namespace value in the ksonnet app.yaml - type: string - server: - description: Server overrides the environment - server value in the ksonnet app.yaml - type: string - type: object - ignoreDifferences: - description: IgnoreDifferences controls resources - fields which should be ignored during comparison - items: - description: ResourceIgnoreDifferences contains - resource filter and list of json paths which - should be ignored during comparison with live - state. - properties: - group: - type: string - jsonPointers: - items: - type: string - type: array - kind: - type: string - name: - type: string - namespace: - type: string - required: - - jsonPointers - - kind - type: object - type: array - info: - description: Infos contains a list of useful information - (URLs, email addresses, and plain text) that relates - to the application - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - project: - description: Project is a application project name. - Empty name means that application belongs to 'default' - project. - type: string - revisionHistoryLimit: - description: This limits this number of items kept - in the apps revision history. This should only - be changed in exceptional circumstances. Setting - to zero will store no history. This will reduce - storage used. Increasing will increase the space - used to store the history, so we do not recommend - increasing it. Default is 10. - format: int64 - type: integer - source: - description: Source is a reference to the location - ksonnet application definition - properties: - chart: - description: Chart is a Helm chart name - type: string - directory: - description: Directory holds path/directory - specific options - properties: - exclude: - type: string - jsonnet: - description: ApplicationSourceJsonnet holds - jsonnet specific options - properties: - extVars: - description: ExtVars is a list of Jsonnet - External Variables - items: - description: JsonnetVar is a jsonnet - variable - properties: - code: - type: boolean - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - libs: - description: Additional library search - dirs - items: - type: string - type: array - tlas: - description: TLAS is a list of Jsonnet - Top-level Arguments - items: - description: JsonnetVar is a jsonnet - variable - properties: - code: - type: boolean - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - type: object - recurse: - type: boolean - type: object - helm: - description: Helm holds helm specific options - properties: - fileParameters: - description: FileParameters are file parameters - to the helm template - items: - description: HelmFileParameter is a file - parameter to a helm template - properties: - name: - description: Name is the name of the - helm parameter - type: string - path: - description: Path is the path value - for the helm parameter - type: string - type: object - type: array - parameters: - description: Parameters are parameters to - the helm template - items: - description: HelmParameter is a parameter - to a helm template - properties: - forceString: - description: ForceString determines - whether to tell Helm to interpret - booleans and numbers as strings - type: boolean - name: - description: Name is the name of the - helm parameter - type: string - value: - description: Value is the value for - the helm parameter - type: string - type: object - type: array - releaseName: - description: The Helm release name. If omitted - it will use the application name - type: string - valueFiles: - description: ValuesFiles is a list of Helm - value files to use when generating a template - items: - type: string - type: array - values: - description: Values is Helm values, typically - defined as a block - type: string - version: - description: Version is the Helm version - to use for templating with - type: string - type: object - ksonnet: - description: Ksonnet holds ksonnet specific - options - properties: - environment: - description: Environment is a ksonnet application - environment name - type: string - parameters: - description: Parameters are a list of ksonnet - component parameter override values - items: - description: KsonnetParameter is a ksonnet - component parameter - properties: - component: - type: string - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - type: object - kustomize: - description: Kustomize holds kustomize specific - options - properties: - commonAnnotations: - additionalProperties: - type: string - description: CommonAnnotations adds additional - kustomize commonAnnotations - type: object - commonLabels: - additionalProperties: - type: string - description: CommonLabels adds additional - kustomize commonLabels - type: object - images: - description: Images are kustomize image - overrides - items: - type: string - type: array - namePrefix: - description: NamePrefix is a prefix appended - to resources for kustomize apps - type: string - nameSuffix: - description: NameSuffix is a suffix appended - to resources for kustomize apps - type: string - version: - description: Version contains optional Kustomize - version - type: string - type: object - path: - description: Path is a directory path within - the Git repository - type: string - plugin: - description: ConfigManagementPlugin holds config - management plugin specific options - properties: - env: - items: - properties: - name: - description: the name, usually uppercase - type: string - value: - description: the value - type: string - required: - - name - - value - type: object - type: array - name: - type: string - type: object - repoURL: - description: RepoURL is the repository URL of - the application manifests - type: string - targetRevision: - description: TargetRevision defines the commit, - tag, or branch in which to sync the application - to. If omitted, will sync to HEAD - type: string - required: - - repoURL - type: object - syncPolicy: - description: SyncPolicy controls when a sync will - be performed - properties: - automated: - description: Automated will keep an application - synced to the target revision - properties: - allowEmpty: - description: 'AllowEmpty allows apps have - zero live resources (default: false)' - type: boolean - prune: - description: 'Prune will prune resources - automatically as part of automated sync - (default: false)' - type: boolean - selfHeal: - description: 'SelfHeal enables auto-syncing - if (default: false)' - type: boolean - type: object - retry: - description: Retry controls failed sync retry - behavior - properties: - backoff: - description: Backoff is a backoff strategy - properties: - duration: - description: Duration is the amount - to back off. Default unit is seconds, - but could also be a duration (e.g. - "2m", "1h") - type: string - factor: - description: Factor is a factor to multiply - the base duration after each failed - retry - format: int64 - type: integer - maxDuration: - description: MaxDuration is the maximum - amount of time allowed for the backoff - strategy - type: string - type: object - limit: - description: Limit is the maximum number - of attempts when retrying a container - format: int64 - type: integer - type: object - syncOptions: - description: Options allow you to specify whole - app sync-options - items: - type: string - type: array - type: object - required: - - destination - - project - - source - type: object - required: - - metadata - - spec - type: object - required: - - generators - type: object - scmProvider: - description: SCMProviderGenerator defines a generator that scrapes - a SCMaaS API to find candidate repos. - properties: - cloneProtocol: - description: Which protocol to use for the SCM URL. Default - is provider-specific but ssh if possible. Not all providers - necessarily support all protocols. - type: string - filters: - description: TODO other providers. Filters for which repos - should be considered. - items: - description: SCMProviderGeneratorFilter is a single repository - filter. If multiple filter types are set on a single - struct, they will be AND'd together. All filters must - pass for a repo to be included. - properties: - branchMatch: - description: A regex which must match the branch name. - type: string - labelMatch: - description: A regex which must match at least one - label. - type: string - pathsExist: - description: An array of paths, all of which must - exist. - items: - type: string - type: array - repositoryMatch: - description: A regex for repo names. - type: string - type: object - type: array - github: - description: Which provider to use and config for it. - properties: - allBranches: - description: Scan all branches instead of just the default - branch. - type: boolean - api: - description: The GitHub API URL to talk to. If blank, - use https://api.github.com/. - type: string - organization: - description: GitHub org to scan. Required. - type: string - tokenRef: - description: Authentication token reference. - properties: - key: - type: string - secretName: - type: string - required: - - key - - secretName - type: object - required: - - organization - type: object - requeueAfterSeconds: - description: Standard parameters. - format: int64 - type: integer - template: - description: ApplicationSetTemplate represents argocd ApplicationSpec - properties: - metadata: - description: ApplicationSetTemplateMeta represents the - Argo CD application fields that may be used for Applications - generated from the ApplicationSet (based on metav1.ObjectMeta) - properties: - annotations: - additionalProperties: - type: string - type: object - labels: - additionalProperties: - type: string - type: object - name: - type: string - namespace: - type: string - type: object - spec: - description: ApplicationSpec represents desired application - state. Contains link to repository with application - definition and additional parameters link definition - revision. - properties: - destination: - description: Destination overrides the kubernetes - server and namespace defined in the environment - ksonnet app.yaml - properties: - name: - description: Name of the destination cluster - which can be used instead of server (url) - field - type: string - namespace: - description: Namespace overrides the environment - namespace value in the ksonnet app.yaml - type: string - server: - description: Server overrides the environment - server value in the ksonnet app.yaml - type: string - type: object - ignoreDifferences: - description: IgnoreDifferences controls resources - fields which should be ignored during comparison - items: - description: ResourceIgnoreDifferences contains - resource filter and list of json paths which - should be ignored during comparison with live - state. - properties: - group: - type: string - jsonPointers: - items: - type: string - type: array - kind: - type: string - name: - type: string - namespace: - type: string - required: - - jsonPointers - - kind - type: object - type: array - info: - description: Infos contains a list of useful information - (URLs, email addresses, and plain text) that relates - to the application - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - project: - description: Project is a application project name. - Empty name means that application belongs to 'default' - project. - type: string - revisionHistoryLimit: - description: This limits this number of items kept - in the apps revision history. This should only - be changed in exceptional circumstances. Setting - to zero will store no history. This will reduce - storage used. Increasing will increase the space - used to store the history, so we do not recommend - increasing it. Default is 10. - format: int64 - type: integer - source: - description: Source is a reference to the location - ksonnet application definition - properties: - chart: - description: Chart is a Helm chart name - type: string - directory: - description: Directory holds path/directory - specific options - properties: - exclude: - type: string - jsonnet: - description: ApplicationSourceJsonnet holds - jsonnet specific options - properties: - extVars: - description: ExtVars is a list of Jsonnet - External Variables - items: - description: JsonnetVar is a jsonnet - variable - properties: - code: - type: boolean - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - libs: - description: Additional library search - dirs - items: - type: string - type: array - tlas: - description: TLAS is a list of Jsonnet - Top-level Arguments - items: - description: JsonnetVar is a jsonnet - variable - properties: - code: - type: boolean - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - type: object - recurse: - type: boolean - type: object - helm: - description: Helm holds helm specific options - properties: - fileParameters: - description: FileParameters are file parameters - to the helm template - items: - description: HelmFileParameter is a file - parameter to a helm template - properties: - name: - description: Name is the name of the - helm parameter - type: string - path: - description: Path is the path value - for the helm parameter - type: string - type: object - type: array - parameters: - description: Parameters are parameters to - the helm template - items: - description: HelmParameter is a parameter - to a helm template - properties: - forceString: - description: ForceString determines - whether to tell Helm to interpret - booleans and numbers as strings - type: boolean - name: - description: Name is the name of the - helm parameter - type: string - value: - description: Value is the value for - the helm parameter - type: string - type: object - type: array - releaseName: - description: The Helm release name. If omitted - it will use the application name - type: string - valueFiles: - description: ValuesFiles is a list of Helm - value files to use when generating a template - items: - type: string - type: array - values: - description: Values is Helm values, typically - defined as a block - type: string - version: - description: Version is the Helm version - to use for templating with - type: string - type: object - ksonnet: - description: Ksonnet holds ksonnet specific - options - properties: - environment: - description: Environment is a ksonnet application - environment name - type: string - parameters: - description: Parameters are a list of ksonnet - component parameter override values - items: - description: KsonnetParameter is a ksonnet - component parameter - properties: - component: - type: string - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - type: object - kustomize: - description: Kustomize holds kustomize specific - options - properties: - commonAnnotations: - additionalProperties: - type: string - description: CommonAnnotations adds additional - kustomize commonAnnotations - type: object - commonLabels: - additionalProperties: - type: string - description: CommonLabels adds additional - kustomize commonLabels - type: object - images: - description: Images are kustomize image - overrides - items: - type: string - type: array - namePrefix: - description: NamePrefix is a prefix appended - to resources for kustomize apps - type: string - nameSuffix: - description: NameSuffix is a suffix appended - to resources for kustomize apps - type: string - version: - description: Version contains optional Kustomize - version - type: string - type: object - path: - description: Path is a directory path within - the Git repository - type: string - plugin: - description: ConfigManagementPlugin holds config - management plugin specific options - properties: - env: - items: - properties: - name: - description: the name, usually uppercase - type: string - value: - description: the value - type: string - required: - - name - - value - type: object - type: array - name: - type: string - type: object - repoURL: - description: RepoURL is the repository URL of - the application manifests - type: string - targetRevision: - description: TargetRevision defines the commit, - tag, or branch in which to sync the application - to. If omitted, will sync to HEAD - type: string - required: - - repoURL - type: object - syncPolicy: - description: SyncPolicy controls when a sync will - be performed - properties: - automated: - description: Automated will keep an application - synced to the target revision - properties: - allowEmpty: - description: 'AllowEmpty allows apps have - zero live resources (default: false)' - type: boolean - prune: - description: 'Prune will prune resources - automatically as part of automated sync - (default: false)' - type: boolean - selfHeal: - description: 'SelfHeal enables auto-syncing - if (default: false)' - type: boolean - type: object - retry: - description: Retry controls failed sync retry - behavior - properties: - backoff: - description: Backoff is a backoff strategy - properties: - duration: - description: Duration is the amount - to back off. Default unit is seconds, - but could also be a duration (e.g. - "2m", "1h") - type: string - factor: - description: Factor is a factor to multiply - the base duration after each failed - retry - format: int64 - type: integer - maxDuration: - description: MaxDuration is the maximum - amount of time allowed for the backoff - strategy - type: string - type: object - limit: - description: Limit is the maximum number - of attempts when retrying a container - format: int64 - type: integer - type: object - syncOptions: - description: Options allow you to specify whole - app sync-options - items: - type: string - type: array - type: object - required: - - destination - - project - - source - type: object - required: - - metadata - - spec - type: object - type: object - type: object - type: array - syncPolicy: - description: ApplicationSetSyncPolicy configures how generated Applications - will relate to their ApplicationSet. - properties: - preserveResourcesOnDeletion: - description: PreserveResourcesOnDeletion will preserve resources - on deletion. If PreserveResourcesOnDeletion is set to true, - these Applications will not be deleted. - type: boolean - type: object - template: - description: ApplicationSetTemplate represents argocd ApplicationSpec - properties: - metadata: - description: ApplicationSetTemplateMeta represents the Argo CD - application fields that may be used for Applications generated - from the ApplicationSet (based on metav1.ObjectMeta) - properties: - annotations: - additionalProperties: - type: string - type: object - labels: - additionalProperties: - type: string - type: object - name: - type: string - namespace: - type: string - type: object - spec: - description: ApplicationSpec represents desired application state. - Contains link to repository with application definition and - additional parameters link definition revision. - properties: - destination: - description: Destination overrides the kubernetes server and - namespace defined in the environment ksonnet app.yaml - properties: - name: - description: Name of the destination cluster which can - be used instead of server (url) field - type: string - namespace: - description: Namespace overrides the environment namespace - value in the ksonnet app.yaml - type: string - server: - description: Server overrides the environment server value - in the ksonnet app.yaml - type: string - type: object - ignoreDifferences: - description: IgnoreDifferences controls resources fields which - should be ignored during comparison - items: - description: ResourceIgnoreDifferences contains resource - filter and list of json paths which should be ignored - during comparison with live state. - properties: - group: - type: string - jsonPointers: - items: - type: string - type: array - kind: - type: string - name: - type: string - namespace: - type: string - required: - - jsonPointers - - kind - type: object - type: array - info: - description: Infos contains a list of useful information (URLs, - email addresses, and plain text) that relates to the application - items: - properties: - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - project: - description: Project is a application project name. Empty - name means that application belongs to 'default' project. - type: string - revisionHistoryLimit: - description: This limits this number of items kept in the - apps revision history. This should only be changed in exceptional - circumstances. Setting to zero will store no history. This - will reduce storage used. Increasing will increase the space - used to store the history, so we do not recommend increasing - it. Default is 10. - format: int64 - type: integer - source: - description: Source is a reference to the location ksonnet - application definition - properties: - chart: - description: Chart is a Helm chart name - type: string - directory: - description: Directory holds path/directory specific options - properties: - exclude: - type: string - jsonnet: - description: ApplicationSourceJsonnet holds jsonnet - specific options - properties: - extVars: - description: ExtVars is a list of Jsonnet External - Variables - items: - description: JsonnetVar is a jsonnet variable - properties: - code: - type: boolean - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - libs: - description: Additional library search dirs - items: - type: string - type: array - tlas: - description: TLAS is a list of Jsonnet Top-level - Arguments - items: - description: JsonnetVar is a jsonnet variable - properties: - code: - type: boolean - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - type: object - recurse: - type: boolean - type: object - helm: - description: Helm holds helm specific options - properties: - fileParameters: - description: FileParameters are file parameters to - the helm template - items: - description: HelmFileParameter is a file parameter - to a helm template - properties: - name: - description: Name is the name of the helm parameter - type: string - path: - description: Path is the path value for the - helm parameter - type: string - type: object - type: array - parameters: - description: Parameters are parameters to the helm - template - items: - description: HelmParameter is a parameter to a helm - template - properties: - forceString: - description: ForceString determines whether - to tell Helm to interpret booleans and numbers - as strings - type: boolean - name: - description: Name is the name of the helm parameter - type: string - value: - description: Value is the value for the helm - parameter - type: string - type: object - type: array - releaseName: - description: The Helm release name. If omitted it - will use the application name - type: string - valueFiles: - description: ValuesFiles is a list of Helm value files - to use when generating a template - items: - type: string - type: array - values: - description: Values is Helm values, typically defined - as a block - type: string - version: - description: Version is the Helm version to use for - templating with - type: string - type: object - ksonnet: - description: Ksonnet holds ksonnet specific options - properties: - environment: - description: Environment is a ksonnet application - environment name - type: string - parameters: - description: Parameters are a list of ksonnet component - parameter override values - items: - description: KsonnetParameter is a ksonnet component - parameter - properties: - component: - type: string - name: - type: string - value: - type: string - required: - - name - - value - type: object - type: array - type: object - kustomize: - description: Kustomize holds kustomize specific options - properties: - commonAnnotations: - additionalProperties: - type: string - description: CommonAnnotations adds additional kustomize - commonAnnotations - type: object - commonLabels: - additionalProperties: - type: string - description: CommonLabels adds additional kustomize - commonLabels - type: object - images: - description: Images are kustomize image overrides - items: - type: string - type: array - namePrefix: - description: NamePrefix is a prefix appended to resources - for kustomize apps - type: string - nameSuffix: - description: NameSuffix is a suffix appended to resources - for kustomize apps - type: string - version: - description: Version contains optional Kustomize version - type: string - type: object - path: - description: Path is a directory path within the Git repository - type: string - plugin: - description: ConfigManagementPlugin holds config management - plugin specific options - properties: - env: - items: - properties: - name: - description: the name, usually uppercase - type: string - value: - description: the value - type: string - required: - - name - - value - type: object - type: array - name: - type: string - type: object - repoURL: - description: RepoURL is the repository URL of the application - manifests - type: string - targetRevision: - description: TargetRevision defines the commit, tag, or - branch in which to sync the application to. If omitted, - will sync to HEAD - type: string - required: - - repoURL - type: object - syncPolicy: - description: SyncPolicy controls when a sync will be performed - properties: - automated: - description: Automated will keep an application synced - to the target revision - properties: - allowEmpty: - description: 'AllowEmpty allows apps have zero live - resources (default: false)' - type: boolean - prune: - description: 'Prune will prune resources automatically - as part of automated sync (default: false)' - type: boolean - selfHeal: - description: 'SelfHeal enables auto-syncing if (default: - false)' - type: boolean - type: object - retry: - description: Retry controls failed sync retry behavior - properties: - backoff: - description: Backoff is a backoff strategy - properties: - duration: - description: Duration is the amount to back off. - Default unit is seconds, but could also be a - duration (e.g. "2m", "1h") - type: string - factor: - description: Factor is a factor to multiply the - base duration after each failed retry - format: int64 - type: integer - maxDuration: - description: MaxDuration is the maximum amount - of time allowed for the backoff strategy - type: string - type: object - limit: - description: Limit is the maximum number of attempts - when retrying a container - format: int64 - type: integer - type: object - syncOptions: - description: Options allow you to specify whole app sync-options - items: - type: string - type: array - type: object - required: - - destination - - project - - source - type: object - required: - - metadata - - spec - type: object - required: - - generators - - template - type: object - status: - description: ApplicationSetStatus defines the observed state of ApplicationSet - type: object - required: - - metadata - - spec - type: object - served: true - storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] ---- -apiVersion: apiextensions.k8s.io/v1 -kind: CustomResourceDefinition -metadata: - labels: - app.kubernetes.io/name: appprojects.argoproj.io - app.kubernetes.io/part-of: argocd - name: appprojects.argoproj.io -spec: - group: argoproj.io - names: - kind: AppProject - listKind: AppProjectList - plural: appprojects - shortNames: - - appproj - - appprojs - singular: appproject - scope: Namespaced - versions: - - name: v1alpha1 - schema: - openAPIV3Schema: - description: 'AppProject provides a logical grouping of applications, providing - controls for: * where the apps may deploy to (cluster whitelist) * what - may be deployed (repository whitelist, resource whitelist/blacklist) * who - can access these applications (roles, OIDC group claims bindings) * and - what they can do (RBAC policies) * automation access to these roles (JWT - tokens)' - properties: - apiVersion: - description: 'APIVersion defines the versioned schema of this representation - of an object. Servers should convert recognized schemas to the latest - internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' - type: string - kind: - description: 'Kind is a string value representing the REST resource this - object represents. Servers may infer this from the endpoint the client - submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' - type: string - metadata: - type: object - spec: - description: AppProjectSpec is the specification of an AppProject - properties: - clusterResourceBlacklist: - description: ClusterResourceBlacklist contains list of blacklisted - cluster level resources - items: - description: GroupKind specifies a Group and a Kind, but does not - force a version. This is useful for identifying concepts during - lookup stages without having partially valid types - properties: - group: - type: string - kind: - type: string - required: - - group - - kind - type: object - type: array - clusterResourceWhitelist: - description: ClusterResourceWhitelist contains list of whitelisted - cluster level resources - items: - description: GroupKind specifies a Group and a Kind, but does not - force a version. This is useful for identifying concepts during - lookup stages without having partially valid types - properties: - group: - type: string - kind: - type: string - required: - - group - - kind - type: object - type: array - description: - description: Description contains optional project description - type: string - destinations: - description: Destinations contains list of destinations available - for deployment - items: - description: ApplicationDestination holds information about the - application's destination - properties: - name: - description: Name is an alternate way of specifying the target - cluster by its symbolic name - type: string - namespace: - description: Namespace specifies the target namespace for the - application's resources. The namespace will only be set for - namespace-scoped resources that have not set a value for .metadata.namespace - type: string - server: - description: Server specifies the URL of the target cluster - and must be set to the Kubernetes control plane API - type: string - type: object - type: array - namespaceResourceBlacklist: - description: NamespaceResourceBlacklist contains list of blacklisted - namespace level resources - items: - description: GroupKind specifies a Group and a Kind, but does not - force a version. This is useful for identifying concepts during - lookup stages without having partially valid types - properties: - group: - type: string - kind: - type: string - required: - - group - - kind - type: object - type: array - namespaceResourceWhitelist: - description: NamespaceResourceWhitelist contains list of whitelisted - namespace level resources - items: - description: GroupKind specifies a Group and a Kind, but does not - force a version. This is useful for identifying concepts during - lookup stages without having partially valid types - properties: - group: - type: string - kind: - type: string - required: - - group - - kind - type: object - type: array - orphanedResources: - description: OrphanedResources specifies if controller should monitor - orphaned resources of apps in this project - properties: - ignore: - description: Ignore contains a list of resources that are to be - excluded from orphaned resources monitoring - items: - description: OrphanedResourceKey is a reference to a resource - to be ignored from - properties: - group: - type: string - kind: - type: string - name: - type: string - type: object - type: array - warn: - description: Warn indicates if warning condition should be created - for apps which have orphaned resources - type: boolean - type: object - roles: - description: Roles are user defined RBAC roles associated with this - project - items: - description: ProjectRole represents a role that has access to a - project - properties: - description: - description: Description is a description of the role - type: string - groups: - description: Groups are a list of OIDC group claims bound to - this role - items: - type: string - type: array - jwtTokens: - description: JWTTokens are a list of generated JWT tokens bound - to this role - items: - description: JWTToken holds the issuedAt and expiresAt values - of a token - properties: - exp: - format: int64 - type: integer - iat: - format: int64 - type: integer - id: - type: string - required: - - iat - type: object - type: array - name: - description: Name is a name for this role - type: string - policies: - description: Policies Stores a list of casbin formated strings - that define access policies for the role in the project - items: - type: string - type: array - required: - - name - type: object - type: array - signatureKeys: - description: SignatureKeys contains a list of PGP key IDs that commits - in Git must be signed with in order to be allowed for sync - items: - description: SignatureKey is the specification of a key required - to verify commit signatures with - properties: - keyID: - description: The ID of the key in hexadecimal notation - type: string - required: - - keyID - type: object - type: array - sourceRepos: - description: SourceRepos contains list of repository URLs which can - be used for deployment - items: - type: string - type: array - syncWindows: - description: SyncWindows controls when syncs can be run for apps in - this project - items: - description: SyncWindow contains the kind, time, duration and attributes - that are used to assign the syncWindows to apps - properties: - applications: - description: Applications contains a list of applications that - the window will apply to - items: - type: string - type: array - clusters: - description: Clusters contains a list of clusters that the window - will apply to - items: - type: string - type: array - duration: - description: Duration is the amount of time the sync window - will be open - type: string - kind: - description: Kind defines if the window allows or blocks syncs - type: string - manualSync: - description: ManualSync enables manual syncs when they would - otherwise be blocked - type: boolean - namespaces: - description: Namespaces contains a list of namespaces that the - window will apply to - items: - type: string - type: array - schedule: - description: Schedule is the time the window will begin, specified - in cron format - type: string - type: object - type: array - type: object - status: - description: AppProjectStatus contains status information for AppProject - CRs - properties: - jwtTokensByRole: - additionalProperties: - description: JWTTokens represents a list of JWT tokens - properties: - items: - items: - description: JWTToken holds the issuedAt and expiresAt values - of a token - properties: - exp: - format: int64 - type: integer - iat: - format: int64 - type: integer - id: - type: string - required: - - iat - type: object - type: array - type: object - description: JWTTokensByRole contains a list of JWT tokens issued - for a given role - type: object - type: object - required: - - metadata - - spec - type: object - served: true - storage: true ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - labels: - app.kubernetes.io/component: controller - app.kubernetes.io/name: argocd-applicationset-controller - app.kubernetes.io/part-of: argocd-applicationset - name: argocd-applicationset-controller - namespace: argocd ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - labels: - app.kubernetes.io/component: application-controller - app.kubernetes.io/name: argocd-application-controller - app.kubernetes.io/part-of: argocd - name: argocd-application-controller ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - labels: - app.kubernetes.io/component: dex-server - app.kubernetes.io/name: argocd-dex-server - app.kubernetes.io/part-of: argocd - name: argocd-dex-server ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - labels: - app.kubernetes.io/component: redis - app.kubernetes.io/name: argocd-redis - app.kubernetes.io/part-of: argocd - name: argocd-redis ---- -apiVersion: v1 -kind: ServiceAccount -metadata: - labels: - app.kubernetes.io/component: server - app.kubernetes.io/name: argocd-server - app.kubernetes.io/part-of: argocd - name: argocd-server ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - labels: - app.kubernetes.io/component: controller - app.kubernetes.io/name: argocd-applicationset-controller - app.kubernetes.io/part-of: argocd-applicationset - name: argocd-applicationset-controller - namespace: argocd -rules: -- apiGroups: - - argoproj.io - resources: - - applications - - appprojects - - applicationsets - - applicationsets/finalizers - verbs: - - create - - delete - - get - - list - - patch - - update - - watch -- apiGroups: - - argoproj.io - resources: - - applicationsets/status - verbs: - - get - - patch - - update -- apiGroups: - - "" - resources: - - events - verbs: - - create - - get - - list - - patch - - watch -- apiGroups: - - "" - resources: - - secrets - - configmaps - verbs: - - get - - list - - watch -- apiGroups: - - apps - - extensions - resources: - - deployments - verbs: - - get - - list - - watch ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - labels: - app.kubernetes.io/component: application-controller - app.kubernetes.io/name: argocd-application-controller - app.kubernetes.io/part-of: argocd - name: argocd-application-controller -rules: -- apiGroups: - - "" - resources: - - secrets - - configmaps - verbs: - - get - - list - - watch -- apiGroups: - - argoproj.io - resources: - - applications - - appprojects - verbs: - - create - - get - - list - - watch - - update - - patch - - delete -- apiGroups: - - "" - resources: - - events - verbs: - - create - - list ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - labels: - app.kubernetes.io/component: dex-server - app.kubernetes.io/name: argocd-dex-server - app.kubernetes.io/part-of: argocd - name: argocd-dex-server -rules: -- apiGroups: - - "" - resources: - - secrets - - configmaps - verbs: - - get - - list - - watch ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - labels: - app.kubernetes.io/component: redis - app.kubernetes.io/name: argocd-redis - app.kubernetes.io/part-of: argocd - name: argocd-redis -rules: -- apiGroups: - - security.openshift.io - resourceNames: - - nonroot - resources: - - securitycontextconstraints - verbs: - - use ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - labels: - app.kubernetes.io/component: server - app.kubernetes.io/name: argocd-server - app.kubernetes.io/part-of: argocd - name: argocd-server -rules: -- apiGroups: - - "" - resources: - - secrets - - configmaps - verbs: - - create - - get - - list - - watch - - update - - patch - - delete -- apiGroups: - - argoproj.io - resources: - - applications - - appprojects - verbs: - - create - - get - - list - - watch - - update - - delete - - patch -- apiGroups: - - "" - resources: - - events - verbs: - - create - - list ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - labels: - app.kubernetes.io/component: application-controller - app.kubernetes.io/name: argocd-application-controller - app.kubernetes.io/part-of: argocd - name: argocd-application-controller -rules: -- apiGroups: - - '*' - resources: - - '*' - verbs: - - '*' -- nonResourceURLs: - - '*' - verbs: - - '*' ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRole -metadata: - labels: - app.kubernetes.io/component: server - app.kubernetes.io/name: argocd-server - app.kubernetes.io/part-of: argocd - name: argocd-server -rules: -- apiGroups: - - '*' - resources: - - '*' - verbs: - - delete - - get - - patch -- apiGroups: - - "" - resources: - - events - verbs: - - list -- apiGroups: - - "" - resources: - - pods - - pods/log - verbs: - - get ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - labels: - app.kubernetes.io/component: controller - app.kubernetes.io/name: argocd-applicationset-controller - app.kubernetes.io/part-of: argocd-applicationset - name: argocd-applicationset-controller - namespace: argocd -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: argocd-applicationset-controller -subjects: -- kind: ServiceAccount - name: argocd-applicationset-controller - namespace: argocd ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - labels: - app.kubernetes.io/component: application-controller - app.kubernetes.io/name: argocd-application-controller - app.kubernetes.io/part-of: argocd - name: argocd-application-controller -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: argocd-application-controller -subjects: -- kind: ServiceAccount - name: argocd-application-controller ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - labels: - app.kubernetes.io/component: dex-server - app.kubernetes.io/name: argocd-dex-server - app.kubernetes.io/part-of: argocd - name: argocd-dex-server -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: argocd-dex-server -subjects: -- kind: ServiceAccount - name: argocd-dex-server ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - labels: - app.kubernetes.io/component: redis - app.kubernetes.io/name: argocd-redis - app.kubernetes.io/part-of: argocd - name: argocd-redis -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: argocd-redis -subjects: -- kind: ServiceAccount - name: argocd-redis ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - labels: - app.kubernetes.io/component: server - app.kubernetes.io/name: argocd-server - app.kubernetes.io/part-of: argocd - name: argocd-server -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: Role - name: argocd-server -subjects: -- kind: ServiceAccount - name: argocd-server ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - labels: - app.kubernetes.io/component: application-controller - app.kubernetes.io/name: argocd-application-controller - app.kubernetes.io/part-of: argocd - name: argocd-application-controller -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: argocd-application-controller -subjects: -- kind: ServiceAccount - name: argocd-application-controller - namespace: default ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: ClusterRoleBinding -metadata: - labels: - app.kubernetes.io/component: server - app.kubernetes.io/name: argocd-server - app.kubernetes.io/part-of: argocd - name: argocd-server -roleRef: - apiGroup: rbac.authorization.k8s.io - kind: ClusterRole - name: argocd-server -subjects: -- kind: ServiceAccount - name: argocd-server - namespace: default ---- -apiVersion: v1 -data: - timeout.reconciliation: 20s -kind: ConfigMap -metadata: - labels: - app.kubernetes.io/name: argocd-cm - app.kubernetes.io/part-of: argocd - name: argocd-cm ---- -apiVersion: v1 -kind: ConfigMap -metadata: - labels: - app.kubernetes.io/name: argocd-gpg-keys-cm - app.kubernetes.io/part-of: argocd - name: argocd-gpg-keys-cm ---- -apiVersion: v1 -kind: ConfigMap -metadata: - labels: - app.kubernetes.io/name: argocd-rbac-cm - app.kubernetes.io/part-of: argocd - name: argocd-rbac-cm ---- -apiVersion: v1 -data: - ssh_known_hosts: | - bitbucket.org ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/VqLat/MaB33pZy0y3rJZtnqwR2qOOvbwKZYKiEO1O6VqNEBxKvJJelCq0dTXWT5pbO2gDXC6h6QDXCaHo6pOHGPUy+YBaGQRGuSusMEASYiWunYN0vCAI8QaXnWMXNMdFP3jHAJH0eDsoiGnLPBlBp4TNm6rYI74nMzgz3B9IikW4WVK+dc8KZJZWYjAuORU3jc1c/NPskD2ASinf8v3xnfXeukU0sJ5N6m5E8VLjObPEO+mN2t/FZTMZLiFqPWc/ALSqnMnnhwrNi2rbfg/rd/IpL8Le3pSBne8+seeFVBoGqzHM9yXw== - github.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ== - gitlab.com ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBFSMqzJeV9rUzU4kWitGjeR4PWSa29SPqJ1fVkhtj3Hw9xjLVXVYrU9QlYWrOLXBpQ6KWjbjTDTdDkoohFzgbEY= - gitlab.com ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIAfuCHKVTjquxvt6CM6tdG4SLp1Btn/nOeHHE5UOzRdf - gitlab.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCsj2bNKTBSpIYDEGk9KxsGh3mySTRgMtXL583qmBpzeQ+jqCMRgBqB98u3z++J1sKlXHWfM9dyhSevkMwSbhoR8XIq/U0tCNyokEi/ueaBMCvbcTHhO7FcwzY92WK4Yt0aGROY5qX2UKSeOvuP4D6TPqKF1onrSzH9bx9XUf2lEdWT/ia1NEKjunUqu1xOB/StKDHMoX4/OKyIzuS0q/T1zOATthvasJFoPrAjkohTyaDUz2LN5JoH839hViyEG82yB+MjcFV5MU3N1l1QL3cVUCh93xSaua1N85qivl+siMkPGbO5xR/En4iEY6K2XPASUEMaieWVNTRCtJ4S8H+9 - ssh.dev.azure.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC7Hr1oTWqNqOlzGJOfGJ4NakVyIzf1rXYd4d7wo6jBlkLvCA4odBlL0mDUyZ0/QUfTTqeu+tm22gOsv+VrVTMk6vwRU75gY/y9ut5Mb3bR5BV58dKXyq9A9UeB5Cakehn5Zgm6x1mKoVyf+FFn26iYqXJRgzIZZcZ5V6hrE0Qg39kZm4az48o0AUbf6Sp4SLdvnuMa2sVNwHBboS7EJkm57XQPVU3/QpyNLHbWDdzwtrlS+ez30S3AdYhLKEOxAG8weOnyrtLJAUen9mTkol8oII1edf7mWWbWVf0nBmly21+nZcmCTISQBtdcyPaEno7fFQMDD26/s0lfKob4Kw8H - vs-ssh.visualstudio.com ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC7Hr1oTWqNqOlzGJOfGJ4NakVyIzf1rXYd4d7wo6jBlkLvCA4odBlL0mDUyZ0/QUfTTqeu+tm22gOsv+VrVTMk6vwRU75gY/y9ut5Mb3bR5BV58dKXyq9A9UeB5Cakehn5Zgm6x1mKoVyf+FFn26iYqXJRgzIZZcZ5V6hrE0Qg39kZm4az48o0AUbf6Sp4SLdvnuMa2sVNwHBboS7EJkm57XQPVU3/QpyNLHbWDdzwtrlS+ez30S3AdYhLKEOxAG8weOnyrtLJAUen9mTkol8oII1edf7mWWbWVf0nBmly21+nZcmCTISQBtdcyPaEno7fFQMDD26/s0lfKob4Kw8H -kind: ConfigMap -metadata: - labels: - app.kubernetes.io/name: argocd-ssh-known-hosts-cm - app.kubernetes.io/part-of: argocd - name: argocd-ssh-known-hosts-cm ---- -apiVersion: v1 -data: null -kind: ConfigMap -metadata: - labels: - app.kubernetes.io/name: argocd-tls-certs-cm - app.kubernetes.io/part-of: argocd - name: argocd-tls-certs-cm ---- -apiVersion: v1 -kind: Secret -metadata: - labels: - app.kubernetes.io/name: argocd-secret - app.kubernetes.io/part-of: argocd - name: argocd-secret -type: Opaque ---- -apiVersion: v1 -kind: Service -metadata: - labels: - app.kubernetes.io/component: dex-server - app.kubernetes.io/name: argocd-dex-server - app.kubernetes.io/part-of: argocd - name: argocd-dex-server -spec: - ports: - - name: http - port: 5556 - protocol: TCP - targetPort: 5556 - - name: grpc - port: 5557 - protocol: TCP - targetPort: 5557 - - name: metrics - port: 5558 - protocol: TCP - targetPort: 5558 - selector: - app.kubernetes.io/name: argocd-dex-server ---- -apiVersion: v1 -kind: Service -metadata: - labels: - app.kubernetes.io/component: metrics - app.kubernetes.io/name: argocd-metrics - app.kubernetes.io/part-of: argocd - name: argocd-metrics -spec: - ports: - - name: metrics - port: 8082 - protocol: TCP - targetPort: 8082 - selector: - app.kubernetes.io/name: argocd-application-controller ---- -apiVersion: v1 -kind: Service -metadata: - labels: - app.kubernetes.io/component: redis - app.kubernetes.io/name: argocd-redis - app.kubernetes.io/part-of: argocd - name: argocd-redis -spec: - ports: - - name: tcp-redis - port: 6379 - targetPort: 6379 - selector: - app.kubernetes.io/name: argocd-redis ---- -apiVersion: v1 -kind: Service -metadata: - labels: - app.kubernetes.io/component: repo-server - app.kubernetes.io/name: argocd-repo-server - app.kubernetes.io/part-of: argocd - name: argocd-repo-server -spec: - ports: - - name: server - port: 8081 - protocol: TCP - targetPort: 8081 - - name: metrics - port: 8084 - protocol: TCP - targetPort: 8084 - selector: - app.kubernetes.io/name: argocd-repo-server ---- -apiVersion: v1 -kind: Service -metadata: - labels: - app.kubernetes.io/component: server - app.kubernetes.io/name: argocd-server - app.kubernetes.io/part-of: argocd - name: argocd-server -spec: - ports: - - name: http - port: 80 - protocol: TCP - targetPort: 8080 - - name: https - port: 443 - protocol: TCP - targetPort: 8080 - selector: - app.kubernetes.io/name: argocd-server ---- -apiVersion: v1 -kind: Service -metadata: - labels: - app.kubernetes.io/component: server - app.kubernetes.io/name: argocd-server-metrics - app.kubernetes.io/part-of: argocd - name: argocd-server-metrics -spec: - ports: - - name: metrics - port: 8083 - protocol: TCP - targetPort: 8083 - selector: - app.kubernetes.io/name: argocd-server ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app.kubernetes.io/component: controller - app.kubernetes.io/name: argocd-applicationset-controller - app.kubernetes.io/part-of: argocd-applicationset - name: argocd-applicationset-controller - namespace: argocd -spec: - selector: - matchLabels: - app.kubernetes.io/name: argocd-applicationset-controller - template: - metadata: - labels: - app.kubernetes.io/name: argocd-applicationset-controller - spec: - containers: - - command: - - applicationset-controller - env: - - name: NAMESPACE - valueFrom: - fieldRef: - fieldPath: metadata.namespace - image: quay.io/argoproj/argocd-applicationset:latest - imagePullPolicy: Always - name: argocd-applicationset-controller - volumeMounts: - - mountPath: /app/config/ssh - name: ssh-known-hosts - - mountPath: /app/config/tls - name: tls-certs - - mountPath: /app/config/gpg/source - name: gpg-keys - - mountPath: /app/config/gpg/keys - name: gpg-keyring - serviceAccountName: argocd-applicationset-controller - volumes: - - configMap: - name: argocd-ssh-known-hosts-cm - name: ssh-known-hosts - - configMap: - name: argocd-tls-certs-cm - name: tls-certs - - configMap: - name: argocd-gpg-keys-cm - name: gpg-keys - - emptyDir: {} - name: gpg-keyring ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app.kubernetes.io/component: dex-server - app.kubernetes.io/name: argocd-dex-server - app.kubernetes.io/part-of: argocd - name: argocd-dex-server -spec: - selector: - matchLabels: - app.kubernetes.io/name: argocd-dex-server - template: - metadata: - labels: - app.kubernetes.io/name: argocd-dex-server - spec: - affinity: - podAntiAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - podAffinityTerm: - labelSelector: - matchLabels: - app.kubernetes.io/part-of: argocd - topologyKey: kubernetes.io/hostname - weight: 5 - containers: - - command: - - /shared/argocd-dex - - rundex - image: ghcr.io/dexidp/dex:v2.27.0 - imagePullPolicy: Always - name: dex - ports: - - containerPort: 5556 - - containerPort: 5557 - - containerPort: 5558 - volumeMounts: - - mountPath: /shared - name: static-files - initContainers: - - command: - - cp - - -n - - /usr/local/bin/argocd - - /shared/argocd-dex - image: quay.io/argoproj/argocd:v2.0.4 - imagePullPolicy: Always - name: copyutil - volumeMounts: - - mountPath: /shared - name: static-files - serviceAccountName: argocd-dex-server - volumes: - - emptyDir: {} - name: static-files ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app.kubernetes.io/component: redis - app.kubernetes.io/name: argocd-redis - app.kubernetes.io/part-of: argocd - name: argocd-redis -spec: - selector: - matchLabels: - app.kubernetes.io/name: argocd-redis - template: - metadata: - labels: - app.kubernetes.io/name: argocd-redis - spec: - affinity: - podAntiAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - podAffinityTerm: - labelSelector: - matchLabels: - app.kubernetes.io/name: argocd-redis - topologyKey: kubernetes.io/hostname - weight: 100 - - podAffinityTerm: - labelSelector: - matchLabels: - app.kubernetes.io/part-of: argocd - topologyKey: kubernetes.io/hostname - weight: 5 - containers: - - args: - - --save - - "" - - --appendonly - - "no" - image: redis:6.2.4-alpine - imagePullPolicy: Always - name: redis - ports: - - containerPort: 6379 - securityContext: - fsGroup: 1000 - runAsGroup: 1000 - runAsNonRoot: true - runAsUser: 1000 - serviceAccountName: argocd-redis ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app.kubernetes.io/component: repo-server - app.kubernetes.io/name: argocd-repo-server - app.kubernetes.io/part-of: argocd - name: argocd-repo-server -spec: - selector: - matchLabels: - app.kubernetes.io/name: argocd-repo-server - template: - metadata: - labels: - app.kubernetes.io/name: argocd-repo-server - spec: - affinity: - podAntiAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - podAffinityTerm: - labelSelector: - matchLabels: - app.kubernetes.io/name: argocd-repo-server - topologyKey: kubernetes.io/hostname - weight: 100 - - podAffinityTerm: - labelSelector: - matchLabels: - app.kubernetes.io/part-of: argocd - topologyKey: kubernetes.io/hostname - weight: 5 - automountServiceAccountToken: false - containers: - - command: - - uid_entrypoint.sh - - argocd-repo-server - - --redis - - argocd-redis:6379 - image: quay.io/argoproj/argocd:v2.0.4 - imagePullPolicy: Always - livenessProbe: - failureThreshold: 3 - httpGet: - path: /healthz?full=true - port: 8084 - initialDelaySeconds: 30 - periodSeconds: 5 - name: argocd-repo-server - ports: - - containerPort: 8081 - - containerPort: 8084 - readinessProbe: - httpGet: - path: /healthz - port: 8084 - initialDelaySeconds: 5 - periodSeconds: 10 - securityContext: - allowPrivilegeEscalation: false - capabilities: - drop: - - all - volumeMounts: - - mountPath: /app/config/ssh - name: ssh-known-hosts - - mountPath: /app/config/tls - name: tls-certs - - mountPath: /app/config/gpg/source - name: gpg-keys - - mountPath: /app/config/gpg/keys - name: gpg-keyring - - mountPath: /app/config/reposerver/tls - name: argocd-repo-server-tls - volumes: - - configMap: - name: argocd-ssh-known-hosts-cm - name: ssh-known-hosts - - configMap: - name: argocd-tls-certs-cm - name: tls-certs - - configMap: - name: argocd-gpg-keys-cm - name: gpg-keys - - emptyDir: {} - name: gpg-keyring - - name: argocd-repo-server-tls - secret: - items: - - key: tls.crt - path: tls.crt - - key: tls.key - path: tls.key - - key: ca.crt - path: ca.crt - optional: true - secretName: argocd-repo-server-tls ---- -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app.kubernetes.io/component: server - app.kubernetes.io/name: argocd-server - app.kubernetes.io/part-of: argocd - name: argocd-server -spec: - selector: - matchLabels: - app.kubernetes.io/name: argocd-server - template: - metadata: - labels: - app.kubernetes.io/name: argocd-server - spec: - affinity: - podAntiAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - podAffinityTerm: - labelSelector: - matchLabels: - app.kubernetes.io/name: argocd-server - topologyKey: kubernetes.io/hostname - weight: 100 - - podAffinityTerm: - labelSelector: - matchLabels: - app.kubernetes.io/part-of: argocd - topologyKey: kubernetes.io/hostname - weight: 5 - containers: - - command: - - argocd-server - - --staticassets - - /shared/app - image: quay.io/argoproj/argocd:v2.0.4 - imagePullPolicy: Always - livenessProbe: - httpGet: - path: /healthz?full=true - port: 8080 - initialDelaySeconds: 3 - periodSeconds: 30 - name: argocd-server - ports: - - containerPort: 8080 - - containerPort: 8083 - readinessProbe: - httpGet: - path: /healthz - port: 8080 - initialDelaySeconds: 3 - periodSeconds: 30 - securityContext: - allowPrivilegeEscalation: false - capabilities: - drop: - - all - volumeMounts: - - mountPath: /app/config/ssh - name: ssh-known-hosts - - mountPath: /app/config/tls - name: tls-certs - - mountPath: /app/config/server/tls - name: argocd-repo-server-tls - serviceAccountName: argocd-server - volumes: - - emptyDir: {} - name: static-files - - configMap: - name: argocd-ssh-known-hosts-cm - name: ssh-known-hosts - - configMap: - name: argocd-tls-certs-cm - name: tls-certs - - name: argocd-repo-server-tls - secret: - items: - - key: tls.crt - path: tls.crt - - key: tls.key - path: tls.key - - key: ca.crt - path: ca.crt - optional: true - secretName: argocd-repo-server-tls ---- -apiVersion: apps/v1 -kind: StatefulSet -metadata: - labels: - app.kubernetes.io/component: application-controller - app.kubernetes.io/name: argocd-application-controller - app.kubernetes.io/part-of: argocd - name: argocd-application-controller -spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/name: argocd-application-controller - serviceName: argocd-application-controller - template: - metadata: - labels: - app.kubernetes.io/name: argocd-application-controller - spec: - affinity: - podAntiAffinity: - preferredDuringSchedulingIgnoredDuringExecution: - - podAffinityTerm: - labelSelector: - matchLabels: - app.kubernetes.io/name: argocd-application-controller - topologyKey: kubernetes.io/hostname - weight: 100 - - podAffinityTerm: - labelSelector: - matchLabels: - app.kubernetes.io/part-of: argocd - topologyKey: kubernetes.io/hostname - weight: 5 - containers: - - command: - - argocd-application-controller - - --status-processors - - "20" - - --operation-processors - - "10" - - --app-resync - - "20" - image: quay.io/argoproj/argocd:v2.0.4 - imagePullPolicy: Always - livenessProbe: - httpGet: - path: /healthz - port: 8082 - initialDelaySeconds: 5 - periodSeconds: 10 - name: argocd-application-controller - ports: - - containerPort: 8082 - readinessProbe: - httpGet: - path: /healthz - port: 8082 - initialDelaySeconds: 5 - periodSeconds: 10 - securityContext: - allowPrivilegeEscalation: false - capabilities: - drop: - - all - volumeMounts: - - mountPath: /app/config/controller/tls - name: argocd-repo-server-tls - serviceAccountName: argocd-application-controller - volumes: - - name: argocd-repo-server-tls - secret: - items: - - key: tls.crt - path: tls.crt - - key: tls.key - path: tls.key - - key: ca.crt - path: ca.crt - optional: true - secretName: argocd-repo-server-tls ---- -apiVersion: networking.k8s.io/v1 -kind: NetworkPolicy -metadata: - name: argocd-application-controller-network-policy -spec: - ingress: - - from: - - namespaceSelector: {} - ports: - - port: 8082 - podSelector: - matchLabels: - app.kubernetes.io/name: argocd-application-controller - policyTypes: - - Ingress ---- -apiVersion: networking.k8s.io/v1 -kind: NetworkPolicy -metadata: - name: argocd-dex-server-network-policy -spec: - ingress: - - from: - - podSelector: - matchLabels: - app.kubernetes.io/name: argocd-server - ports: - - port: 5556 - protocol: TCP - - port: 5557 - protocol: TCP - - from: - - namespaceSelector: {} - ports: - - port: 5558 - protocol: TCP - podSelector: - matchLabels: - app.kubernetes.io/name: argocd-dex-server - policyTypes: - - Ingress ---- -apiVersion: networking.k8s.io/v1 -kind: NetworkPolicy -metadata: - name: argocd-redis-network-policy -spec: - ingress: - - from: - - podSelector: - matchLabels: - app.kubernetes.io/name: argocd-server - - podSelector: - matchLabels: - app.kubernetes.io/name: argocd-repo-server - - podSelector: - matchLabels: - app.kubernetes.io/name: argocd-application-controller - ports: - - port: 6379 - protocol: TCP - podSelector: - matchLabels: - app.kubernetes.io/name: argocd-redis - policyTypes: - - Ingress ---- -apiVersion: networking.k8s.io/v1 -kind: NetworkPolicy -metadata: - name: argocd-repo-server-network-policy -spec: - ingress: - - from: - - podSelector: - matchLabels: - app.kubernetes.io/name: argocd-server - - podSelector: - matchLabels: - app.kubernetes.io/name: argocd-application-controller - ports: - - port: 8081 - protocol: TCP - - from: - - namespaceSelector: {} - ports: - - port: 8084 - podSelector: - matchLabels: - app.kubernetes.io/name: argocd-repo-server - policyTypes: - - Ingress ---- -apiVersion: networking.k8s.io/v1 -kind: NetworkPolicy -metadata: - name: argocd-server-network-policy -spec: - ingress: - - {} - podSelector: - matchLabels: - app.kubernetes.io/name: argocd-server - policyTypes: - - Ingress From c75edb56f6caea50f808ac0909507df0ffbce51e Mon Sep 17 00:00:00 2001 From: Noam Gal Date: Mon, 5 Jul 2021 13:57:02 +0300 Subject: [PATCH 10/14] removed quiet delete --- cmd/commands/repo.go | 6 +++--- pkg/kube/kube.go | 1 - 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/cmd/commands/repo.go b/cmd/commands/repo.go index 39fc51b5..fd990e79 100644 --- a/cmd/commands/repo.go +++ b/cmd/commands/repo.go @@ -61,8 +61,8 @@ type ( Namespace string KubeContext string Timeout time.Duration - KubeFactory kube.Factory CloneOptions *git.CloneOptions + KubeFactory kube.Factory } bootstrapManifests struct { @@ -311,10 +311,10 @@ func NewRepoUninstallCommand() *cobra.Command { RunE: func(cmd *cobra.Command, args []string) error { return RunRepoUninstall(cmd.Context(), &RepoUninstallOptions{ Namespace: cmd.Flag("namespace").Value.String(), - KubeContext: cmd.Flag("context").Value.String(), Timeout: util.MustParseDuration(cmd.Flag("request-timeout").Value.String()), - KubeFactory: f, + KubeContext: cmd.Flag("context").Value.String(), CloneOptions: cloneOpts, + KubeFactory: f, }) }, } diff --git a/pkg/kube/kube.go b/pkg/kube/kube.go index e4ef104d..c1b7a596 100644 --- a/pkg/kube/kube.go +++ b/pkg/kube/kube.go @@ -216,7 +216,6 @@ func (f *factory) Delete(ctx context.Context, resourceTypes []string, labelSelec DeleteAllNamespaces: true, LabelSelector: labelSelector, WaitForDeletion: true, - Quiet: true, } cmd := &cobra.Command{ From eb9fba1e2f77979f1c990f51861bbf9abf8a4de2 Mon Sep 17 00:00:00 2001 From: Noam Gal Date: Mon, 5 Jul 2021 16:58:36 +0300 Subject: [PATCH 11/14] fixed PR comments --- cmd/commands/app.go | 2 +- cmd/commands/common.go | 4 ++-- cmd/commands/repo.go | 48 ++++++++++++++++++++++++--------------- cmd/commands/repo_test.go | 2 +- pkg/argocd/argocd.go | 16 +++++++------ pkg/kube/kube.go | 21 +++++++++++++---- pkg/kube/mocks/kube.go | 10 ++++---- 7 files changed, 65 insertions(+), 38 deletions(-) diff --git a/cmd/commands/app.go b/cmd/commands/app.go index 26ee13a5..c66d02ec 100644 --- a/cmd/commands/app.go +++ b/cmd/commands/app.go @@ -219,7 +219,7 @@ func RunAppCreate(ctx context.Context, opts *AppCreateOptions) error { fullName := fmt.Sprintf("%s-%s", opts.ProjectName, opts.AppOpts.AppName) // wait for argocd to be ready before applying argocd-apps stop := util.WithSpinner(ctx, fmt.Sprintf("waiting for '%s' to be ready", fullName)) - if err = waitAppSynced(ctx, opts.KubeFactory, opts.Timeout, fullName, namespace, revision); err != nil { + if err = waitAppSynced(ctx, opts.KubeFactory, opts.Timeout, fullName, namespace, revision, true); err != nil { stop() return fmt.Errorf("failed waiting for application to sync: %w", err) } diff --git a/cmd/commands/common.go b/cmd/commands/common.go index b7d767ad..b90a6dfb 100644 --- a/cmd/commands/common.go +++ b/cmd/commands/common.go @@ -144,7 +144,7 @@ func createApp(opts *createAppOptions) ([]byte, error) { return yaml.Marshal(app) } -func waitAppSynced(ctx context.Context, f kube.Factory, timeout time.Duration, appName, namespace, revision string) error { +func waitAppSynced(ctx context.Context, f kube.Factory, timeout time.Duration, appName, namespace, revision string, waitForCreation bool) error { return f.Wait(ctx, &kube.WaitOptions{ Interval: store.Default.WaitInterval, Timeout: timeout, @@ -152,7 +152,7 @@ func waitAppSynced(ctx context.Context, f kube.Factory, timeout time.Duration, a { Name: appName, Namespace: namespace, - WaitFunc: argocd.GetAppSyncFn(revision), + WaitFunc: argocd.GetAppSyncWaitFunc(revision, waitForCreation), }, }, }) diff --git a/cmd/commands/repo.go b/cmd/commands/repo.go index fd990e79..a286de2e 100644 --- a/cmd/commands/repo.go +++ b/cmd/commands/repo.go @@ -27,6 +27,7 @@ import ( billyUtils "github.com/go-git/go-billy/v5/util" "github.com/spf13/cobra" v1 "k8s.io/api/core/v1" + kerrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" kusttypes "sigs.k8s.io/kustomize/api/types" ) @@ -352,21 +353,24 @@ func RunRepoUninstall(ctx context.Context, opts *RepoUninstallOptions) error { return err } - log.G(ctx).Debug("pushing changes to remote") + log.G(ctx).Info("pushing changes to remote") revision, err := r.Persist(ctx, &git.PushOptions{CommitMsg: "Autopilot Uninstall"}) if err != nil { return err } stop := util.WithSpinner(ctx, fmt.Sprintf("waiting for '%s' to be finish syncing", store.Default.BootsrtrapAppName)) - if err = waitAppSynced(ctx, opts.KubeFactory, opts.Timeout, store.Default.BootsrtrapAppName, opts.Namespace, revision); err != nil { - stop() - return err + if err = waitAppSynced(ctx, opts.KubeFactory, opts.Timeout, store.Default.BootsrtrapAppName, opts.Namespace, revision, false); err != nil { + se, ok := err.(*kerrors.StatusError) + if !ok || se.ErrStatus.Reason != metav1.StatusReasonNotFound { + stop() + return err + } } stop() - log.G(ctx).Debug("Deleting cluster resources") - if err = deleteClusterResources(ctx, opts.KubeFactory); err != nil { + log.G(ctx).Info("Deleting cluster resources") + if err = deleteClusterResources(ctx, opts.KubeFactory, opts.Timeout); err != nil { return err } @@ -375,7 +379,7 @@ func RunRepoUninstall(ctx context.Context, opts *RepoUninstallOptions) error { return err } - log.G(ctx).Debug("pushing final commit to remote") + log.G(ctx).Info("pushing final commit to remote") if _, err := r.Persist(ctx, &git.PushOptions{CommitMsg: "Autopilot Uninstall, deleted leftovers"}); err != nil { return err } @@ -727,20 +731,28 @@ func deleteGitOpsFiles(repofs fs.FS) error { return nil } -func deleteClusterResources(ctx context.Context, f kube.Factory) error { - if err := f.Delete(ctx, []string{"applications", "secrets"}, store.Default.LabelKeyAppManagedBy+"="+store.Default.LabelValueManagedBy); err != nil { +func deleteClusterResources(ctx context.Context, f kube.Factory, timeout time.Duration) error { + if err := f.Delete(ctx, &kube.DeleteOptions{ + LabelSelector: store.Default.LabelKeyAppManagedBy + "=" + store.Default.LabelValueManagedBy, + ResourceTypes: []string{"applications", "secrets"}, + Timeout: timeout, + }); err != nil { return fmt.Errorf("failed deleting argocd-autopilot resources: %w", err) } - if err := f.Delete(ctx, []string{ - "all", - "configmaps", - "secrets", - "serviceaccounts", - "networkpolicies", - "rolebindings", - "roles", - }, argocdcommon.LabelKeyAppInstance+"="+store.Default.ArgoCDName); err != nil { + if err := f.Delete(ctx, &kube.DeleteOptions{ + LabelSelector: argocdcommon.LabelKeyAppInstance + "=" + store.Default.ArgoCDName, + ResourceTypes: []string{ + "all", + "configmaps", + "secrets", + "serviceaccounts", + "networkpolicies", + "rolebindings", + "roles", + }, + Timeout: timeout, + }); err != nil { return fmt.Errorf("failed deleting Argo-CD resources: %w", err) } diff --git a/cmd/commands/repo_test.go b/cmd/commands/repo_test.go index 561f226f..7cfb7879 100644 --- a/cmd/commands/repo_test.go +++ b/cmd/commands/repo_test.go @@ -572,7 +572,7 @@ func Test_deleteClusterResources(t *testing.T) { for name, tt := range tests { t.Run(name, func(t *testing.T) { f := tt.beforeFn() - err := deleteClusterResources(context.Background(), f) + err := deleteClusterResources(context.Background(), f, 0) tt.assertFn(t, f, err) }) } diff --git a/pkg/argocd/argocd.go b/pkg/argocd/argocd.go index 49890426..e082f88a 100644 --- a/pkg/argocd/argocd.go +++ b/pkg/argocd/argocd.go @@ -15,7 +15,7 @@ import ( argocdcs "github.com/argoproj/argo-cd/v2/pkg/client/clientset/versioned" "github.com/argoproj/gitops-engine/pkg/health" "github.com/spf13/cobra" - "k8s.io/apimachinery/pkg/api/errors" + kerrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -55,7 +55,9 @@ func AddClusterAddFlags(cmd *cobra.Command) (AddClusterCmd, error) { return &addClusterImpl{root, args}, nil } -func GetAppSyncFn(revision string) kube.WaitFunc { +// GetAppSyncWaitFunc returns a WaitFunc that will return true when the Application +// is in Sync + Healthy state, and at the specific revision (if supplied. If revision is "", no revision check is made) +func GetAppSyncWaitFunc(revision string, waitForCreation bool) kube.WaitFunc { return func(ctx context.Context, f kube.Factory, ns, name string) (bool, error) { rc, err := f.ToRESTConfig() if err != nil { @@ -69,8 +71,8 @@ func GetAppSyncFn(revision string) kube.WaitFunc { app, err := c.ArgoprojV1alpha1().Applications(ns).Get(ctx, name, metav1.GetOptions{}) if err != nil { - se, ok := err.(*errors.StatusError) - if !ok || se.ErrStatus.Reason != metav1.StatusReasonNotFound { + se, ok := err.(*kerrors.StatusError) + if !waitForCreation || !ok || se.ErrStatus.Reason != metav1.StatusReasonNotFound { return false, err } @@ -79,13 +81,13 @@ func GetAppSyncFn(revision string) kube.WaitFunc { synced := app.Status.Sync.Status == v1alpha1.SyncStatusCodeSynced healthy := app.Status.Health.Status == health.HealthStatusHealthy - atRevision := true + onRevision := true if revision != "" { - atRevision = revision == app.Status.Sync.Revision + onRevision = revision == app.Status.Sync.Revision } log.G(ctx).Debugf("Application found, Sync Status: %s, Health Status: %s, Revision: %s", app.Status.Sync.Status, app.Status.Health.Status, app.Status.Sync.Revision) - return synced && healthy && atRevision, nil + return synced && healthy && onRevision, nil } } diff --git a/pkg/kube/kube.go b/pkg/kube/kube.go index c1b7a596..cea80e03 100644 --- a/pkg/kube/kube.go +++ b/pkg/kube/kube.go @@ -59,7 +59,8 @@ type ( // Apply applies the provided manifests on the specified namespace Apply(ctx context.Context, namespace string, manifests []byte) error - Delete(ctx context.Context, resourceTypes []string, labelSelector string) error + // Delete delets the resources by their type(s) and labelSelector + Delete(context.Context, *DeleteOptions) error // Wait waits for all of the provided `Resources` to be ready by calling // the `WaitFunc` of each resource until all of them returns `true` @@ -78,6 +79,12 @@ type ( WaitFunc WaitFunc } + DeleteOptions struct { + LabelSelector string + ResourceTypes []string + Timeout time.Duration + } + WaitOptions struct { // Inverval the duration between each iteration of calling all of the resources' `WaitFunc`s. Interval time.Duration @@ -209,18 +216,24 @@ func (f *factory) Apply(ctx context.Context, namespace string, manifests []byte) return cmd.ExecuteContext(ctx) } -func (f *factory) Delete(ctx context.Context, resourceTypes []string, labelSelector string) error { +func (f *factory) Delete(ctx context.Context, opts *DeleteOptions) error { + timeout := defaultPollTimeout + if opts.Timeout > 0 { + timeout = opts.Timeout + } + o := &del.DeleteOptions{ IOStreams: DefaultIOStreams(), CascadingStrategy: metav1.DeletePropagationForeground, DeleteAllNamespaces: true, - LabelSelector: labelSelector, + LabelSelector: opts.LabelSelector, + Timeout: timeout, WaitForDeletion: true, } cmd := &cobra.Command{ RunE: func(cmd *cobra.Command, _ []string) error { - args := strings.Join(resourceTypes, ",") + args := strings.Join(opts.ResourceTypes, ",") if err := o.Complete(f.f, []string{args}, cmd); err != nil { return err } diff --git a/pkg/kube/mocks/kube.go b/pkg/kube/mocks/kube.go index 6133ad9a..040f63ae 100644 --- a/pkg/kube/mocks/kube.go +++ b/pkg/kube/mocks/kube.go @@ -32,13 +32,13 @@ func (_m *Factory) Apply(ctx context.Context, namespace string, manifests []byte return r0 } -// Delete provides a mock function with given fields: ctx, resourceTypes, labelSelector -func (_m *Factory) Delete(ctx context.Context, resourceTypes []string, labelSelector string) error { - ret := _m.Called(ctx, resourceTypes, labelSelector) +// Delete provides a mock function with given fields: _a0, _a1 +func (_m *Factory) Delete(_a0 context.Context, _a1 *kube.DeleteOptions) error { + ret := _m.Called(_a0, _a1) var r0 error - if rf, ok := ret.Get(0).(func(context.Context, []string, string) error); ok { - r0 = rf(ctx, resourceTypes, labelSelector) + if rf, ok := ret.Get(0).(func(context.Context, *kube.DeleteOptions) error); ok { + r0 = rf(_a0, _a1) } else { r0 = ret.Error(0) } From b77e986fff9a605359554af354e407f2d91296e9 Mon Sep 17 00:00:00 2001 From: Noam Gal Date: Mon, 5 Jul 2021 17:04:57 +0300 Subject: [PATCH 12/14] added docs --- docs/Getting-Started.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/Getting-Started.md b/docs/Getting-Started.md index 3e860edc..ab3edf79 100644 --- a/docs/Getting-Started.md +++ b/docs/Getting-Started.md @@ -77,3 +77,9 @@ After the application is created, and after Argo CD has finished its sync cycle, And the "hello-world" application will also be deployed to the cluster: ![Step 3](assets/getting_started_3.png) + +## Uninstall everything when done +The following command will clear your entire GitOps Repository of related files, and your k8s cluster from any resources autopilot resources +``` +argocd-autopilot repo uninstall +``` From 7552c395bf4a3d4dcda59d1d0db380762ed882a7 Mon Sep 17 00:00:00 2001 From: Noam Gal Date: Mon, 5 Jul 2021 17:52:15 +0300 Subject: [PATCH 13/14] format + comments --- manifests/kustomization.yaml | 55 ++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/manifests/kustomization.yaml b/manifests/kustomization.yaml index 796607d6..69771e54 100644 --- a/manifests/kustomization.yaml +++ b/manifests/kustomization.yaml @@ -11,31 +11,32 @@ configMapGenerator: literals: - "timeout.reconciliation=20s" -# currently in use since we are on 2.0.4 patches: -- target: - group: rbac.authorization.k8s.io - version: v1 - kind: ClusterRoleBinding - patch: |- - - op: replace - path: /subjects/0/namespace - value: default -- patch: |- - apiVersion: apps/v1 - kind: StatefulSet - metadata: - name: argocd-application-controller - spec: - template: - spec: - containers: - - name: argocd-application-controller - command: - - argocd-application-controller - - --status-processors - - "20" - - --operation-processors - - "10" - - --app-resync - - "20" + # reset the crbs to `subject.namespace: default`, so that argo-cd will later change them to the actual ns + - target: + group: rbac.authorization.k8s.io + version: v1 + kind: ClusterRoleBinding + patch: |- + - op: replace + path: /subjects/0/namespace + value: default + # currently in use since we are on 2.0.4 + - patch: |- + apiVersion: apps/v1 + kind: StatefulSet + metadata: + name: argocd-application-controller + spec: + template: + spec: + containers: + - name: argocd-application-controller + command: + - argocd-application-controller + - --status-processors + - "20" + - --operation-processors + - "10" + - --app-resync + - "20" From ae1a97147d165549bd8c0fc29f8017cc1d06816c Mon Sep 17 00:00:00 2001 From: Noam Gal Date: Mon, 5 Jul 2021 18:18:20 +0300 Subject: [PATCH 14/14] fixed tests --- cmd/commands/repo_test.go | 98 ++++++++++++++++++++++++++++----------- 1 file changed, 72 insertions(+), 26 deletions(-) diff --git a/cmd/commands/repo_test.go b/cmd/commands/repo_test.go index 7cfb7879..4be2615b 100644 --- a/cmd/commands/repo_test.go +++ b/cmd/commands/repo_test.go @@ -520,16 +520,22 @@ func Test_deleteClusterResources(t *testing.T) { "Should delete all resources": { beforeFn: func() kube.Factory { mf := &kubemocks.Factory{} - mf.On("Delete", mock.Anything, []string{"applications", "secrets"}, store.Default.LabelKeyAppManagedBy+"="+store.Default.LabelValueManagedBy).Return(nil) - mf.On("Delete", mock.Anything, []string{ - "all", - "configmaps", - "secrets", - "serviceaccounts", - "networkpolicies", - "rolebindings", - "roles", - }, argocdcommon.LabelKeyAppInstance+"="+store.Default.ArgoCDName).Return(nil) + mf.On("Delete", mock.Anything, &kube.DeleteOptions{ + LabelSelector: store.Default.LabelKeyAppManagedBy + "=" + store.Default.LabelValueManagedBy, + ResourceTypes: []string{"applications", "secrets"}, + }).Return(nil) + mf.On("Delete", mock.Anything, &kube.DeleteOptions{ + LabelSelector: argocdcommon.LabelKeyAppInstance + "=" + store.Default.ArgoCDName, + ResourceTypes: []string{ + "all", + "configmaps", + "secrets", + "serviceaccounts", + "networkpolicies", + "rolebindings", + "roles", + }, + }).Return(nil) return mf }, assertFn: func(t *testing.T, f kube.Factory, err error) { @@ -540,7 +546,10 @@ func Test_deleteClusterResources(t *testing.T) { "Should fail if failed to delete argocd-autopilot resources": { beforeFn: func() kube.Factory { mf := &kubemocks.Factory{} - mf.On("Delete", mock.Anything, []string{"applications", "secrets"}, store.Default.LabelKeyAppManagedBy+"="+store.Default.LabelValueManagedBy).Return(errors.New("some error")) + mf.On("Delete", mock.Anything, &kube.DeleteOptions{ + LabelSelector: store.Default.LabelKeyAppManagedBy + "=" + store.Default.LabelValueManagedBy, + ResourceTypes: []string{"applications", "secrets"}, + }).Return(errors.New("some error")) return mf }, assertFn: func(t *testing.T, f kube.Factory, err error) { @@ -551,16 +560,22 @@ func Test_deleteClusterResources(t *testing.T) { "Should fail if failed to delete Argo-CD resources": { beforeFn: func() kube.Factory { mf := &kubemocks.Factory{} - mf.On("Delete", mock.Anything, []string{"applications", "secrets"}, store.Default.LabelKeyAppManagedBy+"="+store.Default.LabelValueManagedBy).Return(nil) - mf.On("Delete", mock.Anything, []string{ - "all", - "configmaps", - "secrets", - "serviceaccounts", - "networkpolicies", - "rolebindings", - "roles", - }, argocdcommon.LabelKeyAppInstance+"="+store.Default.ArgoCDName).Return(errors.New("some error")) + mf.On("Delete", mock.Anything, &kube.DeleteOptions{ + LabelSelector: store.Default.LabelKeyAppManagedBy + "=" + store.Default.LabelValueManagedBy, + ResourceTypes: []string{"applications", "secrets"}, + }).Return(nil) + mf.On("Delete", mock.Anything, &kube.DeleteOptions{ + LabelSelector: argocdcommon.LabelKeyAppInstance + "=" + store.Default.ArgoCDName, + ResourceTypes: []string{ + "all", + "configmaps", + "secrets", + "serviceaccounts", + "networkpolicies", + "rolebindings", + "roles", + }, + }).Return(errors.New("some error")) return mf }, assertFn: func(t *testing.T, f kube.Factory, err error) { @@ -611,7 +626,10 @@ func TestRunRepoUninstall(t *testing.T) { beforeFn: func(r *gitmocks.Repository, f *kubemocks.Factory) { r.On("Persist", mock.Anything, &git.PushOptions{CommitMsg: "Autopilot Uninstall"}).Return("revision", nil) f.On("Wait", mock.Anything, mock.Anything).Return(nil) - f.On("Delete", mock.Anything, mock.Anything, mock.Anything).Return(errors.New("some error")) + f.On("Delete", mock.Anything, &kube.DeleteOptions{ + LabelSelector: store.Default.LabelKeyAppManagedBy + "=" + store.Default.LabelValueManagedBy, + ResourceTypes: []string{"applications", "secrets"}, + }).Return(errors.New("some error")) }, }, "Should fail if 2nd Persist fails": { @@ -620,8 +638,22 @@ func TestRunRepoUninstall(t *testing.T) { r.On("Persist", mock.Anything, &git.PushOptions{CommitMsg: "Autopilot Uninstall"}).Return("revision", nil) r.On("Persist", mock.Anything, &git.PushOptions{CommitMsg: "Autopilot Uninstall, deleted leftovers"}).Return("", errors.New("some error")) f.On("Wait", mock.Anything, mock.Anything).Return(nil) - f.On("Delete", mock.Anything, mock.Anything, store.Default.LabelKeyAppManagedBy+"="+store.Default.LabelValueManagedBy).Return(nil) - f.On("Delete", mock.Anything, mock.Anything, argocdcommon.LabelKeyAppInstance+"="+store.Default.ArgoCDName).Return(nil) + f.On("Delete", mock.Anything, &kube.DeleteOptions{ + LabelSelector: store.Default.LabelKeyAppManagedBy + "=" + store.Default.LabelValueManagedBy, + ResourceTypes: []string{"applications", "secrets"}, + }).Return(nil) + f.On("Delete", mock.Anything, &kube.DeleteOptions{ + LabelSelector: argocdcommon.LabelKeyAppInstance + "=" + store.Default.ArgoCDName, + ResourceTypes: []string{ + "all", + "configmaps", + "secrets", + "serviceaccounts", + "networkpolicies", + "rolebindings", + "roles", + }, + }).Return(nil) }, }, "Should succeed if no errors": { @@ -629,8 +661,22 @@ func TestRunRepoUninstall(t *testing.T) { r.On("Persist", mock.Anything, &git.PushOptions{CommitMsg: "Autopilot Uninstall"}).Return("revision", nil) r.On("Persist", mock.Anything, &git.PushOptions{CommitMsg: "Autopilot Uninstall, deleted leftovers"}).Return("", nil) f.On("Wait", mock.Anything, mock.Anything).Return(nil) - f.On("Delete", mock.Anything, mock.Anything, store.Default.LabelKeyAppManagedBy+"="+store.Default.LabelValueManagedBy).Return(nil) - f.On("Delete", mock.Anything, mock.Anything, argocdcommon.LabelKeyAppInstance+"="+store.Default.ArgoCDName).Return(nil) + f.On("Delete", mock.Anything, &kube.DeleteOptions{ + LabelSelector: store.Default.LabelKeyAppManagedBy + "=" + store.Default.LabelValueManagedBy, + ResourceTypes: []string{"applications", "secrets"}, + }).Return(nil) + f.On("Delete", mock.Anything, &kube.DeleteOptions{ + LabelSelector: argocdcommon.LabelKeyAppInstance + "=" + store.Default.ArgoCDName, + ResourceTypes: []string{ + "all", + "configmaps", + "secrets", + "serviceaccounts", + "networkpolicies", + "rolebindings", + "roles", + }, + }).Return(nil) }, }, }