diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml new file mode 100644 index 0000000000000000000000000000000000000000..0deb0910f37fad711322b3f107b991b4409ce3a8 --- /dev/null +++ b/.github/workflows/docs.yaml @@ -0,0 +1,22 @@ +name: Publish docs via GitHub Pages +on: + push: + branches: + - docs* + - master + +jobs: + build: + name: Deploy docs + runs-on: ubuntu-latest + steps: + - name: Checkout master + uses: actions/checkout@v1 + - name: Copy assets + run: | + cp install/tk.sh docs/install.sh + - name: Deploy docs + uses: mhausenblas/mkdocs-deploy-gh-pages@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CUSTOM_DOMAIN: toolkit.fluxcd.io diff --git a/cmd/tk/bootstrap_gitlab.go b/cmd/tk/bootstrap_gitlab.go index 0ec0e5ac0acedce54a2fb180b351005d7e38a0de..4a950b008afdf850d978ed714f29a713efef5b33 100644 --- a/cmd/tk/bootstrap_gitlab.go +++ b/cmd/tk/bootstrap_gitlab.go @@ -18,7 +18,7 @@ var bootstrapGitLabCmd = &cobra.Command{ Use: "gitlab", Short: "Bootstrap GitLab repository", Long: ` -The bootstrap command creates the GitHub repository if it doesn't exists and +The bootstrap command creates the GitLab repository if it doesn't exists and commits the toolkit components manifests to the master branch. Then it configure the target cluster to synchronize with the repository. If the toolkit components are present on the cluster, @@ -35,7 +35,7 @@ the bootstrap command will perform an upgrade if needed.`, # Run bootstrap for a public repository on a personal account bootstrap gitlab --owner=<user> --repository=<repo name> --private=false --personal=true - # Run bootstrap for a private repo hosted on GitLab server + # Run bootstrap for a private repo hosted on a GitLab server bootstrap gitlab --owner=<group> --repository=<repo name> --hostname=<domain> `, RunE: bootstrapGitLabCmdRun, @@ -52,7 +52,7 @@ var ( ) func init() { - bootstrapGitLabCmd.Flags().StringVar(&glOwner, "owner", "", "GitLab user or organization name") + bootstrapGitLabCmd.Flags().StringVar(&glOwner, "owner", "", "GitLab user or group name") bootstrapGitLabCmd.Flags().StringVar(&glRepository, "repository", "", "GitLab repository name") bootstrapGitLabCmd.Flags().BoolVar(&glPersonal, "personal", false, "is personal repository") bootstrapGitLabCmd.Flags().BoolVar(&glPrivate, "private", true, "is private repository") diff --git a/docs/_files/flux-icon.svg b/docs/_files/flux-icon.svg new file mode 100644 index 0000000000000000000000000000000000000000..36ad500efbf9562e7ea69d292b5f88bf9626daa4 --- /dev/null +++ b/docs/_files/flux-icon.svg @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8"?> +<svg width="64px" height="64px" viewBox="0 0 64 64" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"> + <!-- Generator: Sketch 56.3 (81716) - https://sketch.com --> + <title>flux-icon</title> + <desc>Created with Sketch.</desc> + <g id="flux-icon" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"> + <g id="Group" transform="translate(11.000000, 2.000000)"> + <path d="M0.803134615,15.7791346 C-0.246288462,15.0966346 -0.246288462,13.5602885 0.803134615,12.8783654 L20.1819808,0.279519231 C20.7554423,-0.0931730769 21.4944808,-0.0931730769 22.0679423,0.279519231 L41.4473654,12.8783654 C42.4967885,13.5602885 42.4967885,15.0966346 41.4473654,15.7791346 L22.0679423,28.3779808 C21.4944808,28.7506731 20.7554423,28.7506731 20.1819808,28.3779808 L0.803134615,15.7791346 Z" id="Fill-1" fill="#326CE5"></path> + <path d="M24.1851346,18.0023077 L25.5293654,18.0023077 C26.3145577,18.0023077 26.8055192,17.1525 26.4126346,16.4728846 L22.0084038,8.84423077 C21.6160962,8.16461538 20.63475,8.16461538 20.2418654,8.84423077 L15.8376346,16.4728846 C15.4453269,17.1525 15.9357115,18.0023077 16.7209038,18.0023077 L18.0657115,18.0023077 C18.6287885,18.0023077 19.0851346,18.4592308 19.0851346,19.0223077 L19.0851346,27.7298077 L19.9874423,28.3165385 C20.6791731,28.7665385 21.5710962,28.7665385 22.2628269,28.3165385 L23.1651346,27.7298077 L23.1651346,19.0223077 C23.1651346,18.4592308 23.6214808,18.0023077 24.1851346,18.0023077" id="Fill-3" fill="#C1D2F7"></path> + <path d="M27.8390769,34.8375577 L23.1648462,31.7989038 L23.1648462,33.2389038 C24.6902308,33.8919808 26.2588846,34.4008269 27.8390769,34.8375577" id="Fill-5" fill="#326CE5"></path> + <path d="M23.1650769,35.8280192 L23.1650769,37.8495577 C24.7095,38.3209038 26.2723846,38.7080192 27.8191154,39.0893654 C32.8706538,40.3349423 37.6418077,41.5107115 41.4783462,45.3478269 C41.6733462,45.54225 41.8562308,45.7407115 42.0373846,45.93975 C42.4308462,45.1880192 42.2335385,44.1957115 41.4466154,43.6845577 L33.8560385,38.7489808 C32.0133462,38.1409038 30.1360385,37.6759038 28.2806538,37.2189808 C26.5308462,36.7874423 24.8196923,36.3570577 23.1650769,35.8280192" id="Fill-7" fill="#326CE5"></path> + <path d="M19.08525,34.1699423 C18.4304423,33.8318654 17.7854423,33.4689808 17.1629423,33.0489808 L15.4269808,34.1774423 C16.5975577,35.0382115 17.8235192,35.7362885 19.08525,36.3212885 L19.08525,34.1699423 Z" id="Fill-9" fill="#326CE5"></path> + <path d="M24.8941731,40.6051154 C24.3137885,40.4620385 23.7374423,40.3195385 23.1651346,40.1735769 L23.1651346,42.1605 C23.5885962,42.2666538 24.0114808,42.3722308 24.4326346,42.4760769 C29.4841731,43.7210769 34.2553269,44.8968462 38.0924423,48.7339615 C38.0987885,48.7408846 38.1045577,48.7472308 38.1114808,48.7541538 L39.75225,47.6868462 C39.6524423,47.5824231 39.5584038,47.4751154 39.4545577,47.3718462 C35.2384038,43.1551154 29.9791731,41.8587692 24.8941731,40.6051154" id="Fill-11" fill="#326CE5"></path> + <path d="M19.08525,38.9907115 C16.8900577,38.2389808 14.8096731,37.2714808 12.9115962,35.8124423 L11.2119808,36.9178269 C13.6287115,38.9110962 16.3194808,40.1203269 19.08525,41.0168654 L19.08525,38.9907115 Z" id="Fill-13" fill="#326CE5"></path> + <path d="M19.08525,43.3809808 C15.3069808,42.3909808 11.7537115,41.18175 8.71794231,38.5388654 L7.04717308,39.6252115 C10.6125577,42.9102115 14.8540962,44.2832885 19.08525,45.3707885 L19.08525,43.3809808 Z" id="Fill-15" fill="#326CE5"></path> + <path d="M23.1650769,46.3935 C27.1175769,47.4140769 30.8341154,48.6342692 33.9823846,51.4381154 L35.6439231,50.3581154 C31.9654615,46.9000385 27.5514231,45.5194615 23.1650769,44.4048462 L23.1650769,46.3935 Z" id="Fill-17" fill="#326CE5"></path> + <path d="M4.57875,41.2299231 L2.92990385,42.3018462 C2.98759615,42.3612692 3.04009615,42.423 3.09951923,42.4818462 C7.31625,46.6985769 12.5743269,47.9949231 17.6599038,49.2485769 C22.0641346,50.3337692 26.2543269,51.3687692 29.7989423,54.1581923 L31.4893269,53.0591538 C27.4958654,49.6968462 22.7385577,48.5158846 18.1214423,47.3781923 C13.1206731,46.1453077 8.39567308,44.9758846 4.57875,41.2299231" id="Fill-19" fill="#326CE5"></path> + <path d="M1.07555769,44.5060962 C0.883442308,44.3139808 0.702865385,44.1184038 0.524019231,43.9216731 C-0.227711538,44.6745577 -0.139442308,45.9726346 0.80325,46.5853269 L6.50959615,50.2955192 C9.03536538,51.3409038 11.6765192,51.9945577 14.2738269,52.6349423 C18.3284423,53.6341731 22.2019038,54.5924423 25.5578654,56.9157115 L27.2834423,55.7930192 C23.4676731,52.9245577 19.0403654,51.8255192 14.7347885,50.7639808 C9.68382692,49.5189808 4.91267308,48.3432115 1.07555769,44.5060962" id="Fill-21" fill="#326CE5"></path> + <path d="M19.6441154,58.8342692 C20.0243077,59.0188846 20.3998846,59.2133077 20.7691154,59.4221538 C21.2093077,59.5150385 21.6771923,59.4383077 22.0683462,59.1838846 L23.0260385,58.5613846 C19.9493077,56.5035 16.5287308,55.461 13.1196923,54.5927308 L19.6441154,58.8342692 Z" id="Fill-23" fill="#326CE5"></path> + </g> + </g> +</svg> \ No newline at end of file diff --git a/docs/_files/flux-icon@2x.png b/docs/_files/flux-icon@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..c6293d3013a1adfe8deacabc6544782f22564929 Binary files /dev/null and b/docs/_files/flux-icon@2x.png differ diff --git a/docs/_static/custom.css b/docs/_static/custom.css new file mode 100644 index 0000000000000000000000000000000000000000..0c7edb7a6b318694d1864a9fdfde7c4e949eed8e --- /dev/null +++ b/docs/_static/custom.css @@ -0,0 +1,24 @@ +@import url("https://fonts.googleapis.com/css?family=Montserrat&display=swap"); + +body { + font-family: "Montserrat", sans-serif; +} + +.md-logo { + width: 40px; + height: 40px; + padding-bottom: 2px; + padding-top: 2px; +} +.md-logo img { + width: 40px; + height: 40px; +} + +.md-header, .md-footer-nav { + background-image: linear-gradient(45deg, rgb(0, 150, 225) 0%, rgb(27, 141, 226) 24%, rgb(42, 125, 227) 53%, rgb(53, 112, 227) 78%, rgb(53, 112, 227) 100%); +} + +.md-header-nav__title { + font-size: .85rem; +} diff --git a/docs/cmd/tk.md b/docs/cmd/tk.md index 4381649debcdc7be74f051b4cabccd2433f04934..7e5e417457df838e387f40e27d566a2e07424aa9 100644 --- a/docs/cmd/tk.md +++ b/docs/cmd/tk.md @@ -90,4 +90,4 @@ Command line utility for assembling Kubernetes CD pipelines the GitOps way. * [tk sync](tk_sync.md) - Synchronize commands * [tk uninstall](tk_uninstall.md) - Uninstall the toolkit components -###### Auto generated by spf13/cobra on 18-Jun-2020 +###### Auto generated by spf13/cobra on 19-Jun-2020 diff --git a/docs/cmd/tk_bootstrap.md b/docs/cmd/tk_bootstrap.md index 09227700e2bb375144a22b2874a1577b45f68fd7..6ceb6cf03812079f20de68e9180cb612edfc39bc 100644 --- a/docs/cmd/tk_bootstrap.md +++ b/docs/cmd/tk_bootstrap.md @@ -29,4 +29,4 @@ Bootstrap commands * [tk bootstrap github](tk_bootstrap_github.md) - Bootstrap GitHub repository * [tk bootstrap gitlab](tk_bootstrap_gitlab.md) - Bootstrap GitLab repository -###### Auto generated by spf13/cobra on 18-Jun-2020 +###### Auto generated by spf13/cobra on 19-Jun-2020 diff --git a/docs/cmd/tk_bootstrap_github.md b/docs/cmd/tk_bootstrap_github.md index 80c4bf654f77208ea48bc098b9fb8792c5d61017..7ffcd2a356941ae3a596e00c24457c198a426e45 100644 --- a/docs/cmd/tk_bootstrap_github.md +++ b/docs/cmd/tk_bootstrap_github.md @@ -67,4 +67,4 @@ tk bootstrap github [flags] * [tk bootstrap](tk_bootstrap.md) - Bootstrap commands -###### Auto generated by spf13/cobra on 18-Jun-2020 +###### Auto generated by spf13/cobra on 19-Jun-2020 diff --git a/docs/cmd/tk_bootstrap_gitlab.md b/docs/cmd/tk_bootstrap_gitlab.md index 983ede4cf0404783d6fb755bdbf25f1876d76997..ddb587a818f208d590b2f9eebf5bfe6458ddce03 100644 --- a/docs/cmd/tk_bootstrap_gitlab.md +++ b/docs/cmd/tk_bootstrap_gitlab.md @@ -5,7 +5,7 @@ Bootstrap GitLab repository ### Synopsis -The bootstrap command creates the GitHub repository if it doesn't exists and +The bootstrap command creates the GitLab repository if it doesn't exists and commits the toolkit components manifests to the master branch. Then it configure the target cluster to synchronize with the repository. If the toolkit components are present on the cluster, @@ -30,7 +30,7 @@ tk bootstrap gitlab [flags] # Run bootstrap for a public repository on a personal account bootstrap gitlab --owner=<user> --repository=<repo name> --private=false --personal=true - # Run bootstrap for a private repo hosted on GitLab server + # Run bootstrap for a private repo hosted on a GitLab server bootstrap gitlab --owner=<group> --repository=<repo name> --hostname=<domain> ``` @@ -41,7 +41,7 @@ tk bootstrap gitlab [flags] -h, --help help for gitlab --hostname string GitLab hostname (default "gitlab.com") --interval duration sync interval (default 1m0s) - --owner string GitLab user or organization name + --owner string GitLab user or group name --path string repository path, when specified the cluster sync will be scoped to this path --personal is personal repository --private is private repository (default true) @@ -63,4 +63,4 @@ tk bootstrap gitlab [flags] * [tk bootstrap](tk_bootstrap.md) - Bootstrap commands -###### Auto generated by spf13/cobra on 18-Jun-2020 +###### Auto generated by spf13/cobra on 19-Jun-2020 diff --git a/docs/cmd/tk_check.md b/docs/cmd/tk_check.md index de378dc8c02f42f720baec47bf906bcf20e95733..f0a58cadde83343e2c6153ee99b3afaa6b9a5eab 100644 --- a/docs/cmd/tk_check.md +++ b/docs/cmd/tk_check.md @@ -44,4 +44,4 @@ tk check [flags] * [tk](tk.md) - Command line utility for assembling Kubernetes CD pipelines -###### Auto generated by spf13/cobra on 18-Jun-2020 +###### Auto generated by spf13/cobra on 19-Jun-2020 diff --git a/docs/cmd/tk_completion.md b/docs/cmd/tk_completion.md index 904dbedf94e133c2b7011348f098efef492cf9d0..4a1b24d8dafb3e72718e0f8beca5810cc5aa86ac 100644 --- a/docs/cmd/tk_completion.md +++ b/docs/cmd/tk_completion.md @@ -44,4 +44,4 @@ To configure your bash shell to load completions for each session add to your ba * [tk](tk.md) - Command line utility for assembling Kubernetes CD pipelines -###### Auto generated by spf13/cobra on 18-Jun-2020 +###### Auto generated by spf13/cobra on 19-Jun-2020 diff --git a/docs/cmd/tk_create.md b/docs/cmd/tk_create.md index 4441d63d05d8bdc7c41f4b2b1b7e0673f4007024..824010a371e8b49bfb69c9dec1f14b440c5b4c30 100644 --- a/docs/cmd/tk_create.md +++ b/docs/cmd/tk_create.md @@ -30,4 +30,4 @@ Create commands * [tk create kustomization](tk_create_kustomization.md) - Create or update a kustomization resource * [tk create source](tk_create_source.md) - Create source commands -###### Auto generated by spf13/cobra on 18-Jun-2020 +###### Auto generated by spf13/cobra on 19-Jun-2020 diff --git a/docs/cmd/tk_create_kustomization.md b/docs/cmd/tk_create_kustomization.md index 1242decba7c75cb818e32c35f5134983827ff9ef..482ef3c41bb27b3cc9fc4d11403e3c44094a7eb9 100644 --- a/docs/cmd/tk_create_kustomization.md +++ b/docs/cmd/tk_create_kustomization.md @@ -78,4 +78,4 @@ tk create kustomization [name] [flags] * [tk create](tk_create.md) - Create commands -###### Auto generated by spf13/cobra on 18-Jun-2020 +###### Auto generated by spf13/cobra on 19-Jun-2020 diff --git a/docs/cmd/tk_create_source.md b/docs/cmd/tk_create_source.md index e4566e02f59b06ae091e37da4650216c6e382a05..53c22c00526a9d01b6295dabad6eb5ae7d1fcfac 100644 --- a/docs/cmd/tk_create_source.md +++ b/docs/cmd/tk_create_source.md @@ -29,4 +29,4 @@ Create source commands * [tk create](tk_create.md) - Create commands * [tk create source git](tk_create_source_git.md) - Create or update a git source -###### Auto generated by spf13/cobra on 18-Jun-2020 +###### Auto generated by spf13/cobra on 19-Jun-2020 diff --git a/docs/cmd/tk_create_source_git.md b/docs/cmd/tk_create_source_git.md index 2ab7804519f1e9ee0ba41c4909a4049783b9f171..b541621720b3b26bb8d6b9231c0c08df322a6a5d 100644 --- a/docs/cmd/tk_create_source_git.md +++ b/docs/cmd/tk_create_source_git.md @@ -58,7 +58,7 @@ tk create source git [name] [flags] --branch string git branch (default "master") -h, --help help for git -p, --password string basic authentication password - --ssh-ecdsa-curve ecdsaCurve SSH ECDSA public key curve (p256, p384, p521) (default p384) + --ssh-ecdsa-curve ecdsaCurve SSH ECDSA public key curve (p384, p521, p256) (default p384) --ssh-key-algorithm publicKeyAlgorithm SSH public key algorithm (rsa, ecdsa, ed25519) (default rsa) --ssh-rsa-bits rsaKeyBits SSH RSA public key bit size (multiplies of 8) (default 2048) --tag string git tag @@ -83,4 +83,4 @@ tk create source git [name] [flags] * [tk create source](tk_create_source.md) - Create source commands -###### Auto generated by spf13/cobra on 18-Jun-2020 +###### Auto generated by spf13/cobra on 19-Jun-2020 diff --git a/docs/cmd/tk_delete.md b/docs/cmd/tk_delete.md index 438aaf651bafddf1ccfa86ab3a6bccbc5f8a9923..21e7b9ae7c466cf72ae3bd174a26b5729772685e 100644 --- a/docs/cmd/tk_delete.md +++ b/docs/cmd/tk_delete.md @@ -29,4 +29,4 @@ Delete commands * [tk delete kustomization](tk_delete_kustomization.md) - Delete kustomization * [tk delete source](tk_delete_source.md) - Delete sources commands -###### Auto generated by spf13/cobra on 18-Jun-2020 +###### Auto generated by spf13/cobra on 19-Jun-2020 diff --git a/docs/cmd/tk_delete_kustomization.md b/docs/cmd/tk_delete_kustomization.md index 4cc8db77b6f21c9060b905b8759e1d229c84316a..946c630596555d802250ba50518c618e99068dab 100644 --- a/docs/cmd/tk_delete_kustomization.md +++ b/docs/cmd/tk_delete_kustomization.md @@ -31,4 +31,4 @@ tk delete kustomization [name] [flags] * [tk delete](tk_delete.md) - Delete commands -###### Auto generated by spf13/cobra on 18-Jun-2020 +###### Auto generated by spf13/cobra on 19-Jun-2020 diff --git a/docs/cmd/tk_delete_source.md b/docs/cmd/tk_delete_source.md index 78184fac36d470d9dc4e6f8b5944330fb08e1ac3..e0d3c699c54d4ad3f05ac1e12efe33594ab19ec1 100644 --- a/docs/cmd/tk_delete_source.md +++ b/docs/cmd/tk_delete_source.md @@ -28,4 +28,4 @@ Delete sources commands * [tk delete](tk_delete.md) - Delete commands * [tk delete source git](tk_delete_source_git.md) - Delete git source -###### Auto generated by spf13/cobra on 18-Jun-2020 +###### Auto generated by spf13/cobra on 19-Jun-2020 diff --git a/docs/cmd/tk_delete_source_git.md b/docs/cmd/tk_delete_source_git.md index 57b315fdf2705a967ea53d3c51f137e8952ab145..df90c79d3ec3400e8a739809a5ec141d3c6edfd0 100644 --- a/docs/cmd/tk_delete_source_git.md +++ b/docs/cmd/tk_delete_source_git.md @@ -31,4 +31,4 @@ tk delete source git [name] [flags] * [tk delete source](tk_delete_source.md) - Delete sources commands -###### Auto generated by spf13/cobra on 18-Jun-2020 +###### Auto generated by spf13/cobra on 19-Jun-2020 diff --git a/docs/cmd/tk_export.md b/docs/cmd/tk_export.md index fe894afaea177dccc745d5becc74efdf3ddbcb0c..9b930882c824af810f4f36b674c86ede45980a6d 100644 --- a/docs/cmd/tk_export.md +++ b/docs/cmd/tk_export.md @@ -29,4 +29,4 @@ Export commands * [tk export kustomization](tk_export_kustomization.md) - Export kustomization in YAML format * [tk export source](tk_export_source.md) - Export source commands -###### Auto generated by spf13/cobra on 18-Jun-2020 +###### Auto generated by spf13/cobra on 19-Jun-2020 diff --git a/docs/cmd/tk_export_kustomization.md b/docs/cmd/tk_export_kustomization.md index f855247a2f1937c3447fd2c0b2462cf1fc81d8e8..fb0f3bb0ef71b26cc01dd1f789f172789bc6e598 100644 --- a/docs/cmd/tk_export_kustomization.md +++ b/docs/cmd/tk_export_kustomization.md @@ -42,4 +42,4 @@ tk export kustomization [name] [flags] * [tk export](tk_export.md) - Export commands -###### Auto generated by spf13/cobra on 18-Jun-2020 +###### Auto generated by spf13/cobra on 19-Jun-2020 diff --git a/docs/cmd/tk_export_source.md b/docs/cmd/tk_export_source.md index 638dbea3a5e13509c24a6fe722968baf3a42c56e..df0f79306139a59bc0f15b654cfa8117a7ce2c1d 100644 --- a/docs/cmd/tk_export_source.md +++ b/docs/cmd/tk_export_source.md @@ -29,4 +29,4 @@ Export source commands * [tk export](tk_export.md) - Export commands * [tk export source git](tk_export_source_git.md) - Export git sources in YAML format -###### Auto generated by spf13/cobra on 18-Jun-2020 +###### Auto generated by spf13/cobra on 19-Jun-2020 diff --git a/docs/cmd/tk_export_source_git.md b/docs/cmd/tk_export_source_git.md index 5d41f1bbf330787ac95b6b2c735f3765e2d32592..6c2f3b4559b9a3562f46136aee38acfe4d4b031c 100644 --- a/docs/cmd/tk_export_source_git.md +++ b/docs/cmd/tk_export_source_git.md @@ -43,4 +43,4 @@ tk export source git [name] [flags] * [tk export source](tk_export_source.md) - Export source commands -###### Auto generated by spf13/cobra on 18-Jun-2020 +###### Auto generated by spf13/cobra on 19-Jun-2020 diff --git a/docs/cmd/tk_get.md b/docs/cmd/tk_get.md index afcf9f312df512d9e4b5e6abe61fae0a50d9b6ae..dbb91058eb4a74c881ff8fe0c091db05d6a8cd2d 100644 --- a/docs/cmd/tk_get.md +++ b/docs/cmd/tk_get.md @@ -28,4 +28,4 @@ Get commands * [tk get kustomizations](tk_get_kustomizations.md) - Get kustomizations status * [tk get sources](tk_get_sources.md) - Get sources commands -###### Auto generated by spf13/cobra on 18-Jun-2020 +###### Auto generated by spf13/cobra on 19-Jun-2020 diff --git a/docs/cmd/tk_get_kustomizations.md b/docs/cmd/tk_get_kustomizations.md index c7386fa0dcb9e68da0df95d1121800f1e9b40ff9..1acb49eb1aa587083b79cea05065d3b743bdd33d 100644 --- a/docs/cmd/tk_get_kustomizations.md +++ b/docs/cmd/tk_get_kustomizations.md @@ -31,4 +31,4 @@ tk get kustomizations [flags] * [tk get](tk_get.md) - Get commands -###### Auto generated by spf13/cobra on 18-Jun-2020 +###### Auto generated by spf13/cobra on 19-Jun-2020 diff --git a/docs/cmd/tk_get_sources.md b/docs/cmd/tk_get_sources.md index b70d4224005f5743672d9618fe6353ab9d516d96..dee318ce9628818ca32c8219e196e4bf4dec56c3 100644 --- a/docs/cmd/tk_get_sources.md +++ b/docs/cmd/tk_get_sources.md @@ -27,4 +27,4 @@ Get sources commands * [tk get](tk_get.md) - Get commands * [tk get sources git](tk_get_sources_git.md) - Get git sources status -###### Auto generated by spf13/cobra on 18-Jun-2020 +###### Auto generated by spf13/cobra on 19-Jun-2020 diff --git a/docs/cmd/tk_get_sources_git.md b/docs/cmd/tk_get_sources_git.md index 6a26f86b9b0f0b71729b52941605f28e8eed9f17..3b97e118e8a5c658152d29bdb09bc288140b525c 100644 --- a/docs/cmd/tk_get_sources_git.md +++ b/docs/cmd/tk_get_sources_git.md @@ -31,4 +31,4 @@ tk get sources git [flags] * [tk get sources](tk_get_sources.md) - Get sources commands -###### Auto generated by spf13/cobra on 18-Jun-2020 +###### Auto generated by spf13/cobra on 19-Jun-2020 diff --git a/docs/cmd/tk_install.md b/docs/cmd/tk_install.md index 7b077b31002d679c875bd40d1b50e7bf18504b06..65954bfa745cfa83bf3d4768f492898cc5bd3f6f 100644 --- a/docs/cmd/tk_install.md +++ b/docs/cmd/tk_install.md @@ -49,4 +49,4 @@ tk install [flags] * [tk](tk.md) - Command line utility for assembling Kubernetes CD pipelines -###### Auto generated by spf13/cobra on 18-Jun-2020 +###### Auto generated by spf13/cobra on 19-Jun-2020 diff --git a/docs/cmd/tk_resume.md b/docs/cmd/tk_resume.md index 81c2345851e09c977fd827b8ba49c31a39dd747c..78f8daae6ca22046e1f63316b816872c91c1e2f8 100644 --- a/docs/cmd/tk_resume.md +++ b/docs/cmd/tk_resume.md @@ -27,4 +27,4 @@ Resume commands * [tk](tk.md) - Command line utility for assembling Kubernetes CD pipelines * [tk resume kustomization](tk_resume_kustomization.md) - Resume kustomization -###### Auto generated by spf13/cobra on 18-Jun-2020 +###### Auto generated by spf13/cobra on 19-Jun-2020 diff --git a/docs/cmd/tk_resume_kustomization.md b/docs/cmd/tk_resume_kustomization.md index 180bc8d1a3e53d34248a01f7fe4df2114cc8560a..63eaf4ae88a88079323ef533d559c09999f7c1cb 100644 --- a/docs/cmd/tk_resume_kustomization.md +++ b/docs/cmd/tk_resume_kustomization.md @@ -30,4 +30,4 @@ tk resume kustomization [name] [flags] * [tk resume](tk_resume.md) - Resume commands -###### Auto generated by spf13/cobra on 18-Jun-2020 +###### Auto generated by spf13/cobra on 19-Jun-2020 diff --git a/docs/cmd/tk_suspend.md b/docs/cmd/tk_suspend.md index d99a4ddfd6dfe5f54bcb398ae6bfac2c09f60832..46d26484b71cb3a7c2c36db49df110e3c44a3fdf 100644 --- a/docs/cmd/tk_suspend.md +++ b/docs/cmd/tk_suspend.md @@ -27,4 +27,4 @@ Suspend commands * [tk](tk.md) - Command line utility for assembling Kubernetes CD pipelines * [tk suspend kustomization](tk_suspend_kustomization.md) - Suspend kustomization -###### Auto generated by spf13/cobra on 18-Jun-2020 +###### Auto generated by spf13/cobra on 19-Jun-2020 diff --git a/docs/cmd/tk_suspend_kustomization.md b/docs/cmd/tk_suspend_kustomization.md index eaaf8c60effc91fe491ab6caef4cb1ff9fc81fb0..973e9d1ff8be8049151001ad9722ee4877b8c2e2 100644 --- a/docs/cmd/tk_suspend_kustomization.md +++ b/docs/cmd/tk_suspend_kustomization.md @@ -30,4 +30,4 @@ tk suspend kustomization [name] [flags] * [tk suspend](tk_suspend.md) - Suspend commands -###### Auto generated by spf13/cobra on 18-Jun-2020 +###### Auto generated by spf13/cobra on 19-Jun-2020 diff --git a/docs/cmd/tk_sync.md b/docs/cmd/tk_sync.md index df50a41168642500cd0d6594f27105086eb19b1b..ddeadecf2ca33c3637bb10dddab9cd17c8903c04 100644 --- a/docs/cmd/tk_sync.md +++ b/docs/cmd/tk_sync.md @@ -28,4 +28,4 @@ Synchronize commands * [tk sync kustomization](tk_sync_kustomization.md) - Synchronize kustomization * [tk sync source](tk_sync_source.md) - Synchronize source commands -###### Auto generated by spf13/cobra on 18-Jun-2020 +###### Auto generated by spf13/cobra on 19-Jun-2020 diff --git a/docs/cmd/tk_sync_kustomization.md b/docs/cmd/tk_sync_kustomization.md index 47c2a65de3646696a9fb5b26c281baa66ad7ef1c..13e6e6bd944ee196814e36592a9b35ea9b71b8a5 100644 --- a/docs/cmd/tk_sync_kustomization.md +++ b/docs/cmd/tk_sync_kustomization.md @@ -43,4 +43,4 @@ tk sync kustomization [name] [flags] * [tk sync](tk_sync.md) - Synchronize commands -###### Auto generated by spf13/cobra on 18-Jun-2020 +###### Auto generated by spf13/cobra on 19-Jun-2020 diff --git a/docs/cmd/tk_sync_source.md b/docs/cmd/tk_sync_source.md index 7343d584d377e7a1a21ae09ad1fe4670d60d1af2..a928442c6a205a5e794302c29afea7b742f6c225 100644 --- a/docs/cmd/tk_sync_source.md +++ b/docs/cmd/tk_sync_source.md @@ -27,4 +27,4 @@ Synchronize source commands * [tk sync](tk_sync.md) - Synchronize commands * [tk sync source git](tk_sync_source_git.md) - Synchronize git source -###### Auto generated by spf13/cobra on 18-Jun-2020 +###### Auto generated by spf13/cobra on 19-Jun-2020 diff --git a/docs/cmd/tk_sync_source_git.md b/docs/cmd/tk_sync_source_git.md index cf4cf226efb1cdd573c31e9f46e52541da3f4624..3713776ce7a94c213906e9cffe311b5afe68116a 100644 --- a/docs/cmd/tk_sync_source_git.md +++ b/docs/cmd/tk_sync_source_git.md @@ -39,4 +39,4 @@ tk sync source git [name] [flags] * [tk sync source](tk_sync_source.md) - Synchronize source commands -###### Auto generated by spf13/cobra on 18-Jun-2020 +###### Auto generated by spf13/cobra on 19-Jun-2020 diff --git a/docs/cmd/tk_uninstall.md b/docs/cmd/tk_uninstall.md index 1e7e5f254658e87acc9067cff66612ed2ef538e4..c7a9c9edb65972c201f9861a3c5165e17b2cfdea 100644 --- a/docs/cmd/tk_uninstall.md +++ b/docs/cmd/tk_uninstall.md @@ -47,4 +47,4 @@ tk uninstall [flags] * [tk](tk.md) - Command line utility for assembling Kubernetes CD pipelines -###### Auto generated by spf13/cobra on 18-Jun-2020 +###### Auto generated by spf13/cobra on 19-Jun-2020 diff --git a/docs/get-started/index.md b/docs/get-started/index.md new file mode 100644 index 0000000000000000000000000000000000000000..cc2dd4610e18a02d1d2be17bc24e36cec0401384 --- /dev/null +++ b/docs/get-started/index.md @@ -0,0 +1,216 @@ +# Get started with GitOps Toolkit + +## Prerequisites + +* Kubernetes >= 1.14 +* kubectl >= 1.18 +* git + +You will need to have Kubernetes set up. +For a quick local test, you can use `minikube`, `kubeadm` or `kind`. +Any other Kubernetes setup will work as well though. + +In order to follow the guide you'll need a GitHub account and a +[personal access token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) +that can create repositories. + +## Install the toolkit CLI + +To install the latest `tk` release run: + +```bash +curl -s https://toolkit.fluxcd.io/install.sh | sudo bash +``` + +The install script downloads the tk binary to `/usr/local/bin`. +Binaries for macOS and Linux AMD64 are available for download on the +[release page](https://github.com/fluxcd/toolkit/releases). + +To configure your shell to load tk completions add to your bash profile: + +```sh +# ~/.bashrc or ~/.bash_profile +. <(tk completion) +``` + +Verify that your cluster satisfies the prerequisites with: + +```text +$ tk check --pre + +► checking prerequisites +✔ kubectl 1.18.3 >=1.18.0 +✔ kubernetes 1.16.8-eks-e16311 >=1.14.0 +✔ prerequisites checks passed +``` + +## Bootstrap + +You'll be using a dedicated Git repository e.g. `fleet-infra` to manage one or more Kubernetes clusters. + +First export your GitHub personal access token and GitHub username: + +```sh +export GITHUB_TOKEN=<your-token> +export GITHUB_USER=<your-username> +``` + +The bootstrap command creates a repository if one doesn't exist and +commits the toolkit components manifests to the master branch at the specified path. +Then it configures the target cluster to synchronize with the specified path inside the repository. + +```sh +tk bootstrap github \ + --owner=$GITHUB_USER \ + --repository=fleet-infra \ + --path=dev-cluster \ + --personal +``` + +If you wish to create the repository under a GitHub organization: + +```sh +tk bootstrap github \ + --owner=<organization> \ + --repository=<repo-name> \ + --team=<team1-slug> \ + --team=<team2-slug> \ + --path=dev-cluster +``` + +Example output: + +```text +$ tk bootstrap github --owner=gitopsrun --repository=fleet-infra --path=dev-cluster --team=devs + +► connecting to github.com +✔ repository created +✔ devs team access granted +✔ repository cloned +✚ generating manifests +✔ components manifests pushed +► installing components in gitops-system namespace +namespace/gitops-system created +customresourcedefinition.apiextensions.k8s.io/gitrepositories.source.fluxcd.io created +customresourcedefinition.apiextensions.k8s.io/helmcharts.source.fluxcd.io created +customresourcedefinition.apiextensions.k8s.io/helmrepositories.source.fluxcd.io created +customresourcedefinition.apiextensions.k8s.io/kustomizations.kustomize.fluxcd.io created +customresourcedefinition.apiextensions.k8s.io/profiles.kustomize.fluxcd.io created +role.rbac.authorization.k8s.io/crd-controller-gitops-system created +rolebinding.rbac.authorization.k8s.io/crd-controller-gitops-system created +clusterrolebinding.rbac.authorization.k8s.io/cluster-reconciler-gitops-system created +service/source-controller created +deployment.apps/kustomize-controller created +deployment.apps/source-controller created +networkpolicy.networking.k8s.io/deny-ingress created +Waiting for deployment "source-controller" rollout to finish: 0 of 1 updated replicas are available... +deployment "source-controller" successfully rolled out +deployment "kustomize-controller" successfully rolled out +✔ install completed +► configuring deploy key +✔ deploy key configured +► generating sync manifests +✔ sync manifests pushed +► applying sync manifests +◎ waiting for cluster sync +✔ bootstrap finished +``` + +If you prefer GitLab, export `GITLAB_TOKEN` env var and use the command [tk bootstrap gitlab](../cmd/tk_bootstrap_gitlab.md). + +It is safe to run the bootstrap command as many times as you want. +If the toolkit components are present on the cluster, +the bootstrap command will perform an upgrade if needed. + +## Create a GitOps workflow + +Clone the repository with: + +```sh +git clone https://github.com/$GITHUB_USER/fleet-infra +cd fleet-infra +``` + +Create a git source pointing to a public repository: + +```sh +tk create source git webapp \ + --url=https://github.com/stefanprodan/podinfo \ + --branch=master \ + --interval=30s \ + --export > ./dev-cluster/webapp-source.yaml +``` + +Create a kustomization for synchronizing the common manifests on the cluster: + +```sh +tk create kustomization webapp-common \ + --source=webapp \ + --path="./deploy/webapp/common" \ + --prune=true \ + --validate=client \ + --interval=1h \ + --export > ./dev-cluster/webapp-common.yaml +``` + +Create a kustomization for the backend service that depends on common: + +```sh +tk create kustomization webapp-backend \ + --depends-on=webapp-common \ + --source=webapp \ + --path="./deploy/webapp/backend" \ + --prune=true \ + --validate=client \ + --interval=10m \ + --health-check="Deployment/backend.webapp" \ + --health-check-timeout=2m \ + --export > ./dev-cluster/webapp-backend.yaml +``` + +Create a kustomization for the frontend service that depends on backend: + +```sh +tk create kustomization webapp-frontend \ + --depends-on=webapp-backend \ + --source=webapp \ + --path="./deploy/webapp/frontend" \ + --prune=true \ + --validate=client \ + --interval=10m \ + --health-check="Deployment/frontend.webapp" \ + --health-check-timeout=2m \ + --export > ./dev-cluster/webapp-frontend.yaml +``` + +Push changes to origin: + +```sh +git add -A && git commit -m "add webapp" && git push +``` + +In about 30s the synchronization should start: + +```text +$ watch tk get kustomizations + +✔ gitops-system last applied revision master/35d5765a1acb9e9ce66cad7274c6fe03eee1e8eb +✔ webapp-backend reconciling +✔ webapp-common last applied revision master/f43f9b2eb6766e07f318d266a99d2ec7c940b0cf +✗ webapp-frontend dependency 'gitops-system/webapp-backend' is not ready +``` + +When the synchronization finishes you can check that the webapp services are running: + +```text +$ kubectl -n webapp get deployments,services + +NAME READY UP-TO-DATE AVAILABLE AGE +deployment.apps/backend 1/1 1 1 4m1s +deployment.apps/frontend 1/1 1 1 3m31s + +NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE +service/backend ClusterIP 10.52.10.22 <none> 9898/TCP,9999/TCP 4m1s +service/frontend ClusterIP 10.52.9.85 <none> 80/TCP 3m31s +``` + diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000000000000000000000000000000000000..bca35de797dc7221a35a718502b4b9ad0c113059 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,20 @@ +# GitOps Toolkit + +The GitOps Toolkit is a set of composable APIs and specialized tools +that can be used to build a Continuous Delivery platform on top of Kubernetes. + +These tools are built with Kubernetes controller-runtime libraries and they +can be dynamically configured with Kubernetes custom resources either by +cluster admins or by other automated tools. +The GitOps Toolkit components interact with each other via Kubernetes +events and are responsible for the reconciliation of their designated API objects. + + + +Components: + +- [Toolkit CLI](https://github.com/fluxcd/toolkit) +- [Source Controller](https://github.com/fluxcd/source-controller) +- [Kustomize Controller](https://github.com/fluxcd/kustomize-controller) + +To get started with the toolkit please follow this [guide](get-started/index.md). diff --git a/install/README.md b/install/README.md index 50f6eb33e35ba60a5bf7a1b5791964c3f2a8835b..eaf937991fb193af7a01d2f950b2044637e57d36 100644 --- a/install/README.md +++ b/install/README.md @@ -15,6 +15,12 @@ The install script does the following: * copies the tk binary to `/usr/local/bin` * removes the temporary directory +If you want to use tk as a kubectl plugin, rename the binary to `kubectl-tk`: + +```sh +mv /usr/local/bin/tk /usr/local/bin/kubectl-tk +``` + ## Build from source Clone the repository: diff --git a/mkdocs.yml b/mkdocs.yml new file mode 100644 index 0000000000000000000000000000000000000000..f03df7ba93e9bf0fbf3e57227f2096e54e6feee5 --- /dev/null +++ b/mkdocs.yml @@ -0,0 +1,51 @@ +site_name: GitOps Toolkit +site_description: Documentation for GitOps Toolkit. +site_author: The Flux contributors +site_url: https://fluxcd.github.io/toolkit/ + +# Repository +repo_name: fluxcd/toolkit +repo_url: https://github.com/fluxcd/toolkit +edit_uri: "" + +theme: + name: material + logo: _files/flux-icon@2x.png + language: en + palette: + primary: blue + accent: indigo + +docs_dir: docs + +extra_css: + - _static/custom.css + +plugins: + - search + +markdown_extensions: + - admonition + - codehilite: + guess_lang: false + - toc: + permalink: true + - pymdownx.superfences: + highlight_code: true + - pymdownx.tabbed + +nav: + - Introduction: index.md + - Get Started: get-started/index.md + - Toolkit CLI: + - Bootstrap: cmd/tk_bootstrap.md + - Check: cmd/tk_check.md + - Create: cmd/tk_create.md + - Delete: cmd/tk_delete.md + - Export: cmd/tk_export.md + - Get: cmd/tk_get.md + - Install: cmd/tk_install.md + - Resume: cmd/tk_resume.md + - Suspend: cmd/tk_suspend.md + - Synchronize: cmd/tk_sync.md + - Uninstall: cmd/tk_uninstall.md