1
0
mirror of synced 2026-03-01 19:26:55 +00:00

Compare commits

..

141 Commits

Author SHA1 Message Date
Stefan Prodan
7265276cc2 Merge pull request #1454 from fluxcd/gofish
Add GoFish as an install option for Flux CLI
2021-05-28 13:08:47 +03:00
Stefan Prodan
b98027b528 Add GoFish as an install option for Flux CLI
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-05-28 12:57:02 +03:00
Stefan Prodan
b6ae7d2cdd Merge pull request #1453 from fluxcd/update-components
Update source-controller to v0.13.1
2021-05-28 12:49:09 +03:00
fluxcdbot
aa887c61c3 Update toolkit components
- source-controller to v0.13.1
  https://github.com/fluxcd/source-controller/blob/v0.13.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-05-28 09:30:21 +00:00
Hidde Beydals
700cef0989 Merge pull request #1349 from fluxcd/fix-throttling
Avoid throttling when some Flux CRDs are not registered
2021-05-26 17:42:22 +02:00
Stefan Prodan
3ed3e553e7 Avoid throttling when some Flux CRDs are not registered
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-05-26 18:29:04 +03:00
Hidde Beydals
d68158ddc9 Merge pull request #1408 from fluxcd/update-components
Update toolkit components
2021-05-26 17:06:31 +02:00
fluxcdbot
9f83a69242 Update toolkit components
- kustomize-controller to v0.12.1
  https://github.com/fluxcd/kustomize-controller/blob/v0.12.1/CHANGELOG.md
- source-controller to v0.13.0
  https://github.com/fluxcd/source-controller/blob/v0.13.0/CHANGELOG.md
- notification-controller to v0.14.1
  https://github.com/fluxcd/notification-controller/blob/v0.14.1/CHANGELOG.md
- image-automation-controller to v0.10.0
  https://github.com/fluxcd/image-automation-controller/blob/v0.10.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-05-26 14:53:26 +00:00
Hidde Beydals
bf69dbd43d Merge pull request #1449 from fluxcd/update-go-git
Update go-git to v5.4.1
2021-05-26 16:15:36 +02:00
Hidde Beydals
465ea5ccfd Update go-git to v5.4.1
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-05-26 15:56:50 +02:00
Stefan Prodan
92ef39e2ad Merge pull request #1411 from NissesSenap/feature/azure-eventhub
Add example manifests for Azure eventhub credentials renewal
2021-05-25 16:35:12 +03:00
Edvin Norling
0404790df9 How to automatically renew Azure eventhub
To use JWT to communicate with Azure eventhub we need to renew the JWT credentials
from time to time. This example yaml helps out with that
* Supports both deployment and cronjob based renewal
  * static service principal
  * aad-pod-identity in azure

Signed-off-by: Edvin Norling <edvin.norling@xenit.se>
2021-05-25 13:43:18 +02:00
Stefan Prodan
f880e93df4 Merge pull request #1415 from allymparker/main
Fix service account name in registry-credentials-sync deployment kustomization
2021-05-14 20:06:59 +03:00
Ally Parker
4697b1101d Fix service account
Signed-off-by: Ally Parker <ally.parker@red-gate.com>
2021-05-14 16:40:30 +01:00
Stefan Prodan
50ff2accd2 Merge pull request #1412 from fluxcd/enable-crd-upgrades
Enable CRDs upgrade for kube-prometheus-stack
2021-05-12 19:06:49 +03:00
Stefan Prodan
c7d876eb8f Enable CRDs upgrade for kube-prometheus-stack
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-05-12 18:40:00 +03:00
Stefan Prodan
eda392dfcd Merge pull request #1399 from SomtochiAma/kube-prometheus
Replace monitoring stack with kube-prometheus-stack
2021-05-12 09:21:34 +03:00
Somtochi Onyekwere
3b91e14f6d Use kube-prometheus-stack for monitoring
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-05-12 06:53:21 +01:00
Hidde Beydals
17e3c57d7e Merge pull request #1405 from fluxcd/update-components
Update toolkit components
2021-05-10 18:10:50 +02:00
fluxcdbot
1c744a0f97 Update toolkit components
- helm-controller to v0.10.1
  https://github.com/fluxcd/helm-controller/blob/v0.10.1/CHANGELOG.md
- source-controller to v0.12.2
  https://github.com/fluxcd/source-controller/blob/v0.12.2/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-05-10 15:58:12 +00:00
Hidde Beydals
99bdb20aeb Merge pull request #1404 from fluxcd/private-key-password 2021-05-10 16:02:06 +02:00
Hidde Beydals
fbe7050cb8 Switch to crypto/ssh for parsing of private keys
This changes the logic for the parsing of private keys, as already
done for the source-controller, so that it is able to recognize and
work with a wider range of key formats instead of returning a vague
error:

```console
$ flux bootstrap git [..]
✗ ssh: this private key is passphrase protected
```

A patch for this was already submitted and merged in `go-git/go-git`,
but is not made available in a release yet:
https://github.com/go-git/go-git/pull/298

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-05-10 15:30:25 +02:00
Hidde Beydals
12ea028aa9 Merge pull request #1379 from tjakobsson/fix-git-bootstrap-hostname
Use proper Host configuration for SSH
2021-05-10 15:23:59 +02:00
Tobias Jakobsson
ea62cb5fc9 Use proper Host configuration for SSH
This removes the usage of Hostname() which does not honor configured SSH
port to be used.

Resolves: #1377
See also: #1101, #1102

Signed-off-by: Tobias Jakobsson <jakobsson.tobias@gmail.com>
2021-05-10 15:04:09 +02:00
Stefan Prodan
d27c2164b2 Merge pull request #1394 from fluxcd/update-components
Update image-automation-controller to v0.9.1
2021-05-06 17:27:23 +03:00
fluxcdbot
ef8f5cb87d Update toolkit components
- image-automation-controller to v0.9.1
  https://github.com/fluxcd/image-automation-controller/blob/v0.9.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-05-06 14:15:14 +00:00
Stefan Prodan
378a2c2a0e Merge pull request #1393 from fluxcd/git-ref-required
Make the Git ref required
2021-05-06 16:30:16 +03:00
Stefan Prodan
2597ad0f73 Make the Git ref required
Remove the default branch value from `flux create source git` and validate that one of the ref options are specified.

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-05-06 15:28:55 +03:00
Stefan Prodan
0df34bed59 Merge pull request #1391 from SomtochiAma/grafana-dash
Update Prometheus labels and dashboard
2021-05-06 15:05:49 +03:00
Somtochi Onyekwere
be65cf8052 Change labels in prometheus and grafana dashboard
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-05-06 12:33:41 +01:00
Stefan Prodan
8922753591 Merge pull request #1390 from Callisto13/string-slice-var
Switch StringArrayVar flags to use StringSliceVar
2021-05-06 14:27:51 +03:00
Claudia Beresford
87e11ed653 Switch StringArrayVar flags to use StringSliceVar
StringSliceVar allows for more flexibility when passing vars to list
flags.
Both formats will be supported:
- '--foo=one --foo=two'
- '--foo=one,two'

Signed-off-by: Claudia Beresford <claudiaberesford@gmail.com>
2021-05-06 10:09:36 +01:00
Stefan Prodan
ab34771b3d Merge pull request #1384 from fluxcd/go-git-providers-v0.1.0
Update go-git-providers to v0.1
2021-05-06 11:31:00 +03:00
Stefan Prodan
e733c4f55a Update go-git-providers to v0.1.0
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-05-06 11:03:52 +03:00
Daniel Holbach
37b60666c4 Merge pull request #1389 from dholbach/fix-1388
Remove ' command' from Flux CLI docs title
2021-05-06 10:00:56 +02:00
Daniel Holbach
734d736bdf Remove ' command' from Flux CLI docs title
Fixes: #1388

Signed-off-by: Daniel Holbach <daniel@weave.works>
2021-05-06 08:52:36 +02:00
Daniel Holbach
8ca65059f7 Merge pull request #1381 from dholbach/toolkit-website-followup
Update more toolkit.fluxcd.io redirects
2021-05-04 22:16:41 +02:00
Daniel Holbach
086f174463 Update more toolkit.fluxcd.io redirects
Following up on #1380 some more docs links which
	now live under fluxcd.io itself.

Signed-off-by: Daniel Holbach <daniel@weave.works>
2021-05-04 17:04:44 +02:00
Daniel Holbach
48fd70fc09 Merge pull request #1380 from fluxcd/fix-links
Migrate the GitOps toolkit links to the new docs website
2021-05-04 16:59:09 +02:00
Stefan Prodan
606266e976 Migrate the GitOps toolkit links to the new docs website
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-05-04 17:46:25 +03:00
Stefan Prodan
f7006a8172 Merge pull request #1369 from fluxcd/update-components
Update toolkit components
2021-04-29 15:05:43 +03:00
fluxcdbot
653dcc8d78 Update toolkit components
- kustomize-controller to v0.12.0
  https://github.com/fluxcd/kustomize-controller/blob/v0.12.0/CHANGELOG.md
- image-reflector-controller to v0.9.1
  https://github.com/fluxcd/image-reflector-controller/blob/v0.9.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-04-29 10:07:39 +00:00
Stefan Prodan
8df140c713 Merge pull request #1365 from dholbach/fix-1221
Remove content which has moved to f/website
2021-04-29 10:24:01 +03:00
Daniel Holbach
089af9cc90 remove docs/index.md as well - it has been pulled into f/website now too
Signed-off-by: Daniel Holbach <daniel@weave.works>
2021-04-28 17:18:00 +02:00
Daniel Holbach
695fb55b13 Remove Flux CLI docs
They are imported into the docs like so:
	https://github.com/fluxcd/website/blob/main/hack/import-flux2-assets.sh#L139

Signed-off-by: Daniel Holbach <daniel@weave.works>
2021-04-28 12:10:48 +02:00
Daniel Holbach
ec21eedd56 remove content which has moved to f/website
Signed-off-by: Daniel Holbach <daniel@weave.works>
2021-04-28 12:07:34 +02:00
Stefan Prodan
5ba3774fd5 Merge pull request #1358 from SomtochiAma/suspend-all
Add suspend/resume  --all cmd
2021-04-28 12:58:46 +03:00
Somtochi Onyekwere
12a2100fcf Adds suspend and resume all cmd
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-04-28 10:44:51 +01:00
Daniel Holbach
68074d3543 Merge pull request #1364 from dholbach/update-install-url
Update install script URL
2021-04-27 16:40:33 +02:00
Daniel Holbach
18849e36c7 Update install script URL
As we don't pass '-L' to curl, the redirect is
	not followed.

Signed-off-by: Daniel Holbach <daniel@weave.works>
2021-04-27 16:26:06 +02:00
Hidde Beydals
671fe274da Merge pull request #1363 from dholbach/explain-docs
Explain where the docs went
2021-04-27 15:28:21 +02:00
Daniel Holbach
af1d9102b9 explain where docs are
keep netlify config for now (disabled in the app), but only make it ship the _redirects file
add rule for 'install.sh'
move _redirects file into docs/ directory
document redirects and Netlify

Signed-off-by: Daniel Holbach <daniel@weave.works>
2021-04-27 15:16:30 +02:00
Daniel Holbach
9dc10ef7d1 Merge pull request #1361 from dholbach/fix-1135
Stop deploy to Github pages
2021-04-27 14:32:57 +02:00
Daniel Holbach
86a3cf20e7 Stop deploying to Github pages
Fixes: #1135

Signed-off-by: Daniel Holbach <daniel@weave.works>
2021-04-27 14:20:28 +02:00
Daniel Holbach
27a42ecd8e Merge pull request #1360 from dholbach/add-redirects
add redirects file
2021-04-27 14:19:17 +02:00
Daniel Holbach
ae7a59fbb4 try out redirects file
Signed-off-by: Daniel Holbach <daniel@weave.works>
2021-04-27 13:55:16 +02:00
Hidde Beydals
598dfc32e8 Merge pull request #1359 from dholbach/add-components-docs-script
Copy docs assets for Netlify build
2021-04-27 11:36:31 +02:00
Daniel Holbach
a40d124e23 add script to copy docs assets for Netlify build
Signed-off-by: Daniel Holbach <daniel@weave.works>
2021-04-27 11:22:55 +02:00
Daniel Holbach
9df3fcab18 Merge pull request #1353 from dholbach/netlify-build
Specify netlify build
2021-04-27 11:09:33 +02:00
Daniel Holbach
b6ce969d1b Specify netlify build
Addresses: #1135

	Follow https://www.starfallprojects.co.uk/posts/deploy-mkdocs-netlify/
	to eventually fix #1135.

	I realise this litters the main directory somewhat, but I hope
	that once the publication fully works and we turn the site into
	redirects, we can remove these files again. So only a temporary
	measure.

Signed-off-by: Daniel Holbach <daniel@weave.works>
2021-04-27 09:16:06 +02:00
Stefan Prodan
6a37649ee6 Merge pull request #1352 from SomtochiAma/handle-error
Remove redundant getCommand for image repository
2021-04-26 17:50:56 +03:00
Somtochi Onyekwere
8926095660 remove redundant getCommand for image repository
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-04-26 15:28:51 +01:00
Hidde Beydals
bd34870334 Merge pull request #1336 from fluxcd/update-components 2021-04-23 12:51:40 +02:00
Hidde Beydals
a56ce1f867 build: tidy after go mod edit
To ensure the `go.sum` is always up-to-date when the following `go mod
edit` is executed.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-23 12:36:09 +02:00
fluxcdbot
dab5bbd393 Update toolkit components
- source-controller to v0.12.1
  https://github.com/fluxcd/source-controller/blob/v0.12.1/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-04-23 12:34:41 +02:00
Stefan Prodan
15ebfd7eb6 Merge pull request #1334 from fluxcd/helm-CRDsPolicy
Add upgrade CRDs policy arg to create helmrelease cmd
2021-04-23 12:29:24 +03:00
Stefan Prodan
5ab8dd2557 Add upgrade CRDs policy to create helmrelease cmd
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-04-23 10:46:46 +03:00
Stefan Prodan
9164914d16 Merge pull request #1215 from Frederik-Baetens/main
update sortable image tag guide with github.run_number
2021-04-23 09:25:20 +03:00
Frederik Baetens
c9e0bc0807 add github.run number github actions workflow example
Signed-off-by: Frederik Baetens <baetens.fr@gmail.com>
2021-04-22 22:27:46 +02:00
Frederik Baetens
61439adf9b describe github.run number as a reliable increasing build number
Signed-off-by: Frederik Baetens <baetens.fr@gmail.com>
2021-04-22 22:27:46 +02:00
Hidde Beydals
e4d7450643 Merge pull request #1332 from fluxcd/update-guide-v1alpha2
Update image automation guides to v1alpha2
2021-04-22 19:54:25 +02:00
Stefan Prodan
0fbcfded57 Update image automation migration guide to v1alpha2 APIs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-04-22 20:40:24 +03:00
Stefan Prodan
fb3a434f95 Update image automation guide to v1alpha2 APIs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-04-22 20:40:17 +03:00
Hidde Beydals
4f66da84d6 Merge pull request #1208 from defenestration/main
fix link to Mozilla SOPS Azure Guide
2021-04-22 19:38:51 +02:00
Alan B
b67e8aafab Fix Mozilla SOPS link in Azure guide
Signed-off-by: Alan B <a.brevick@techsmith.com>
2021-04-22 19:21:26 +02:00
Hidde Beydals
0b4f1d30a6 Merge pull request #1314 from SomtochiAma/ssh-key-with-password
Add password for ssh private key to create secret git
2021-04-22 19:17:33 +02:00
Somtochi Onyekwere
c494e6bf7e Inject password in create secret git if specified
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-04-22 18:33:41 +02:00
Hidde Beydals
b8c57c7901 Merge pull request #1300 from fluxcd/kustomize-bootstrap
Allow pre-bootstrap customisation of Flux components
2021-04-22 17:33:57 +02:00
Hidde Beydals
6aed4631e7 Register v1alpha2 APIs in runtime Scheme
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-22 17:10:42 +02:00
Stefan Prodan
5df9118365 Add pre-bootstrap customisation to install docs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-04-22 17:10:42 +02:00
Stefan Prodan
4a4af94d6c Allow pre-bootstrap customisation of Flux components
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-04-22 17:10:42 +02:00
Hidde Beydals
baa54fb84a Merge pull request #1330 from fluxcd/patch-update-workflow
Fix update automation and update CRDs
2021-04-22 16:48:35 +02:00
Hidde Beydals
cb6470f817 Merge pull request #1328 from fluxcd/bootstrap-team-prnt-fix
Change permission grant error print conditons
2021-04-22 16:25:26 +02:00
Hidde Beydals
1a904e138f Fix update automation and update CRDs
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-22 16:24:36 +02:00
Hidde Beydals
3b482529ff Merge pull request #1323 from fluxcd/update-apis
Update the APIs docs
2021-04-22 16:11:16 +02:00
Hidde Beydals
67997437db Change permission grant error print conditons
Based on observations in
https://github.com/fluxcd/flux2/runs/2410633975:

1. Print error correctly by switching from `%w` to `%s`
2. Only print the change messsage if there has not been an error.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-22 16:10:14 +02:00
Hidde Beydals
a5541eddca Merge pull request #1327 from fluxcd/update-components
Update toolkit components
2021-04-22 15:57:00 +02:00
Stefan Prodan
203157e525 Update the APIs docs
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-04-22 15:56:49 +02:00
fluxcdbot
655c2261ba Update toolkit components
- helm-controller to v0.10.0
  https://github.com/fluxcd/helm-controller/blob/v0.10.0/CHANGELOG.md
- kustomize-controller to v0.11.1
  https://github.com/fluxcd/kustomize-controller/blob/v0.11.1/CHANGELOG.md
- source-controller to v0.12.0
  https://github.com/fluxcd/source-controller/blob/v0.12.0/CHANGELOG.md
- notification-controller to v0.13.0
  https://github.com/fluxcd/notification-controller/blob/v0.13.0/CHANGELOG.md
- image-reflector-controller to v0.9.0
  https://github.com/fluxcd/image-reflector-controller/blob/v0.9.0/CHANGELOG.md
- image-automation-controller to v0.9.0
  https://github.com/fluxcd/image-automation-controller/blob/v0.9.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-04-22 15:42:12 +02:00
Hidde Beydals
45e446eb00 Merge pull request #1325 from fluxcd/build/include-crd-update
build: incl CRD version change in component update
2021-04-22 15:34:52 +02:00
Hidde Beydals
68abe37648 Merge pull request #1200 from kingdonb/jsonnet 2021-04-22 15:22:26 +02:00
Hidde Beydals
df6a0a3762 build: incl CRD version change in component update
This includes updating the version in the `manifests/crds` directory
for the component thas has a newer latest version.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-22 15:21:24 +02:00
Kingdon Barrett
c35bae577f Add (vestigial) reference to configMap.yaml
This part of the jsonnet example was missing a reference and needed a
bit more explanation to accompany the missing reference.

Signed-off-by: Kingdon Barrett <kingdon@weave.works>
2021-04-22 15:04:07 +02:00
Kingdon Barrett
3567941eda flux recommends real version numbers*
Signed-off-by: Kingdon Barrett <kingdon@weave.works>
2021-04-22 15:04:07 +02:00
Kingdon Barrett
3c95fe6380 change one word
Signed-off-by: Kingdon Barrett <kingdon@weave.works>
2021-04-22 15:04:07 +02:00
Kingdon Barrett
d07f0d003c add word or two
Signed-off-by: Kingdon Barrett <kingdon@weave.works>
2021-04-22 15:04:07 +02:00
Kingdon Barrett
86774309db minor formatting/verbal fixes
Signed-off-by: Kingdon Barrett <kingdon@weave.works>
2021-04-22 15:04:07 +02:00
Kingdon Barrett
427f23e32d add missing link to 04-update-fleet-infra
Signed-off-by: Kingdon Barrett <kingdon@weave.works>
2021-04-22 15:04:07 +02:00
Kingdon Barrett
70cddde16c Jsonnet examples
It is probably not elegant or idiomatic jsonnet. I am learning Jsonnet.

I believe the explanation is correct, but I still have to retry this
example for repeatability and check for completeness.

* Jsonnet example - gutted

* take some personalize things away
* clean up awkward sentence
* for real gitops

Signed-off-by: Kingdon Barrett <kingdon@weave.works>
2021-04-22 15:04:05 +02:00
Hidde Beydals
e86789b643 Merge pull request #1255 from scottrigby/use-cases-helm 2021-04-22 14:52:56 +02:00
Scott Rigby
f52fec66bd Overriding helm values, managing secrets and configmaps with kustomize plus SOPS, semver range policies, and auto uninstalls and rollbacks
Signed-off-by: Scott Rigby <scott@r6by.com>
2021-04-22 14:19:39 +02:00
Scott Rigby
f4926d1e45 Operator->Controller
Signed-off-by: Scott Rigby <scott@r6by.com>

Co-authored-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-04-22 14:19:39 +02:00
Scott Rigby
2774c1a5cd Add helm use case intro page
Signed-off-by: Scott Rigby <scott@r6by.com>
2021-04-22 14:19:39 +02:00
Hidde Beydals
8274bc0ea3 Merge pull request #1324 from fluxcd/image-update-v1alpha2
Move to `v1alpha2` image update APIs
2021-04-22 14:11:47 +02:00
Stefan Prodan
e9531e4d57 Merge pull request #1296 from arbourd/values-files
Add `ValuesFiles` documentation
2021-04-22 14:52:47 +03:00
Hidde Beydals
3a8aad7e5c Move to v1alpha2 image update APIs
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-22 13:52:03 +02:00
Dylan Arbour
ef079c5b58 Add ValuesFiles documentation
Signed-off-by: Dylan Arbour <arbourd@users.noreply.github.com>
2021-04-22 13:34:19 +02:00
Hidde Beydals
50332aa2ee Merge pull request #1310 from fluxcd/update-components
Update toolkit components
2021-04-22 13:18:08 +02:00
fluxcdbot
b47f3a57dc Update toolkit components
- helm-controller to v0.10.0
  https://github.com/fluxcd/helm-controller/blob/v0.10.0/CHANGELOG.md
- kustomize-controller to v0.11.1
  https://github.com/fluxcd/kustomize-controller/blob/v0.11.1/CHANGELOG.md
- source-controller to v0.12.0
  https://github.com/fluxcd/source-controller/blob/v0.12.0/CHANGELOG.md
- notification-controller to v0.13.0
  https://github.com/fluxcd/notification-controller/blob/v0.13.0/CHANGELOG.md
- image-reflector-controller to v0.9.0
  https://github.com/fluxcd/image-reflector-controller/blob/v0.9.0/CHANGELOG.md
- image-automation-controller to v0.9.0
  https://github.com/fluxcd/image-automation-controller/blob/v0.9.0/CHANGELOG.md

Signed-off-by: GitHub <noreply@github.com>
2021-04-22 09:49:12 +00:00
Stefan Prodan
9a928744cc Merge pull request #1264 from SomtochiAma/ssh-key-with-password
Add support for password protected SSH keys to bootstrap
2021-04-21 19:39:10 +03:00
Somtochi Onyekwere
328d403507 Set password in secret
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-04-21 17:21:07 +01:00
Stefan Prodan
76ffd76bd3 Merge pull request #1287 from SomtochiAma/get-all-cmd
Add get all command
2021-04-21 18:39:47 +03:00
Somtochi Onyekwere
951589e652 Add get all command
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-04-21 15:45:38 +01:00
Hidde Beydals
7bb0704401 Merge pull request #1308 from fluxcd/windows-path-boot-git
Use slash target path in Git bootstrap sync opts
2021-04-21 12:08:52 +02:00
Hidde Beydals
3aa45e72e7 Use slash target path in Git bootstrap sync opts
As otherwise (comparisons to) cluster configuration will fail due to
Separator differences. Was already fixed for provider implementations.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-21 11:48:36 +02:00
Hidde Beydals
67691e92e3 Merge pull request #1307 from fluxcd/boot-drop-org-repo-autoinit
Drop AutoInit from Org repository create
2021-04-21 11:44:17 +02:00
Hidde Beydals
43388ec67b Drop AutoInit from Org repository create
Pushing the first branch is sufficient to set a default, and the
`README.md` (and/or LICENSE) can better be pushed later on so commit
author and templates be configured.

This was already done for User in an earlier patch release.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-21 11:24:59 +02:00
Stefan Prodan
2fe3934491 Merge pull request #1280 from kaizentm/main
Keep network policy order as defined
2021-04-20 10:13:30 +03:00
Eugene
f60ba95b4c Keep policy order as defined
Signed-off-by: Eugene <eugene.fedor@gmail.com>
2021-04-19 13:21:32 -07:00
Hidde Beydals
4ecf541748 Merge pull request #1291 from jlengelsen/bug-install-script-binary-ownership
Fix ownership issue in bash install script
2021-04-19 15:01:25 +02:00
Julian Lengelsen
7994829765 Fix ownership issue in bash install script
When using tar with sudo the extracted files will retain the ownership
of the files in the archive. When using the bash install script the flux
binary is owned by user ID 1001 and group docker after installation.

This commit fixes the ownership by appending the -o option to the tar
command which will extract files with the correct ownership, namely user
root and group root.

Signed-off-by: Julian Lengelsen <julian.lengelsen@th-koeln.de>
2021-04-18 13:30:09 +02:00
Hidde Beydals
ce14951436 Merge pull request #1288 from sa-spag/doc 2021-04-16 16:35:30 +02:00
Alexis Gauthiez
a5ce8221a3 Suggest an alternative gradual migration technique
Signed-off-by: Alexis Gauthiez <alexis.gauthiez@blablacar.com>
2021-04-16 14:45:50 +02:00
Alexis Gauthiez
e6344ef18e Fix documentation typo
Signed-off-by: Alexis Gauthiez <alexis.gauthiez@blablacar.com>
2021-04-16 14:45:50 +02:00
Stefan Prodan
99e60634ad Merge pull request #1285 from SomtochiAma/reconcile-diff-ns
Ensure kustomization/helmrelease is reconciled when source is in a different namespace
2021-04-16 11:25:03 +03:00
Somtochi Onyekwere
6c656b7366 Fix reconcile with source in a different namespace
Signed-off-by: Somtochi Onyekwere <somtochionyekwere@gmail.com>
2021-04-16 08:53:30 +01:00
Stefan Prodan
fc3a09b5ad Merge pull request #1278 from alisondy/create-alert-es-ns
Change createAlertCmdRun parsing to include namespace
2021-04-16 08:50:26 +03:00
Alison Dowdney
b1484f2f24 Change createAlertCmdRun parsing to include namespace
Signed-off-by: Alison Dowdney <alison@alisondowdney.com>
2021-04-15 22:52:15 +01:00
Hidde Beydals
7dcf884e38 Merge pull request #1262 from fluxcd/reconcile-opt
Put potentially destructive reconcile behind flag
2021-04-13 17:38:35 +02:00
Hidde Beydals
b6d349da8c Put potentially destructive reconcile behind flag
The behavior introduced during the introduction of go-git-providers
was more strict, and has proven pretty quickly to not be useful to
all users. Therefore, the reconciliation behavior for repository
configuration has been put behind an opt-in flag, so that it does
not overwrite people their configs by accident.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-13 17:19:19 +02:00
Stefan Prodan
40ce3d50c2 Merge pull request #1256 from fluxcd/openapi2jsonschema
Publish OpenAPI schemas for Flux CRDs
2021-04-13 15:17:38 +03:00
Stefan Prodan
68046067c5 Generate OpenAPI schema in CI
Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
2021-04-13 13:17:36 +03:00
Stefan Prodan
e3b12a8a24 Merge pull request #1253 from fluxcd/btstrp-private-flag
Change private flag description
2021-04-13 09:26:29 +03:00
Hidde Beydals
f123b9d3cb Change private flag description
To highlight the fact that it configures the repository as defined,
which was not _really_ clear to some users and has resulted in public
repositories accidentally being changed to private (losing important
goodies like stars and linked forks).

Discussion on this is ongoing and there will likely be other
improvements in the near future to protect users against this.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-12 13:19:46 +02:00
Hidde Beydals
f4ce89ae26 Merge pull request #1242 from fluxcd/bootstrap-health-tweaks
Always report components health in bootstrap
2021-04-09 16:21:37 +02:00
Hidde Beydals
ea451e7e49 Always report components health in bootstrap
This is useful in case the `Kustomization` does not reconcile
successfully because for example the controller(s) are in a crash loop,
which is not visible in the resource itself.

Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-09 15:20:04 +02:00
Hidde Beydals
d434575047 Merge pull request #1240 from fluxcd/to-slash-to-rescue 2021-04-09 11:09:37 +02:00
Hidde Beydals
e627634184 Detect suspended Kustomization in bootstrap
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-09 10:53:00 +02:00
Hidde Beydals
e0dd12505f Normalize paths to forward slashes
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-09 10:52:59 +02:00
Hidde Beydals
5a67f94380 Merge pull request #1241 from fluxcd/private-key-bug
Correctly load private key by not decoding PEM twice
2021-04-09 10:37:30 +02:00
Hidde Beydals
5f9dd7a5a5 Correctly load private key by not decoding PEM 2x
Signed-off-by: Hidde Beydals <hello@hidde.co>
2021-04-09 10:05:45 +02:00
305 changed files with 2177 additions and 13807 deletions

View File

@@ -1,76 +0,0 @@
name: Publish docs via GitHub Pages
on:
push:
branches: [ 'docs*', main ]
jobs:
build:
name: Deploy docs
runs-on: ubuntu-latest
steps:
- name: Checkout master
uses: actions/checkout@v1
- name: Copy assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
controller_version() {
sed -n "s/.*$1\/releases\/download\/\(.*\)\/.*/\1/p;n" manifests/bases/$1/kustomization.yaml
}
{
# source-controller CRDs
SOURCE_VER=$(controller_version source-controller)
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/source-controller/$SOURCE_VER/docs/api/source.md" > docs/components/source/api.md
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/source-controller/$SOURCE_VER/docs/spec/v1beta1/gitrepositories.md" > docs/components/source/gitrepositories.md
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/source-controller/$SOURCE_VER/docs/spec/v1beta1/helmrepositories.md" > docs/components/source/helmrepositories.md
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/source-controller/$SOURCE_VER/docs/spec/v1beta1/helmcharts.md" > docs/components/source/helmcharts.md
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/source-controller/$SOURCE_VER/docs/spec/v1beta1/buckets.md" > docs/components/source/buckets.md
}
{
# kustomize-controller CRDs
KUSTOMIZE_VER=$(controller_version kustomize-controller)
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/kustomize-controller/$KUSTOMIZE_VER/docs/api/kustomize.md" > docs/components/kustomize/api.md
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/kustomize-controller/$KUSTOMIZE_VER/docs/spec/v1beta1/kustomization.md" > docs/components/kustomize/kustomization.md
}
{
# helm-controller CRDs
HELM_VER=$(controller_version helm-controller)
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/helm-controller/$HELM_VER/docs/api/helmrelease.md" > docs/components/helm/api.md
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/helm-controller/$HELM_VER/docs/spec/v2beta1/helmreleases.md" > docs/components/helm/helmreleases.md
}
{
# notification-controller CRDs
NOTIFICATION_VER=$(controller_version notification-controller)
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/notification-controller/$NOTIFICATION_VER/docs/api/notification.md" > docs/components/notification/api.md
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/notification-controller/$NOTIFICATION_VER/docs/spec/v1beta1/event.md" > docs/components/notification/event.md
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/notification-controller/$NOTIFICATION_VER/docs/spec/v1beta1/alert.md" > docs/components/notification/alert.md
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/notification-controller/$NOTIFICATION_VER/docs/spec/v1beta1/provider.md" > docs/components/notification/provider.md
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/notification-controller/$NOTIFICATION_VER/docs/spec/v1beta1/receiver.md" > docs/components/notification/receiver.md
}
{
# image-*-controller CRDs; these use the same API group
IMG_REFL_VER=$(controller_version image-reflector-controller)
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/image-reflector-controller/$IMG_REFL_VER/docs/api/image-reflector.md" > docs/components/image/reflector-api.md
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/image-reflector-controller/$IMG_REFL_VER/docs/spec/v1alpha1/imagerepositories.md" > docs/components/image/imagerepositories.md
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/image-reflector-controller/$IMG_REFL_VER/docs/spec/v1alpha1/imagepolicies.md" > docs/components/image/imagepolicies.md
IMG_AUTO_VER=$(controller_version image-automation-controller)
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/image-automation-controller/$IMG_AUTO_VER/docs/api/image-automation.md" > docs/components/image/automation-api.md
curl -# -Lf "https://raw.githubusercontent.com/fluxcd/image-automation-controller/$IMG_AUTO_VER/docs/spec/v1alpha1/imageupdateautomations.md" > docs/components/image/imageupdateautomations.md
}
{
# install script
cp install/flux.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

View File

@@ -53,6 +53,17 @@ jobs:
make cmd/flux/manifests make cmd/flux/manifests
./manifests/scripts/bundle.sh "" ./output manifests.tar.gz ./manifests/scripts/bundle.sh "" ./output manifests.tar.gz
kustomize build ./manifests/install > ./output/install.yaml kustomize build ./manifests/install > ./output/install.yaml
- name: Build CRDs
run: |
kustomize build manifests/crds > all-crds.yaml
- name: Generate OpenAPI JSON schemas from CRDs
uses: fluxcd/pkg//actions/crdjsonschema@main
with:
crd: all-crds.yaml
output: schemas
- name: Archive the OpenAPI JSON schemas
run: |
tar -czvf ./output/crd-schemas.tar.gz -C schemas .
- name: Run GoReleaser - name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1 uses: goreleaser/goreleaser-action@v1
with: with:

View File

@@ -23,20 +23,32 @@ jobs:
PR_BODY="" PR_BODY=""
bump_version() { bump_version() {
local RELEASE_VERSION=$(curl -s https://api.github.com/repos/fluxcd/$1/releases | jq -r 'sort_by(.published_at) | .[-1] | .tag_name') local LATEST_VERSION=$(curl -s https://api.github.com/repos/fluxcd/$1/releases | jq -r 'sort_by(.published_at) | .[-1] | .tag_name')
local CURRENT_VERSION=$(sed -n "s/.*$1\/releases\/download\/\(.*\)\/.*/\1/p;n" manifests/bases/$1/kustomization.yaml) local CTRL_VERSION=$(sed -n "s/.*$1\/releases\/download\/\(.*\)\/.*/\1/p;n" manifests/bases/$1/kustomization.yaml)
local CRD_VERSION=$(sed -n "s/.*$1\/releases\/download\/\(.*\)\/.*/\1/p" manifests/crds/kustomization.yaml)
local MOD_VERSION=$(go list -m -f '{{ .Version }}' "github.com/fluxcd/$1/api")
if [[ "${RELEASE_VERSION}" != "${CURRENT_VERSION}" ]]; then local changed=false
# bump kustomize
sed -i "s/\($1\/releases\/download\/\)v.*\(\/.*\)/\1${RELEASE_VERSION}\2/g" "manifests/bases/$1/kustomization.yaml"
if [[ ! -z $(grep "github.com/fluxcd/$1/api" go.mod | awk '{print $2}') ]]; then if [[ "${CTRL_VERSION}" != "${LATEST_VERSION}" ]]; then
# bump go mod sed -i "s/\($1\/releases\/download\/\)v.*\(\/.*\)/\1${LATEST_VERSION}\2/g" "manifests/bases/$1/kustomization.yaml"
go mod edit -require="github.com/fluxcd/$1/api@${RELEASE_VERSION}" changed=true
fi fi
# NB: special URL encoded formatting required for newlines if [[ "${CRD_VERSION}" != "${LATEST_VERSION}" ]]; then
PR_BODY="$PR_BODY- $1 to ${RELEASE_VERSION}%0A https://github.com/fluxcd/$1/blob/${RELEASE_VERSION}/CHANGELOG.md%0A" sed -i "s/\($1\/releases\/download\/\)v.*\(\/.*\)/\1${LATEST_VERSION}\2/g" "manifests/crds/kustomization.yaml"
changed=true
fi
if [[ "${MOD_VERSION}" != "${LATEST_VERSION}" ]]; then
go mod edit -require="github.com/fluxcd/$1/api@${LATEST_VERSION}"
rm go.sum
go mod tidy
changed=true
fi
if [[ "$changed" == true ]]; then
PR_BODY="$PR_BODY- $1 to ${LATEST_VERSION}%0A https://github.com/fluxcd/$1/blob/${LATEST_VERSION}/CHANGELOG.md%0A"
fi fi
} }
@@ -49,9 +61,6 @@ jobs:
bump_version image-reflector-controller bump_version image-reflector-controller
bump_version image-automation-controller bump_version image-automation-controller
# add missing and remove unused modules
go mod tidy
# diff change # diff change
git diff git diff
@@ -63,21 +72,21 @@ jobs:
id: cpr id: cpr
uses: peter-evans/create-pull-request@v3 uses: peter-evans/create-pull-request@v3
with: with:
token: ${{ secrets.BOT_GITHUB_TOKEN }} token: ${{ secrets.BOT_GITHUB_TOKEN }}
commit-message: | commit-message: |
Update toolkit components Update toolkit components
${{ steps.update.outputs.pr_body }} ${{ steps.update.outputs.pr_body }}
committer: GitHub <noreply@github.com> committer: GitHub <noreply@github.com>
author: fluxcdbot <fluxcdbot@users.noreply.github.com> author: fluxcdbot <fluxcdbot@users.noreply.github.com>
signoff: true signoff: true
branch: update-components branch: update-components
title: Update toolkit components title: Update toolkit components
body: | body: |
${{ steps.update.outputs.pr_body }} ${{ steps.update.outputs.pr_body }}
labels: | labels: |
area/build area/build
reviewers: ${{ secrets.ASSIGNEES }} reviewers: ${{ secrets.ASSIGNEES }}
- name: Check output - name: Check output
run: | run: |

3
.gitignore vendored
View File

@@ -19,3 +19,6 @@ dist/
bin/ bin/
output/ output/
cmd/flux/manifests/ cmd/flux/manifests/
# Docs
site/

View File

@@ -47,7 +47,7 @@ brews:
name: homebrew-tap name: homebrew-tap
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}" token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}"
folder: Formula folder: Formula
homepage: "https://toolkit.fluxcd.io/" homepage: "https://fluxcd.io/"
description: "Flux CLI" description: "Flux CLI"
dependencies: dependencies:
- name: kubectl - name: kubectl
@@ -72,6 +72,7 @@ publishers:
.github/aur/flux-go/publish.sh {{ .Version }} .github/aur/flux-go/publish.sh {{ .Version }}
release: release:
extra_files: extra_files:
- glob: ./output/crd-schemas.tar.gz
- glob: ./output/manifests.tar.gz - glob: ./output/manifests.tar.gz
- glob: ./output/install.yaml - glob: ./output/install.yaml
dockers: dockers:

View File

@@ -59,7 +59,7 @@ This project is composed of:
### Understanding the code ### Understanding the code
To get started with developing controllers, you might want to review To get started with developing controllers, you might want to review
[our guide](https://toolkit.fluxcd.io/dev-guides/source-watcher/) which [our guide](https://fluxcd.io/docs/gitops-toolkit/source-watcher/) which
walks you through writing a short and concise controller that watches out walks you through writing a short and concise controller that watches out
for source changes. for source changes.

View File

@@ -14,7 +14,7 @@ fmt:
vet: vet:
go vet ./... go vet ./...
test: $(EMBEDDED_MANIFESTS_TARGET) tidy fmt vet docs test: $(EMBEDDED_MANIFESTS_TARGET) tidy fmt vet
go test ./... -coverprofile cover.out go test ./... -coverprofile cover.out
$(EMBEDDED_MANIFESTS_TARGET): $(call rwildcard,manifests/,*.yaml *.json) $(EMBEDDED_MANIFESTS_TARGET): $(call rwildcard,manifests/,*.yaml *.json)
@@ -26,10 +26,5 @@ build: $(EMBEDDED_MANIFESTS_TARGET)
install: install:
go install cmd/flux go install cmd/flux
.PHONY: docs
docs:
rm -rf docs/cmd/*
mkdir -p ./docs/cmd && go run ./cmd/flux/ docgen
install-dev: install-dev:
CGO_ENABLED=0 go build -o /usr/local/bin ./cmd/flux CGO_ENABLED=0 go build -o /usr/local/bin ./cmd/flux

View File

@@ -22,16 +22,22 @@ Delivery on top of Kubernetes.
## Flux installation ## Flux installation
With Homebrew: With [Homebrew](https://brew.sh) for macOS and Linux:
```sh ```sh
brew install fluxcd/tap/flux brew install fluxcd/tap/flux
``` ```
With Bash: With [GoFish](https://gofi.sh) for Windows, macOS and Linux:
```sh ```sh
curl -s https://toolkit.fluxcd.io/install.sh | sudo bash gofish install flux
```
With Bash for macOS and Linux:
```sh
curl -s https://fluxcd.io/install.sh | sudo bash
# enable completions in ~/.bash_profile # enable completions in ~/.bash_profile
. <(flux completion bash) . <(flux completion bash)
@@ -46,10 +52,10 @@ Arch Linux (AUR) packages:
- [flux-scm](https://aur.archlinux.org/packages/flux-scm): build the latest - [flux-scm](https://aur.archlinux.org/packages/flux-scm): build the latest
(unstable) version from source code from our git `main` branch (unstable) version from source code from our git `main` branch
Binaries for macOS, Windows and Linux AMD64/ARM are available to download on the Binaries for macOS AMD64/ARM64, Linux AMD64/ARM/ARM64 and Windows are available to
[release page](https://github.com/fluxcd/flux2/releases). download on the [release page](https://github.com/fluxcd/flux2/releases).
A container image with `kubectl` and `flux` is available on Docker Hub and GitHub: A multi-arch container image with `kubectl` and `flux` is available on Docker Hub and GitHub:
* `docker.io/fluxcd/flux-cli:<version>` * `docker.io/fluxcd/flux-cli:<version>`
* `ghcr.io/fluxcd/flux-cli:<version>` * `ghcr.io/fluxcd/flux-cli:<version>`
@@ -63,13 +69,13 @@ flux check --pre
## Get started ## Get started
To get started with Flux, start [browsing the To get started with Flux, start [browsing the
documentation](https://toolkit.fluxcd.io) or get started with one of documentation](https://fluxcd.io/docs/) or get started with one of
the following guides: the following guides:
- [Get started with Flux](https://toolkit.fluxcd.io/get-started/) - [Get started with Flux](https://fluxcd.io/docs/get-started/)
- [Manage Helm Releases](https://toolkit.fluxcd.io/guides/helmreleases/) - [Manage Helm Releases](https://fluxcd.io/docs/guides/helmreleases/)
- [Automate image updates to Git](https://toolkit.fluxcd.io/guides/image-update/) - [Automate image updates to Git](https://fluxcd.io/docs/guides/image-update/)
- [Manage Kubernetes secrets with Mozilla SOPS](https://toolkit.fluxcd.io/guides/mozilla-sops/) - [Manage Kubernetes secrets with Mozilla SOPS](https://fluxcd.io/docs/guides/mozilla-sops/)
If you need help, please refer to our **[Support page](https://fluxcd.io/support/)**. If you need help, please refer to our **[Support page](https://fluxcd.io/support/)**.
@@ -84,27 +90,27 @@ automation tooling.
You can use the toolkit to extend Flux, or to build your own systems You can use the toolkit to extend Flux, or to build your own systems
for continuous delivery -- see [the developer for continuous delivery -- see [the developer
guides](https://toolkit.fluxcd.io/dev-guides/source-watcher/). guides](https://fluxcd.io/docs/gitops-toolkit/source-watcher/).
### Components ### Components
- [Source Controller](https://toolkit.fluxcd.io/components/source/controller/) - [Source Controller](https://fluxcd.io/docs/components/source/)
- [GitRepository CRD](https://toolkit.fluxcd.io/components/source/gitrepositories/) - [GitRepository CRD](https://fluxcd.io/docs/components/source/gitrepositories/)
- [HelmRepository CRD](https://toolkit.fluxcd.io/components/source/helmrepositories/) - [HelmRepository CRD](https://fluxcd.io/docs/components/source/helmrepositories/)
- [HelmChart CRD](https://toolkit.fluxcd.io/components/source/helmcharts/) - [HelmChart CRD](https://fluxcd.io/docs/components/source/helmcharts/)
- [Bucket CRD](https://toolkit.fluxcd.io/components/source/buckets/) - [Bucket CRD](https://fluxcd.io/docs/components/source/buckets/)
- [Kustomize Controller](https://toolkit.fluxcd.io/components/kustomize/controller/) - [Kustomize Controller](https://fluxcd.io/docs/components/kustomize/)
- [Kustomization CRD](https://toolkit.fluxcd.io/components/kustomize/kustomization/) - [Kustomization CRD](https://fluxcd.io/docs/components/kustomize/kustomization/)
- [Helm Controller](https://toolkit.fluxcd.io/components/helm/controller/) - [Helm Controller](https://fluxcd.io/docs/components/helm/)
- [HelmRelease CRD](https://toolkit.fluxcd.io/components/helm/helmreleases/) - [HelmRelease CRD](https://fluxcd.io/docs/components/helm/helmreleases/)
- [Notification Controller](https://toolkit.fluxcd.io/components/notification/controller/) - [Notification Controller](https://fluxcd.io/docs/components/notification/)
- [Provider CRD](https://toolkit.fluxcd.io/components/notification/provider/) - [Provider CRD](https://fluxcd.io/docs/components/notification/provider/)
- [Alert CRD](https://toolkit.fluxcd.io/components/notification/alert/) - [Alert CRD](https://fluxcd.io/docs/components/notification/alert/)
- [Receiver CRD](https://toolkit.fluxcd.io/components/notification/receiver/) - [Receiver CRD](https://fluxcd.io/docs/components/notification/receiver/)
- [Image Automation Controllers](https://toolkit.fluxcd.io/components/image/controller/) - [Image Automation Controllers](https://fluxcd.io/docs/components/image/)
- [ImageRepository CRD](https://toolkit.fluxcd.io/components/image/imagerepositories/) - [ImageRepository CRD](https://fluxcd.io/docs/components/image/imagerepositories/)
- [ImagePolicy CRD](https://toolkit.fluxcd.io/components/image/imagepolicies/) - [ImagePolicy CRD](https://fluxcd.io/docs/components/image/imagepolicies/)
- [ImageUpdateAutomation CRD](https://toolkit.fluxcd.io/components/image/imageupdateautomations/) - [ImageUpdateAutomation CRD](https://fluxcd.io/docs/components/image/imageupdateautomations/)
## Community ## Community
@@ -112,7 +118,7 @@ Need help or want to contribute? Please see the links below. The Flux project is
new contributors and there are a multitude of ways to get involved. new contributors and there are a multitude of ways to get involved.
- Getting Started? - Getting Started?
- Look at our [Get Started guide](https://toolkit.fluxcd.io/get-started/) and give us feedback - Look at our [Get Started guide](https://fluxcd.io/docs/get-started/) and give us feedback
- Need help? - Need help?
- First: Ask questions on our [GH Discussions page](https://github.com/fluxcd/flux2/discussions) - First: Ask questions on our [GH Discussions page](https://github.com/fluxcd/flux2/discussions)
- Second: Talk to us in the #flux channel on [CNCF Slack](https://slack.cncf.io/) - Second: Talk to us in the #flux channel on [CNCF Slack](https://slack.cncf.io/)

View File

@@ -56,6 +56,9 @@ command will perform an upgrade if needed.`,
# Run bootstrap for a Git repository with a passwordless private key # Run bootstrap for a Git repository with a passwordless private key
flux bootstrap git --url=ssh://git@example.com/repository.git --private-key-file=<path/to/private.key> flux bootstrap git --url=ssh://git@example.com/repository.git --private-key-file=<path/to/private.key>
# Run bootstrap for a Git repository with a private key and password
flux bootstrap git --url=ssh://git@example.com/repository.git --private-key-file=<path/to/private.key> --password=<password>
`, `,
RunE: bootstrapGitCmdRun, RunE: bootstrapGitCmdRun,
} }
@@ -134,7 +137,7 @@ func bootstrapGitCmdRun(cmd *cobra.Command, args []string) error {
NotificationController: rootArgs.defaults.NotificationController, NotificationController: rootArgs.defaults.NotificationController,
ManifestFile: rootArgs.defaults.ManifestFile, ManifestFile: rootArgs.defaults.ManifestFile,
Timeout: rootArgs.timeout, Timeout: rootArgs.timeout,
TargetPath: gitArgs.path.String(), TargetPath: gitArgs.path.ToSlash(),
ClusterDomain: bootstrapArgs.clusterDomain, ClusterDomain: bootstrapArgs.clusterDomain,
TolerationKeys: bootstrapArgs.tolerationKeys, TolerationKeys: bootstrapArgs.tolerationKeys,
} }
@@ -163,13 +166,13 @@ func bootstrapGitCmdRun(cmd *cobra.Command, args []string) error {
repositoryURL.Host = repositoryURL.Hostname() repositoryURL.Host = repositoryURL.Hostname()
} else { } else {
secretOpts.PrivateKeyAlgorithm = sourcesecret.PrivateKeyAlgorithm(bootstrapArgs.keyAlgorithm) secretOpts.PrivateKeyAlgorithm = sourcesecret.PrivateKeyAlgorithm(bootstrapArgs.keyAlgorithm)
secretOpts.Password = gitArgs.password
secretOpts.RSAKeyBits = int(bootstrapArgs.keyRSABits) secretOpts.RSAKeyBits = int(bootstrapArgs.keyRSABits)
secretOpts.ECDSACurve = bootstrapArgs.keyECDSACurve.Curve secretOpts.ECDSACurve = bootstrapArgs.keyECDSACurve.Curve
// Configure repository URL to match auth config for sync. // Configure repository URL to match auth config for sync.
repositoryURL.User = url.User(gitArgs.username) repositoryURL.User = url.User(gitArgs.username)
repositoryURL.Scheme = "ssh" repositoryURL.Scheme = "ssh"
repositoryURL.Host = repositoryURL.Hostname()
if bootstrapArgs.sshHostname != "" { if bootstrapArgs.sshHostname != "" {
repositoryURL.Host = bootstrapArgs.sshHostname repositoryURL.Host = bootstrapArgs.sshHostname
} }
@@ -189,7 +192,7 @@ func bootstrapGitCmdRun(cmd *cobra.Command, args []string) error {
URL: repositoryURL.String(), URL: repositoryURL.String(),
Branch: bootstrapArgs.branch, Branch: bootstrapArgs.branch,
Secret: bootstrapArgs.secretName, Secret: bootstrapArgs.secretName,
TargetPath: gitArgs.path.String(), TargetPath: gitArgs.path.ToSlash(),
ManifestFile: sync.MakeDefaultOptions().ManifestFile, ManifestFile: sync.MakeDefaultOptions().ManifestFile,
GitImplementation: sourceGitArgs.gitImplementation.String(), GitImplementation: sourceGitArgs.gitImplementation.String(),
RecurseSubmodules: bootstrapArgs.recurseSubmodules, RecurseSubmodules: bootstrapArgs.recurseSubmodules,
@@ -229,7 +232,7 @@ func transportForURL(u *url.URL) (transport.AuthMethod, error) {
}, nil }, nil
case "ssh": case "ssh":
if bootstrapArgs.privateKeyFile != "" { if bootstrapArgs.privateKeyFile != "" {
return ssh.NewPublicKeysFromFile(u.User.Username(), bootstrapArgs.privateKeyFile, "") return ssh.NewPublicKeysFromFile(u.User.Username(), bootstrapArgs.privateKeyFile, gitArgs.password)
} }
return nil, nil return nil, nil
default: default:

View File

@@ -80,6 +80,7 @@ type githubFlags struct {
path flags.SafeRelativePath path flags.SafeRelativePath
teams []string teams []string
readWriteKey bool readWriteKey bool
reconcile bool
} }
const ( const (
@@ -93,13 +94,14 @@ var githubArgs githubFlags
func init() { func init() {
bootstrapGitHubCmd.Flags().StringVar(&githubArgs.owner, "owner", "", "GitHub user or organization name") bootstrapGitHubCmd.Flags().StringVar(&githubArgs.owner, "owner", "", "GitHub user or organization name")
bootstrapGitHubCmd.Flags().StringVar(&githubArgs.repository, "repository", "", "GitHub repository name") bootstrapGitHubCmd.Flags().StringVar(&githubArgs.repository, "repository", "", "GitHub repository name")
bootstrapGitHubCmd.Flags().StringArrayVar(&githubArgs.teams, "team", []string{}, "GitHub team to be given maintainer access") bootstrapGitHubCmd.Flags().StringSliceVar(&githubArgs.teams, "team", []string{}, "GitHub team to be given maintainer access (also accepts comma-separated values)")
bootstrapGitHubCmd.Flags().BoolVar(&githubArgs.personal, "personal", false, "if true, the owner is assumed to be a GitHub user; otherwise an org") bootstrapGitHubCmd.Flags().BoolVar(&githubArgs.personal, "personal", false, "if true, the owner is assumed to be a GitHub user; otherwise an org")
bootstrapGitHubCmd.Flags().BoolVar(&githubArgs.private, "private", true, "if true, the repository is assumed to be private") bootstrapGitHubCmd.Flags().BoolVar(&githubArgs.private, "private", true, "if true, the repository is setup or configured as private")
bootstrapGitHubCmd.Flags().DurationVar(&githubArgs.interval, "interval", time.Minute, "sync interval") bootstrapGitHubCmd.Flags().DurationVar(&githubArgs.interval, "interval", time.Minute, "sync interval")
bootstrapGitHubCmd.Flags().StringVar(&githubArgs.hostname, "hostname", ghDefaultDomain, "GitHub hostname") bootstrapGitHubCmd.Flags().StringVar(&githubArgs.hostname, "hostname", ghDefaultDomain, "GitHub hostname")
bootstrapGitHubCmd.Flags().Var(&githubArgs.path, "path", "path relative to the repository root, when specified the cluster sync will be scoped to this path") bootstrapGitHubCmd.Flags().Var(&githubArgs.path, "path", "path relative to the repository root, when specified the cluster sync will be scoped to this path")
bootstrapGitHubCmd.Flags().BoolVar(&githubArgs.readWriteKey, "read-write-key", false, "if true, the deploy key is configured with read/write permissions") bootstrapGitHubCmd.Flags().BoolVar(&githubArgs.readWriteKey, "read-write-key", false, "if true, the deploy key is configured with read/write permissions")
bootstrapGitHubCmd.Flags().BoolVar(&githubArgs.reconcile, "reconcile", false, "if true, the configured options are also reconciled if the repository already exists")
bootstrapCmd.AddCommand(bootstrapGitHubCmd) bootstrapCmd.AddCommand(bootstrapGitHubCmd)
} }
@@ -168,7 +170,7 @@ func bootstrapGitHubCmdRun(cmd *cobra.Command, args []string) error {
NotificationController: rootArgs.defaults.NotificationController, NotificationController: rootArgs.defaults.NotificationController,
ManifestFile: rootArgs.defaults.ManifestFile, ManifestFile: rootArgs.defaults.ManifestFile,
Timeout: rootArgs.timeout, Timeout: rootArgs.timeout,
TargetPath: githubArgs.path.String(), TargetPath: githubArgs.path.ToSlash(),
ClusterDomain: bootstrapArgs.clusterDomain, ClusterDomain: bootstrapArgs.clusterDomain,
TolerationKeys: bootstrapArgs.tolerationKeys, TolerationKeys: bootstrapArgs.tolerationKeys,
} }
@@ -180,7 +182,7 @@ func bootstrapGitHubCmdRun(cmd *cobra.Command, args []string) error {
secretOpts := sourcesecret.Options{ secretOpts := sourcesecret.Options{
Name: bootstrapArgs.secretName, Name: bootstrapArgs.secretName,
Namespace: rootArgs.namespace, Namespace: rootArgs.namespace,
TargetPath: githubArgs.path.String(), TargetPath: githubArgs.path.ToSlash(),
ManifestFile: sourcesecret.MakeDefaultOptions().ManifestFile, ManifestFile: sourcesecret.MakeDefaultOptions().ManifestFile,
} }
if bootstrapArgs.tokenAuth { if bootstrapArgs.tokenAuth {
@@ -208,7 +210,7 @@ func bootstrapGitHubCmdRun(cmd *cobra.Command, args []string) error {
Namespace: rootArgs.namespace, Namespace: rootArgs.namespace,
Branch: bootstrapArgs.branch, Branch: bootstrapArgs.branch,
Secret: bootstrapArgs.secretName, Secret: bootstrapArgs.secretName,
TargetPath: githubArgs.path.String(), TargetPath: githubArgs.path.ToSlash(),
ManifestFile: sync.MakeDefaultOptions().ManifestFile, ManifestFile: sync.MakeDefaultOptions().ManifestFile,
GitImplementation: sourceGitArgs.gitImplementation.String(), GitImplementation: sourceGitArgs.gitImplementation.String(),
RecurseSubmodules: bootstrapArgs.recurseSubmodules, RecurseSubmodules: bootstrapArgs.recurseSubmodules,
@@ -235,6 +237,9 @@ func bootstrapGitHubCmdRun(cmd *cobra.Command, args []string) error {
if !githubArgs.private { if !githubArgs.private {
bootstrapOpts = append(bootstrapOpts, bootstrap.WithProviderRepositoryConfig("", "", "public")) bootstrapOpts = append(bootstrapOpts, bootstrap.WithProviderRepositoryConfig("", "", "public"))
} }
if githubArgs.reconcile {
bootstrapOpts = append(bootstrapOpts, bootstrap.WithReconcile())
}
// Setup bootstrapper with constructed configs // Setup bootstrapper with constructed configs
b, err := bootstrap.NewGitProviderBootstrapper(gitClient, providerClient, kubeClient, bootstrapOpts...) b, err := bootstrap.NewGitProviderBootstrapper(gitClient, providerClient, kubeClient, bootstrapOpts...)

View File

@@ -86,6 +86,7 @@ type gitlabFlags struct {
path flags.SafeRelativePath path flags.SafeRelativePath
teams []string teams []string
readWriteKey bool readWriteKey bool
reconcile bool
} }
var gitlabArgs gitlabFlags var gitlabArgs gitlabFlags
@@ -93,13 +94,14 @@ var gitlabArgs gitlabFlags
func init() { func init() {
bootstrapGitLabCmd.Flags().StringVar(&gitlabArgs.owner, "owner", "", "GitLab user or group name") bootstrapGitLabCmd.Flags().StringVar(&gitlabArgs.owner, "owner", "", "GitLab user or group name")
bootstrapGitLabCmd.Flags().StringVar(&gitlabArgs.repository, "repository", "", "GitLab repository name") bootstrapGitLabCmd.Flags().StringVar(&gitlabArgs.repository, "repository", "", "GitLab repository name")
bootstrapGitLabCmd.Flags().StringArrayVar(&gitlabArgs.teams, "team", []string{}, "GitLab teams to be given maintainer access") bootstrapGitLabCmd.Flags().StringSliceVar(&gitlabArgs.teams, "team", []string{}, "GitLab teams to be given maintainer access (also accepts comma-separated values)")
bootstrapGitLabCmd.Flags().BoolVar(&gitlabArgs.personal, "personal", false, "if true, the owner is assumed to be a GitLab user; otherwise a group") bootstrapGitLabCmd.Flags().BoolVar(&gitlabArgs.personal, "personal", false, "if true, the owner is assumed to be a GitLab user; otherwise a group")
bootstrapGitLabCmd.Flags().BoolVar(&gitlabArgs.private, "private", true, "if true, the repository is assumed to be private") bootstrapGitLabCmd.Flags().BoolVar(&gitlabArgs.private, "private", true, "if true, the repository is setup or configured as private")
bootstrapGitLabCmd.Flags().DurationVar(&gitlabArgs.interval, "interval", time.Minute, "sync interval") bootstrapGitLabCmd.Flags().DurationVar(&gitlabArgs.interval, "interval", time.Minute, "sync interval")
bootstrapGitLabCmd.Flags().StringVar(&gitlabArgs.hostname, "hostname", glDefaultDomain, "GitLab hostname") bootstrapGitLabCmd.Flags().StringVar(&gitlabArgs.hostname, "hostname", glDefaultDomain, "GitLab hostname")
bootstrapGitLabCmd.Flags().Var(&gitlabArgs.path, "path", "path relative to the repository root, when specified the cluster sync will be scoped to this path") bootstrapGitLabCmd.Flags().Var(&gitlabArgs.path, "path", "path relative to the repository root, when specified the cluster sync will be scoped to this path")
bootstrapGitLabCmd.Flags().BoolVar(&gitlabArgs.readWriteKey, "read-write-key", false, "if true, the deploy key is configured with read/write permissions") bootstrapGitLabCmd.Flags().BoolVar(&gitlabArgs.readWriteKey, "read-write-key", false, "if true, the deploy key is configured with read/write permissions")
bootstrapGitLabCmd.Flags().BoolVar(&gitlabArgs.reconcile, "reconcile", false, "if true, the configured options are also reconciled if the repository already exists")
bootstrapCmd.AddCommand(bootstrapGitLabCmd) bootstrapCmd.AddCommand(bootstrapGitLabCmd)
} }
@@ -181,7 +183,7 @@ func bootstrapGitLabCmdRun(cmd *cobra.Command, args []string) error {
NotificationController: rootArgs.defaults.NotificationController, NotificationController: rootArgs.defaults.NotificationController,
ManifestFile: rootArgs.defaults.ManifestFile, ManifestFile: rootArgs.defaults.ManifestFile,
Timeout: rootArgs.timeout, Timeout: rootArgs.timeout,
TargetPath: gitlabArgs.path.String(), TargetPath: gitlabArgs.path.ToSlash(),
ClusterDomain: bootstrapArgs.clusterDomain, ClusterDomain: bootstrapArgs.clusterDomain,
TolerationKeys: bootstrapArgs.tolerationKeys, TolerationKeys: bootstrapArgs.tolerationKeys,
} }
@@ -224,7 +226,7 @@ func bootstrapGitLabCmdRun(cmd *cobra.Command, args []string) error {
Namespace: rootArgs.namespace, Namespace: rootArgs.namespace,
Branch: bootstrapArgs.branch, Branch: bootstrapArgs.branch,
Secret: bootstrapArgs.secretName, Secret: bootstrapArgs.secretName,
TargetPath: gitlabArgs.path.String(), TargetPath: gitlabArgs.path.ToSlash(),
ManifestFile: sync.MakeDefaultOptions().ManifestFile, ManifestFile: sync.MakeDefaultOptions().ManifestFile,
GitImplementation: sourceGitArgs.gitImplementation.String(), GitImplementation: sourceGitArgs.gitImplementation.String(),
RecurseSubmodules: bootstrapArgs.recurseSubmodules, RecurseSubmodules: bootstrapArgs.recurseSubmodules,
@@ -251,6 +253,9 @@ func bootstrapGitLabCmdRun(cmd *cobra.Command, args []string) error {
if !gitlabArgs.private { if !gitlabArgs.private {
bootstrapOpts = append(bootstrapOpts, bootstrap.WithProviderRepositoryConfig("", "", "public")) bootstrapOpts = append(bootstrapOpts, bootstrap.WithProviderRepositoryConfig("", "", "public"))
} }
if gitlabArgs.reconcile {
bootstrapOpts = append(bootstrapOpts, bootstrap.WithReconcile())
}
// Setup bootstrapper with constructed configs // Setup bootstrapper with constructed configs
b, err := bootstrap.NewGitProviderBootstrapper(gitClient, providerClient, kubeClient, bootstrapOpts...) b, err := bootstrap.NewGitProviderBootstrapper(gitClient, providerClient, kubeClient, bootstrapOpts...)

View File

@@ -58,7 +58,7 @@ var alertArgs alertFlags
func init() { func init() {
createAlertCmd.Flags().StringVar(&alertArgs.providerRef, "provider-ref", "", "reference to provider") createAlertCmd.Flags().StringVar(&alertArgs.providerRef, "provider-ref", "", "reference to provider")
createAlertCmd.Flags().StringVar(&alertArgs.eventSeverity, "event-severity", "", "severity of events to send alerts for") createAlertCmd.Flags().StringVar(&alertArgs.eventSeverity, "event-severity", "", "severity of events to send alerts for")
createAlertCmd.Flags().StringArrayVar(&alertArgs.eventSources, "event-source", []string{}, "sources that should generate alerts (<kind>/<name>)") createAlertCmd.Flags().StringSliceVar(&alertArgs.eventSources, "event-source", []string{}, "sources that should generate alerts (<kind>/<name>), also accepts comma-separated values")
createCmd.AddCommand(createAlertCmd) createCmd.AddCommand(createAlertCmd)
} }
@@ -74,14 +74,15 @@ func createAlertCmdRun(cmd *cobra.Command, args []string) error {
eventSources := []notificationv1.CrossNamespaceObjectReference{} eventSources := []notificationv1.CrossNamespaceObjectReference{}
for _, eventSource := range alertArgs.eventSources { for _, eventSource := range alertArgs.eventSources {
kind, name := utils.ParseObjectKindName(eventSource) kind, name, namespace := utils.ParseObjectKindNameNamespace(eventSource)
if kind == "" { if kind == "" {
return fmt.Errorf("invalid event source '%s', must be in format <kind>/<name>", eventSource) return fmt.Errorf("invalid event source '%s', must be in format <kind>/<name>", eventSource)
} }
eventSources = append(eventSources, notificationv1.CrossNamespaceObjectReference{ eventSources = append(eventSources, notificationv1.CrossNamespaceObjectReference{
Kind: kind, Kind: kind,
Name: name, Name: name,
Namespace: namespace,
}) })
} }

View File

@@ -113,9 +113,10 @@ type helmReleaseFlags struct {
chart string chart string
chartVersion string chartVersion string
targetNamespace string targetNamespace string
valuesFile []string valuesFiles []string
valuesFrom flags.HelmReleaseValuesFrom valuesFrom flags.HelmReleaseValuesFrom
saName string saName string
crds flags.CRDsPolicy
} }
var helmReleaseArgs helmReleaseFlags var helmReleaseArgs helmReleaseFlags
@@ -125,11 +126,12 @@ func init() {
createHelmReleaseCmd.Flags().Var(&helmReleaseArgs.source, "source", helmReleaseArgs.source.Description()) createHelmReleaseCmd.Flags().Var(&helmReleaseArgs.source, "source", helmReleaseArgs.source.Description())
createHelmReleaseCmd.Flags().StringVar(&helmReleaseArgs.chart, "chart", "", "Helm chart name or path") createHelmReleaseCmd.Flags().StringVar(&helmReleaseArgs.chart, "chart", "", "Helm chart name or path")
createHelmReleaseCmd.Flags().StringVar(&helmReleaseArgs.chartVersion, "chart-version", "", "Helm chart version, accepts a semver range (ignored for charts from GitRepository sources)") createHelmReleaseCmd.Flags().StringVar(&helmReleaseArgs.chartVersion, "chart-version", "", "Helm chart version, accepts a semver range (ignored for charts from GitRepository sources)")
createHelmReleaseCmd.Flags().StringArrayVar(&helmReleaseArgs.dependsOn, "depends-on", nil, "HelmReleases that must be ready before this release can be installed, supported formats '<name>' and '<namespace>/<name>'") createHelmReleaseCmd.Flags().StringSliceVar(&helmReleaseArgs.dependsOn, "depends-on", nil, "HelmReleases that must be ready before this release can be installed, supported formats '<name>' and '<namespace>/<name>'")
createHelmReleaseCmd.Flags().StringVar(&helmReleaseArgs.targetNamespace, "target-namespace", "", "namespace to install this release, defaults to the HelmRelease namespace") createHelmReleaseCmd.Flags().StringVar(&helmReleaseArgs.targetNamespace, "target-namespace", "", "namespace to install this release, defaults to the HelmRelease namespace")
createHelmReleaseCmd.Flags().StringVar(&helmReleaseArgs.saName, "service-account", "", "the name of the service account to impersonate when reconciling this HelmRelease") createHelmReleaseCmd.Flags().StringVar(&helmReleaseArgs.saName, "service-account", "", "the name of the service account to impersonate when reconciling this HelmRelease")
createHelmReleaseCmd.Flags().StringArrayVar(&helmReleaseArgs.valuesFile, "values", nil, "local path to values.yaml files") createHelmReleaseCmd.Flags().StringSliceVar(&helmReleaseArgs.valuesFiles, "values", nil, "local path to values.yaml files, also accepts comma-separated values")
createHelmReleaseCmd.Flags().Var(&helmReleaseArgs.valuesFrom, "values-from", helmReleaseArgs.valuesFrom.Description()) createHelmReleaseCmd.Flags().Var(&helmReleaseArgs.valuesFrom, "values-from", helmReleaseArgs.valuesFrom.Description())
createHelmReleaseCmd.Flags().Var(&helmReleaseArgs.crds, "crds", helmReleaseArgs.crds.Description())
createCmd.AddCommand(createHelmReleaseCmd) createCmd.AddCommand(createHelmReleaseCmd)
} }
@@ -184,9 +186,14 @@ func createHelmReleaseCmdRun(cmd *cobra.Command, args []string) error {
helmRelease.Spec.ServiceAccountName = helmReleaseArgs.saName helmRelease.Spec.ServiceAccountName = helmReleaseArgs.saName
} }
if len(helmReleaseArgs.valuesFile) > 0 { if helmReleaseArgs.crds != "" {
var valuesMap map[string]interface{} helmRelease.Spec.Install = &helmv2.Install{CRDs: helmv2.Create}
for _, v := range helmReleaseArgs.valuesFile { helmRelease.Spec.Upgrade = &helmv2.Upgrade{CRDs: helmv2.CRDsPolicy(helmReleaseArgs.crds.String())}
}
if len(helmReleaseArgs.valuesFiles) > 0 {
valuesMap := make(map[string]interface{})
for _, v := range helmReleaseArgs.valuesFiles {
data, err := ioutil.ReadFile(v) data, err := ioutil.ReadFile(v)
if err != nil { if err != nil {
return fmt.Errorf("reading values from %s failed: %w", v, err) return fmt.Errorf("reading values from %s failed: %w", v, err)
@@ -202,11 +209,7 @@ func createHelmReleaseCmdRun(cmd *cobra.Command, args []string) error {
return fmt.Errorf("unmarshaling values from %s failed: %w", v, err) return fmt.Errorf("unmarshaling values from %s failed: %w", v, err)
} }
if valuesMap == nil { valuesMap = transform.MergeMaps(valuesMap, jsonMap)
valuesMap = jsonMap
} else {
valuesMap = transform.MergeMaps(valuesMap, jsonMap)
}
} }
jsonRaw, err := json.Marshal(valuesMap) jsonRaw, err := json.Marshal(valuesMap)

View File

@@ -28,7 +28,7 @@ import (
"github.com/fluxcd/pkg/apis/meta" "github.com/fluxcd/pkg/apis/meta"
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1" imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2"
) )
var createImagePolicyCmd = &cobra.Command{ var createImagePolicyCmd = &cobra.Command{

View File

@@ -26,7 +26,7 @@ import (
"github.com/fluxcd/pkg/apis/meta" "github.com/fluxcd/pkg/apis/meta"
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1" imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2"
) )
var createImageRepositoryCmd = &cobra.Command{ var createImageRepositoryCmd = &cobra.Command{

View File

@@ -22,9 +22,8 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/fluxcd/pkg/apis/meta" autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha2"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta1"
autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha1"
) )
var createImageUpdateCmd = &cobra.Command{ var createImageUpdateCmd = &cobra.Command{
@@ -113,25 +112,33 @@ func createImageUpdateRun(cmd *cobra.Command, args []string) error {
Labels: labels, Labels: labels,
}, },
Spec: autov1.ImageUpdateAutomationSpec{ Spec: autov1.ImageUpdateAutomationSpec{
Checkout: autov1.GitCheckoutSpec{ SourceRef: autov1.SourceReference{
GitRepositoryRef: meta.LocalObjectReference{ Kind: sourcev1.GitRepositoryKind,
Name: imageUpdateArgs.gitRepoRef, Name: imageUpdateArgs.gitRepoRef,
},
GitSpec: &autov1.GitSpec{
Checkout: &autov1.GitCheckoutSpec{
Reference: sourcev1.GitRepositoryRef{
Branch: imageUpdateArgs.checkoutBranch,
},
},
Commit: autov1.CommitSpec{
Author: autov1.CommitUser{
Name: imageUpdateArgs.authorName,
Email: imageUpdateArgs.authorEmail,
},
MessageTemplate: imageUpdateArgs.commitTemplate,
}, },
Branch: imageUpdateArgs.checkoutBranch,
}, },
Interval: metav1.Duration{ Interval: metav1.Duration{
Duration: createArgs.interval, Duration: createArgs.interval,
}, },
Commit: autov1.CommitSpec{
AuthorName: imageUpdateArgs.authorName,
AuthorEmail: imageUpdateArgs.authorEmail,
MessageTemplate: imageUpdateArgs.commitTemplate,
},
}, },
} }
if imageUpdateArgs.pushBranch != "" { if imageUpdateArgs.pushBranch != "" {
update.Spec.Push = &autov1.PushSpec{ update.Spec.GitSpec.Push = &autov1.PushSpec{
Branch: imageUpdateArgs.pushBranch, Branch: imageUpdateArgs.pushBranch,
} }
} }

View File

@@ -19,7 +19,6 @@ package main
import ( import (
"context" "context"
"fmt" "fmt"
"path/filepath"
"strings" "strings"
"time" "time"
@@ -101,10 +100,10 @@ func init() {
createKsCmd.Flags().Var(&kustomizationArgs.source, "source", kustomizationArgs.source.Description()) createKsCmd.Flags().Var(&kustomizationArgs.source, "source", kustomizationArgs.source.Description())
createKsCmd.Flags().Var(&kustomizationArgs.path, "path", "path to the directory containing a kustomization.yaml file") createKsCmd.Flags().Var(&kustomizationArgs.path, "path", "path to the directory containing a kustomization.yaml file")
createKsCmd.Flags().BoolVar(&kustomizationArgs.prune, "prune", false, "enable garbage collection") createKsCmd.Flags().BoolVar(&kustomizationArgs.prune, "prune", false, "enable garbage collection")
createKsCmd.Flags().StringArrayVar(&kustomizationArgs.healthCheck, "health-check", nil, "workload to be included in the health assessment, in the format '<kind>/<name>.<namespace>'") createKsCmd.Flags().StringSliceVar(&kustomizationArgs.healthCheck, "health-check", nil, "workload to be included in the health assessment, in the format '<kind>/<name>.<namespace>'")
createKsCmd.Flags().DurationVar(&kustomizationArgs.healthTimeout, "health-check-timeout", 2*time.Minute, "timeout of health checking operations") createKsCmd.Flags().DurationVar(&kustomizationArgs.healthTimeout, "health-check-timeout", 2*time.Minute, "timeout of health checking operations")
createKsCmd.Flags().StringVar(&kustomizationArgs.validation, "validation", "", "validate the manifests before applying them on the cluster, can be 'client' or 'server'") createKsCmd.Flags().StringVar(&kustomizationArgs.validation, "validation", "", "validate the manifests before applying them on the cluster, can be 'client' or 'server'")
createKsCmd.Flags().StringArrayVar(&kustomizationArgs.dependsOn, "depends-on", nil, "Kustomization that must be ready before this Kustomization can be applied, supported formats '<name>' and '<namespace>/<name>'") createKsCmd.Flags().StringSliceVar(&kustomizationArgs.dependsOn, "depends-on", nil, "Kustomization that must be ready before this Kustomization can be applied, supported formats '<name>' and '<namespace>/<name>', also accepts comma-separated values")
createKsCmd.Flags().StringVar(&kustomizationArgs.saName, "service-account", "", "the name of the service account to impersonate when reconciling this Kustomization") createKsCmd.Flags().StringVar(&kustomizationArgs.saName, "service-account", "", "the name of the service account to impersonate when reconciling this Kustomization")
createKsCmd.Flags().Var(&kustomizationArgs.decryptionProvider, "decryption-provider", kustomizationArgs.decryptionProvider.Description()) createKsCmd.Flags().Var(&kustomizationArgs.decryptionProvider, "decryption-provider", kustomizationArgs.decryptionProvider.Description())
createKsCmd.Flags().StringVar(&kustomizationArgs.decryptionSecret, "decryption-secret", "", "set the Kubernetes secret name that contains the OpenPGP private keys used for sops decryption") createKsCmd.Flags().StringVar(&kustomizationArgs.decryptionSecret, "decryption-secret", "", "set the Kubernetes secret name that contains the OpenPGP private keys used for sops decryption")
@@ -151,7 +150,7 @@ func createKsCmdRun(cmd *cobra.Command, args []string) error {
Interval: metav1.Duration{ Interval: metav1.Duration{
Duration: createArgs.interval, Duration: createArgs.interval,
}, },
Path: filepath.ToSlash(kustomizationArgs.path.String()), Path: kustomizationArgs.path.ToSlash(),
Prune: kustomizationArgs.prune, Prune: kustomizationArgs.prune,
SourceRef: kustomizev1.CrossNamespaceSourceReference{ SourceRef: kustomizev1.CrossNamespaceSourceReference{
Kind: kustomizationArgs.source.Kind, Kind: kustomizationArgs.source.Kind,

View File

@@ -61,8 +61,8 @@ var receiverArgs receiverFlags
func init() { func init() {
createReceiverCmd.Flags().StringVar(&receiverArgs.receiverType, "type", "", "") createReceiverCmd.Flags().StringVar(&receiverArgs.receiverType, "type", "", "")
createReceiverCmd.Flags().StringVar(&receiverArgs.secretRef, "secret-ref", "", "") createReceiverCmd.Flags().StringVar(&receiverArgs.secretRef, "secret-ref", "", "")
createReceiverCmd.Flags().StringArrayVar(&receiverArgs.events, "event", []string{}, "") createReceiverCmd.Flags().StringSliceVar(&receiverArgs.events, "event", []string{}, "also accepts comma-separated values")
createReceiverCmd.Flags().StringArrayVar(&receiverArgs.resources, "resource", []string{}, "") createReceiverCmd.Flags().StringSliceVar(&receiverArgs.resources, "resource", []string{}, "also accepts comma-separated values")
createCmd.AddCommand(createReceiverCmd) createCmd.AddCommand(createReceiverCmd)
} }

View File

@@ -50,6 +50,13 @@ For Git over HTTP/S, the provided basic authentication credentials are stored in
--url=ssh://git@github.com/stefanprodan/podinfo \ --url=ssh://git@github.com/stefanprodan/podinfo \
--private-key-file=./private.key --private-key-file=./private.key
# Create a Git SSH authentication secret with a passworded private key from file
# The public SSH host key will still be gathered from the host
flux create secret git podinfo-auth \
--url=ssh://git@github.com/stefanprodan/podinfo \
--private-key-file=./private.key \
--password=<password>
# Create a secret for a Git repository using basic authentication # Create a secret for a Git repository using basic authentication
flux create secret git podinfo-auth \ flux create secret git podinfo-auth \
--url=https://github.com/stefanprodan/podinfo \ --url=https://github.com/stefanprodan/podinfo \
@@ -140,6 +147,7 @@ func createSecretGitCmdRun(cmd *cobra.Command, args []string) error {
opts.PrivateKeyAlgorithm = sourcesecret.PrivateKeyAlgorithm(secretGitArgs.keyAlgorithm) opts.PrivateKeyAlgorithm = sourcesecret.PrivateKeyAlgorithm(secretGitArgs.keyAlgorithm)
opts.RSAKeyBits = int(secretGitArgs.rsaBits) opts.RSAKeyBits = int(secretGitArgs.rsaBits)
opts.ECDSACurve = secretGitArgs.ecdsaCurve.Curve opts.ECDSACurve = secretGitArgs.ecdsaCurve.Curve
opts.Password = secretGitArgs.password
case "http", "https": case "http", "https":
if secretGitArgs.username == "" || secretGitArgs.password == "" { if secretGitArgs.username == "" || secretGitArgs.password == "" {
return fmt.Errorf("for Git over HTTP/S the username and password are required") return fmt.Errorf("for Git over HTTP/S the username and password are required")

View File

@@ -101,6 +101,15 @@ For private Git repositories, the basic authentication credentials are stored in
--branch=master \ --branch=master \
--private-key-file=./private.key --private-key-file=./private.key
# Create a source for a Git repository using SSH authentication and a
# private key with a password from file
# The public SSH host key will still be gathered from the host
flux create source git podinfo \
--url=ssh://git@github.com/stefanprodan/podinfo \
--branch=master \
--private-key-file=./private.key \
--password=<password>
# Create a source for a Git repository using basic authentication # Create a source for a Git repository using basic authentication
flux create source git podinfo \ flux create source git podinfo \
--url=https://github.com/stefanprodan/podinfo \ --url=https://github.com/stefanprodan/podinfo \
@@ -113,7 +122,7 @@ var sourceGitArgs = newSourceGitFlags()
func init() { func init() {
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.url, "url", "", "git address, e.g. ssh://git@host/org/repository") createSourceGitCmd.Flags().StringVar(&sourceGitArgs.url, "url", "", "git address, e.g. ssh://git@host/org/repository")
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.branch, "branch", "master", "git branch") createSourceGitCmd.Flags().StringVar(&sourceGitArgs.branch, "branch", "", "git branch")
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.tag, "tag", "", "git tag") createSourceGitCmd.Flags().StringVar(&sourceGitArgs.tag, "tag", "", "git tag")
createSourceGitCmd.Flags().StringVar(&sourceGitArgs.semver, "tag-semver", "", "git tag semver range") createSourceGitCmd.Flags().StringVar(&sourceGitArgs.semver, "tag-semver", "", "git tag semver range")
createSourceGitCmd.Flags().StringVarP(&sourceGitArgs.username, "username", "u", "", "basic authentication username") createSourceGitCmd.Flags().StringVarP(&sourceGitArgs.username, "username", "u", "", "basic authentication username")
@@ -157,6 +166,10 @@ func createSourceGitCmdRun(cmd *cobra.Command, args []string) error {
return fmt.Errorf("git URL scheme '%s' not supported, can be: ssh, http and https", u.Scheme) return fmt.Errorf("git URL scheme '%s' not supported, can be: ssh, http and https", u.Scheme)
} }
if sourceGitArgs.branch == "" && sourceGitArgs.tag == "" && sourceGitArgs.semver == "" {
return fmt.Errorf("a Git ref is required, use one of the following: --branch, --tag or --tag-semver")
}
if sourceGitArgs.caFile != "" && u.Scheme == "ssh" { if sourceGitArgs.caFile != "" && u.Scheme == "ssh" {
return fmt.Errorf("specifing a CA file is not supported for Git over SSH") return fmt.Errorf("specifing a CA file is not supported for Git over SSH")
} }
@@ -236,6 +249,7 @@ func createSourceGitCmdRun(cmd *cobra.Command, args []string) error {
secretOpts.PrivateKeyAlgorithm = sourcesecret.PrivateKeyAlgorithm(sourceGitArgs.keyAlgorithm) secretOpts.PrivateKeyAlgorithm = sourcesecret.PrivateKeyAlgorithm(sourceGitArgs.keyAlgorithm)
secretOpts.RSAKeyBits = int(sourceGitArgs.keyRSABits) secretOpts.RSAKeyBits = int(sourceGitArgs.keyRSABits)
secretOpts.ECDSACurve = sourceGitArgs.keyECDSACurve.Curve secretOpts.ECDSACurve = sourceGitArgs.keyECDSACurve.Curve
secretOpts.Password = sourceGitArgs.password
case "https": case "https":
secretOpts.Username = sourceGitArgs.username secretOpts.Username = sourceGitArgs.username
secretOpts.Password = sourceGitArgs.password secretOpts.Password = sourceGitArgs.password

View File

@@ -19,7 +19,7 @@ package main
import ( import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1" imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2"
) )
var deleteImagePolicyCmd = &cobra.Command{ var deleteImagePolicyCmd = &cobra.Command{

View File

@@ -19,7 +19,7 @@ package main
import ( import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1" imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2"
) )
var deleteImageRepositoryCmd = &cobra.Command{ var deleteImageRepositoryCmd = &cobra.Command{

View File

@@ -19,7 +19,7 @@ package main
import ( import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha1" autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha2"
) )
var deleteImageUpdateCmd = &cobra.Command{ var deleteImageUpdateCmd = &cobra.Command{

View File

@@ -59,7 +59,7 @@ func docgenCmdRun(cmd *cobra.Command, args []string) error {
func frontmatterPrepender(filename string) string { func frontmatterPrepender(filename string) string {
name := filepath.Base(filename) name := filepath.Base(filename)
base := strings.TrimSuffix(name, path.Ext(name)) base := strings.TrimSuffix(name, path.Ext(name))
title := strings.Replace(base, "_", " ", -1) + " command" title := strings.Replace(base, "_", " ", -1)
return fmt.Sprintf(fmTemplate, title) return fmt.Sprintf(fmTemplate, title)
} }

View File

@@ -20,7 +20,7 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1" imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2"
) )
var exportImagePolicyCmd = &cobra.Command{ var exportImagePolicyCmd = &cobra.Command{

View File

@@ -20,7 +20,7 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1" imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2"
) )
var exportImageRepositoryCmd = &cobra.Command{ var exportImageRepositoryCmd = &cobra.Command{

View File

@@ -20,7 +20,7 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha1" autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha2"
) )
var exportImageUpdateCmd = &cobra.Command{ var exportImageUpdateCmd = &cobra.Command{

91
cmd/flux/get_all.go Normal file
View File

@@ -0,0 +1,91 @@
/*
Copyright 2021 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package main
import (
"strings"
"github.com/spf13/cobra"
helmv2 "github.com/fluxcd/helm-controller/api/v2beta1"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta1"
notificationv1 "github.com/fluxcd/notification-controller/api/v1beta1"
)
var getAllCmd = &cobra.Command{
Use: "all",
Short: "Get all resources and statuses",
Long: "The get all command print the statuses of all resources.",
Example: ` # List all resources in a namespace
flux get all --namespace=flux-system
# List all resources in all namespaces
flux get all --all-namespaces`,
RunE: func(cmd *cobra.Command, args []string) error {
err := getSourceAllCmd.RunE(cmd, args)
if err != nil {
logError(err)
}
// all get command
var allCmd = []getCommand{
{
apiType: helmReleaseType,
list: &helmReleaseListAdapter{&helmv2.HelmReleaseList{}},
},
{
apiType: kustomizationType,
list: &kustomizationListAdapter{&kustomizev1.KustomizationList{}},
},
{
apiType: receiverType,
list: receiverListAdapter{&notificationv1.ReceiverList{}},
},
{
apiType: alertProviderType,
list: alertProviderListAdapter{&notificationv1.ProviderList{}},
},
{
apiType: alertType,
list: &alertListAdapter{&notificationv1.AlertList{}},
},
}
err = getImageAllCmd.RunE(cmd, args)
if err != nil {
logError(err)
}
for _, c := range allCmd {
if err := c.run(cmd, args); err != nil {
logError(err)
}
}
return nil
},
}
func logError(err error) {
if !strings.Contains(err.Error(), "no matches for kind") {
logger.Failuref(err.Error())
}
}
func init() {
getCmd.AddCommand(getAllCmd)
}

View File

@@ -17,10 +17,12 @@ limitations under the License.
package main package main
import ( import (
"strings"
"github.com/spf13/cobra" "github.com/spf13/cobra"
autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha1" autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha2"
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1" imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2"
) )
var getImageAllCmd = &cobra.Command{ var getImageAllCmd = &cobra.Command{
@@ -33,28 +35,27 @@ var getImageAllCmd = &cobra.Command{
# List all image objects in all namespaces # List all image objects in all namespaces
flux get images all --all-namespaces`, flux get images all --all-namespaces`,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
c := getCommand{ var allImageCmd = []getCommand{
apiType: imageRepositoryType, {
list: imageRepositoryListAdapter{&imagev1.ImageRepositoryList{}}, apiType: imageRepositoryType,
} list: imageRepositoryListAdapter{&imagev1.ImageRepositoryList{}},
if err := c.run(cmd, args); err != nil { },
logger.Failuref(err.Error()) {
apiType: imagePolicyType,
list: &imagePolicyListAdapter{&imagev1.ImagePolicyList{}},
},
{
apiType: imageUpdateAutomationType,
list: &imageUpdateAutomationListAdapter{&autov1.ImageUpdateAutomationList{}},
},
} }
c = getCommand{ for _, c := range allImageCmd {
apiType: imagePolicyType, if err := c.run(cmd, args); err != nil {
list: &imagePolicyListAdapter{&imagev1.ImagePolicyList{}}, if !strings.Contains(err.Error(), "no matches for kind") {
} logger.Failuref(err.Error())
if err := c.run(cmd, args); err != nil { }
logger.Failuref(err.Error()) }
}
c = getCommand{
apiType: imageUpdateAutomationType,
list: &imageUpdateAutomationListAdapter{&autov1.ImageUpdateAutomationList{}},
}
if err := c.run(cmd, args); err != nil {
logger.Failuref(err.Error())
} }
return nil return nil

View File

@@ -19,7 +19,7 @@ package main
import ( import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1" imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2"
) )
var getImagePolicyCmd = &cobra.Command{ var getImagePolicyCmd = &cobra.Command{

View File

@@ -23,7 +23,7 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1" imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2"
) )
var getImageRepositoryCmd = &cobra.Command{ var getImageRepositoryCmd = &cobra.Command{

View File

@@ -23,7 +23,7 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha1" autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha2"
) )
var getImageUpdateCmd = &cobra.Command{ var getImageUpdateCmd = &cobra.Command{

View File

@@ -17,6 +17,8 @@ limitations under the License.
package main package main
import ( import (
"strings"
"github.com/spf13/cobra" "github.com/spf13/cobra"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta1" sourcev1 "github.com/fluxcd/source-controller/api/v1beta1"
@@ -32,36 +34,31 @@ var getSourceAllCmd = &cobra.Command{
# List all sources in all namespaces # List all sources in all namespaces
flux get sources all --all-namespaces`, flux get sources all --all-namespaces`,
RunE: func(cmd *cobra.Command, args []string) error { RunE: func(cmd *cobra.Command, args []string) error {
c := getCommand{ var allSourceCmd = []getCommand{
apiType: bucketType, {
list: &bucketListAdapter{&sourcev1.BucketList{}}, apiType: bucketType,
} list: &bucketListAdapter{&sourcev1.BucketList{}},
if err := c.run(cmd, args); err != nil { },
logger.Failuref(err.Error()) {
apiType: gitRepositoryType,
list: &gitRepositoryListAdapter{&sourcev1.GitRepositoryList{}},
},
{
apiType: helmRepositoryType,
list: &helmRepositoryListAdapter{&sourcev1.HelmRepositoryList{}},
},
{
apiType: helmChartType,
list: &helmChartListAdapter{&sourcev1.HelmChartList{}},
},
} }
c = getCommand{ for _, c := range allSourceCmd {
apiType: gitRepositoryType, if err := c.run(cmd, args); err != nil {
list: &gitRepositoryListAdapter{&sourcev1.GitRepositoryList{}}, if !strings.Contains(err.Error(), "no matches for kind") {
} logger.Failuref(err.Error())
if err := c.run(cmd, args); err != nil { }
logger.Failuref(err.Error()) }
}
c = getCommand{
apiType: helmRepositoryType,
list: &helmRepositoryListAdapter{&sourcev1.HelmRepositoryList{}},
}
if err := c.run(cmd, args); err != nil {
logger.Failuref(err.Error())
}
c = getCommand{
apiType: helmChartType,
list: &helmChartListAdapter{&sourcev1.HelmChartList{}},
}
if err := c.run(cmd, args); err != nil {
logger.Failuref(err.Error())
} }
return nil return nil

View File

@@ -19,8 +19,8 @@ package main
import ( import (
"sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client"
autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha1" autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha2"
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1" imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2"
) )
// These are general-purpose adapters for attaching methods to, for // These are general-purpose adapters for attaching methods to, for

View File

@@ -18,6 +18,7 @@ package main
import ( import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/apimachinery/pkg/types"
helmv2 "github.com/fluxcd/helm-controller/api/v2beta1" helmv2 "github.com/fluxcd/helm-controller/api/v2beta1"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta1" sourcev1 "github.com/fluxcd/source-controller/api/v1beta1"
@@ -60,7 +61,7 @@ func (obj helmReleaseAdapter) reconcileSource() bool {
return rhrArgs.syncHrWithSource return rhrArgs.syncHrWithSource
} }
func (obj helmReleaseAdapter) getSource() (reconcileCommand, string) { func (obj helmReleaseAdapter) getSource() (reconcileCommand, types.NamespacedName) {
var cmd reconcileCommand var cmd reconcileCommand
switch obj.Spec.Chart.Spec.SourceRef.Kind { switch obj.Spec.Chart.Spec.SourceRef.Kind {
case sourcev1.HelmRepositoryKind: case sourcev1.HelmRepositoryKind:
@@ -80,5 +81,8 @@ func (obj helmReleaseAdapter) getSource() (reconcileCommand, string) {
} }
} }
return cmd, obj.Spec.Chart.Spec.SourceRef.Name return cmd, types.NamespacedName{
Name: obj.Spec.Chart.Spec.SourceRef.Name,
Namespace: obj.Spec.Chart.Spec.SourceRef.Namespace,
}
} }

View File

@@ -21,7 +21,7 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1" imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2"
) )
var reconcileImageRepositoryCmd = &cobra.Command{ var reconcileImageRepositoryCmd = &cobra.Command{

View File

@@ -22,7 +22,7 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
apimeta "k8s.io/apimachinery/pkg/api/meta" apimeta "k8s.io/apimachinery/pkg/api/meta"
autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha1" autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha2"
meta "github.com/fluxcd/pkg/apis/meta" meta "github.com/fluxcd/pkg/apis/meta"
) )

View File

@@ -18,6 +18,7 @@ package main
import ( import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/apimachinery/pkg/types"
kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta1" kustomizev1 "github.com/fluxcd/kustomize-controller/api/v1beta1"
sourcev1 "github.com/fluxcd/source-controller/api/v1beta1" sourcev1 "github.com/fluxcd/source-controller/api/v1beta1"
@@ -60,7 +61,7 @@ func (obj kustomizationAdapter) reconcileSource() bool {
return rksArgs.syncKsWithSource return rksArgs.syncKsWithSource
} }
func (obj kustomizationAdapter) getSource() (reconcileCommand, string) { func (obj kustomizationAdapter) getSource() (reconcileCommand, types.NamespacedName) {
var cmd reconcileCommand var cmd reconcileCommand
switch obj.Spec.SourceRef.Kind { switch obj.Spec.SourceRef.Kind {
case sourcev1.GitRepositoryKind: case sourcev1.GitRepositoryKind:
@@ -75,5 +76,8 @@ func (obj kustomizationAdapter) getSource() (reconcileCommand, string) {
} }
} }
return cmd, obj.Spec.SourceRef.Name return cmd, types.NamespacedName{
Name: obj.Spec.SourceRef.Name,
Namespace: obj.Spec.SourceRef.Namespace,
}
} }

View File

@@ -18,7 +18,7 @@ type reconcileWithSource interface {
adapter adapter
reconcilable reconcilable
reconcileSource() bool reconcileSource() bool
getSource() (reconcileCommand, string) getSource() (reconcileCommand, types.NamespacedName)
} }
type reconcileWithSourceCommand struct { type reconcileWithSourceCommand struct {
@@ -55,14 +55,13 @@ func (reconcile reconcileWithSourceCommand) run(cmd *cobra.Command, args []strin
} }
if reconcile.object.reconcileSource() { if reconcile.object.reconcileSource() {
reconcileCmd, nsName := reconcile.object.getSource()
nsCopy := rootArgs.namespace nsCopy := rootArgs.namespace
objectNs := reconcile.object.asClientObject().GetNamespace() if nsName.Namespace != "" {
if objectNs != "" { rootArgs.namespace = nsName.Namespace
rootArgs.namespace = reconcile.object.asClientObject().GetNamespace()
} }
reconcileCmd, sourceName := reconcile.object.getSource() err := reconcileCmd.run(nil, []string{nsName.Name})
err := reconcileCmd.run(nil, []string{sourceName})
if err != nil { if err != nil {
return err return err
} }

View File

@@ -23,6 +23,7 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/wait" "k8s.io/apimachinery/pkg/util/wait"
"sigs.k8s.io/controller-runtime/pkg/client"
"github.com/fluxcd/flux2/internal/utils" "github.com/fluxcd/flux2/internal/utils"
) )
@@ -33,7 +34,15 @@ var resumeCmd = &cobra.Command{
Long: "The resume sub-commands resume a suspended resource.", Long: "The resume sub-commands resume a suspended resource.",
} }
type ResumeFlags struct {
all bool
}
var resumeArgs ResumeFlags
func init() { func init() {
resumeCmd.PersistentFlags().BoolVarP(&resumeArgs.all, "all", "", false,
"suspend all resources in that namespace")
rootCmd.AddCommand(resumeCmd) rootCmd.AddCommand(resumeCmd)
} }
@@ -47,13 +56,18 @@ type resumable interface {
type resumeCommand struct { type resumeCommand struct {
apiType apiType
object resumable object resumable
list listResumable
}
type listResumable interface {
listAdapter
resumeItem(i int) resumable
} }
func (resume resumeCommand) run(cmd *cobra.Command, args []string) error { func (resume resumeCommand) run(cmd *cobra.Command, args []string) error {
if len(args) < 1 { if len(args) < 1 && !resumeArgs.all {
return fmt.Errorf("%s name is required", resume.humanKind) return fmt.Errorf("%s name is required", resume.humanKind)
} }
name := args[0]
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout) ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
defer cancel() defer cancel()
@@ -63,29 +77,46 @@ func (resume resumeCommand) run(cmd *cobra.Command, args []string) error {
return err return err
} }
namespacedName := types.NamespacedName{ var listOpts []client.ListOption
Namespace: rootArgs.namespace, listOpts = append(listOpts, client.InNamespace(rootArgs.namespace))
Name: name, if len(args) > 0 {
listOpts = append(listOpts, client.MatchingFields{
"metadata.name": args[0],
})
} }
err = kubeClient.Get(ctx, namespacedName, resume.object.asClientObject()) err = kubeClient.List(ctx, resume.list.asClientList(), listOpts...)
if err != nil { if err != nil {
return err return err
} }
logger.Actionf("resuming %s %s in %s namespace", resume.humanKind, name, rootArgs.namespace) if resume.list.len() == 0 {
resume.object.setUnsuspended() logger.Failuref("no %s objects found in %s namespace", resume.kind, rootArgs.namespace)
if err := kubeClient.Update(ctx, resume.object.asClientObject()); err != nil { return nil
return err
} }
logger.Successf("%s resumed", resume.humanKind)
logger.Waitingf("waiting for %s reconciliation", resume.kind) for i := 0; i < resume.list.len(); i++ {
if err := wait.PollImmediate(rootArgs.pollInterval, rootArgs.timeout, logger.Actionf("resuming %s %s in %s namespace", resume.humanKind, resume.list.resumeItem(i).asClientObject().GetName(), rootArgs.namespace)
isReady(ctx, kubeClient, namespacedName, resume.object)); err != nil { resume.list.resumeItem(i).setUnsuspended()
return err if err := kubeClient.Update(ctx, resume.list.resumeItem(i).asClientObject()); err != nil {
return err
}
logger.Successf("%s resumed", resume.humanKind)
namespacedName := types.NamespacedName{
Name: resume.list.resumeItem(i).asClientObject().GetName(),
Namespace: rootArgs.namespace,
}
logger.Waitingf("waiting for %s reconciliation", resume.kind)
if err := wait.PollImmediate(rootArgs.pollInterval, rootArgs.timeout,
isReady(ctx, kubeClient, namespacedName, resume.list.resumeItem(i))); err != nil {
logger.Failuref(err.Error())
continue
}
logger.Successf("%s reconciliation completed", resume.kind)
logger.Successf(resume.list.resumeItem(i).successMessage())
} }
logger.Successf("%s reconciliation completed", resume.kind)
logger.Successf(resume.object.successMessage())
return nil return nil
} }

View File

@@ -32,6 +32,7 @@ finish the apply.`,
RunE: resumeCommand{ RunE: resumeCommand{
apiType: alertType, apiType: alertType,
object: alertAdapter{&notificationv1.Alert{}}, object: alertAdapter{&notificationv1.Alert{}},
list: &alertListAdapter{&notificationv1.AlertList{}},
}.run, }.run,
} }
@@ -50,3 +51,7 @@ func (obj alertAdapter) setUnsuspended() {
func (obj alertAdapter) successMessage() string { func (obj alertAdapter) successMessage() string {
return "Alert reconciliation completed" return "Alert reconciliation completed"
} }
func (a alertListAdapter) resumeItem(i int) resumable {
return &alertAdapter{&a.AlertList.Items[i]}
}

View File

@@ -35,6 +35,7 @@ finish the apply.`,
RunE: resumeCommand{ RunE: resumeCommand{
apiType: helmReleaseType, apiType: helmReleaseType,
object: helmReleaseAdapter{&helmv2.HelmRelease{}}, object: helmReleaseAdapter{&helmv2.HelmRelease{}},
list: helmReleaseListAdapter{&helmv2.HelmReleaseList{}},
}.run, }.run,
} }
@@ -53,3 +54,7 @@ func (obj helmReleaseAdapter) setUnsuspended() {
func (obj helmReleaseAdapter) successMessage() string { func (obj helmReleaseAdapter) successMessage() string {
return fmt.Sprintf("applied revision %s", obj.Status.LastAppliedRevision) return fmt.Sprintf("applied revision %s", obj.Status.LastAppliedRevision)
} }
func (a helmReleaseListAdapter) resumeItem(i int) resumable {
return &helmReleaseAdapter{&a.HelmReleaseList.Items[i]}
}

View File

@@ -19,7 +19,7 @@ package main
import ( import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1" imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2"
) )
var resumeImageRepositoryCmd = &cobra.Command{ var resumeImageRepositoryCmd = &cobra.Command{
@@ -31,6 +31,7 @@ var resumeImageRepositoryCmd = &cobra.Command{
RunE: resumeCommand{ RunE: resumeCommand{
apiType: imageRepositoryType, apiType: imageRepositoryType,
object: imageRepositoryAdapter{&imagev1.ImageRepository{}}, object: imageRepositoryAdapter{&imagev1.ImageRepository{}},
list: imageRepositoryListAdapter{&imagev1.ImageRepositoryList{}},
}.run, }.run,
} }
@@ -45,3 +46,7 @@ func (obj imageRepositoryAdapter) getObservedGeneration() int64 {
func (obj imageRepositoryAdapter) setUnsuspended() { func (obj imageRepositoryAdapter) setUnsuspended() {
obj.ImageRepository.Spec.Suspend = false obj.ImageRepository.Spec.Suspend = false
} }
func (a imageRepositoryListAdapter) resumeItem(i int) resumable {
return &imageRepositoryAdapter{&a.ImageRepositoryList.Items[i]}
}

View File

@@ -19,7 +19,7 @@ package main
import ( import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha1" autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha2"
) )
var resumeImageUpdateCmd = &cobra.Command{ var resumeImageUpdateCmd = &cobra.Command{
@@ -31,6 +31,7 @@ var resumeImageUpdateCmd = &cobra.Command{
RunE: resumeCommand{ RunE: resumeCommand{
apiType: imageUpdateAutomationType, apiType: imageUpdateAutomationType,
object: imageUpdateAutomationAdapter{&autov1.ImageUpdateAutomation{}}, object: imageUpdateAutomationAdapter{&autov1.ImageUpdateAutomation{}},
list: imageUpdateAutomationListAdapter{&autov1.ImageUpdateAutomationList{}},
}.run, }.run,
} }
@@ -45,3 +46,7 @@ func (obj imageUpdateAutomationAdapter) setUnsuspended() {
func (obj imageUpdateAutomationAdapter) getObservedGeneration() int64 { func (obj imageUpdateAutomationAdapter) getObservedGeneration() int64 {
return obj.ImageUpdateAutomation.Status.ObservedGeneration return obj.ImageUpdateAutomation.Status.ObservedGeneration
} }
func (a imageUpdateAutomationListAdapter) resumeItem(i int) resumable {
return &imageUpdateAutomationAdapter{&a.ImageUpdateAutomationList.Items[i]}
}

View File

@@ -35,6 +35,7 @@ finish the apply.`,
RunE: resumeCommand{ RunE: resumeCommand{
apiType: kustomizationType, apiType: kustomizationType,
object: kustomizationAdapter{&kustomizev1.Kustomization{}}, object: kustomizationAdapter{&kustomizev1.Kustomization{}},
list: kustomizationListAdapter{&kustomizev1.KustomizationList{}},
}.run, }.run,
} }
@@ -53,3 +54,7 @@ func (obj kustomizationAdapter) setUnsuspended() {
func (obj kustomizationAdapter) successMessage() string { func (obj kustomizationAdapter) successMessage() string {
return fmt.Sprintf("applied revision %s", obj.Status.LastAppliedRevision) return fmt.Sprintf("applied revision %s", obj.Status.LastAppliedRevision)
} }
func (a kustomizationListAdapter) resumeItem(i int) resumable {
return &kustomizationAdapter{&a.KustomizationList.Items[i]}
}

View File

@@ -32,6 +32,7 @@ finish the apply.`,
RunE: resumeCommand{ RunE: resumeCommand{
apiType: receiverType, apiType: receiverType,
object: receiverAdapter{&notificationv1.Receiver{}}, object: receiverAdapter{&notificationv1.Receiver{}},
list: receiverListAdapter{&notificationv1.ReceiverList{}},
}.run, }.run,
} }
@@ -50,3 +51,7 @@ func (obj receiverAdapter) setUnsuspended() {
func (obj receiverAdapter) successMessage() string { func (obj receiverAdapter) successMessage() string {
return "Receiver reconciliation completed" return "Receiver reconciliation completed"
} }
func (a receiverListAdapter) resumeItem(i int) resumable {
return &receiverAdapter{&a.ReceiverList.Items[i]}
}

View File

@@ -45,3 +45,7 @@ func (obj bucketAdapter) getObservedGeneration() int64 {
func (obj bucketAdapter) setUnsuspended() { func (obj bucketAdapter) setUnsuspended() {
obj.Bucket.Spec.Suspend = false obj.Bucket.Spec.Suspend = false
} }
func (a bucketListAdapter) resumeItem(i int) resumable {
return &bucketAdapter{&a.BucketList.Items[i]}
}

View File

@@ -33,6 +33,7 @@ var resumeSourceHelmChartCmd = &cobra.Command{
RunE: resumeCommand{ RunE: resumeCommand{
apiType: helmChartType, apiType: helmChartType,
object: &helmChartAdapter{&sourcev1.HelmChart{}}, object: &helmChartAdapter{&sourcev1.HelmChart{}},
list: &helmChartListAdapter{&sourcev1.HelmChartList{}},
}.run, }.run,
} }
@@ -51,3 +52,7 @@ func (obj helmChartAdapter) setUnsuspended() {
func (obj helmChartAdapter) successMessage() string { func (obj helmChartAdapter) successMessage() string {
return fmt.Sprintf("fetched revision %s", obj.Status.Artifact.Revision) return fmt.Sprintf("fetched revision %s", obj.Status.Artifact.Revision)
} }
func (a helmChartListAdapter) resumeItem(i int) resumable {
return &helmChartAdapter{&a.HelmChartList.Items[i]}
}

View File

@@ -31,6 +31,7 @@ var resumeSourceGitCmd = &cobra.Command{
RunE: resumeCommand{ RunE: resumeCommand{
apiType: gitRepositoryType, apiType: gitRepositoryType,
object: gitRepositoryAdapter{&sourcev1.GitRepository{}}, object: gitRepositoryAdapter{&sourcev1.GitRepository{}},
list: gitRepositoryListAdapter{&sourcev1.GitRepositoryList{}},
}.run, }.run,
} }
@@ -45,3 +46,7 @@ func (obj gitRepositoryAdapter) getObservedGeneration() int64 {
func (obj gitRepositoryAdapter) setUnsuspended() { func (obj gitRepositoryAdapter) setUnsuspended() {
obj.GitRepository.Spec.Suspend = false obj.GitRepository.Spec.Suspend = false
} }
func (a gitRepositoryListAdapter) resumeItem(i int) resumable {
return &gitRepositoryAdapter{&a.GitRepositoryList.Items[i]}
}

View File

@@ -31,6 +31,7 @@ var resumeSourceHelmCmd = &cobra.Command{
RunE: resumeCommand{ RunE: resumeCommand{
apiType: helmRepositoryType, apiType: helmRepositoryType,
object: helmRepositoryAdapter{&sourcev1.HelmRepository{}}, object: helmRepositoryAdapter{&sourcev1.HelmRepository{}},
list: helmRepositoryListAdapter{&sourcev1.HelmRepositoryList{}},
}.run, }.run,
} }
@@ -45,3 +46,7 @@ func (obj helmRepositoryAdapter) getObservedGeneration() int64 {
func (obj helmRepositoryAdapter) setUnsuspended() { func (obj helmRepositoryAdapter) setUnsuspended() {
obj.HelmRepository.Spec.Suspend = false obj.HelmRepository.Spec.Suspend = false
} }
func (a helmRepositoryListAdapter) resumeItem(i int) resumable {
return &helmRepositoryAdapter{&a.HelmRepositoryList.Items[i]}
}

View File

@@ -21,7 +21,7 @@ import (
"fmt" "fmt"
"github.com/spf13/cobra" "github.com/spf13/cobra"
"k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client"
"github.com/fluxcd/flux2/internal/utils" "github.com/fluxcd/flux2/internal/utils"
) )
@@ -32,7 +32,15 @@ var suspendCmd = &cobra.Command{
Long: "The suspend sub-commands suspend the reconciliation of a resource.", Long: "The suspend sub-commands suspend the reconciliation of a resource.",
} }
type SuspendFlags struct {
all bool
}
var suspendArgs SuspendFlags
func init() { func init() {
suspendCmd.PersistentFlags().BoolVarP(&suspendArgs.all, "all", "", false,
"suspend all resources in that namespace")
rootCmd.AddCommand(suspendCmd) rootCmd.AddCommand(suspendCmd)
} }
@@ -44,14 +52,19 @@ type suspendable interface {
type suspendCommand struct { type suspendCommand struct {
apiType apiType
list listSuspendable
object suspendable object suspendable
} }
type listSuspendable interface {
listAdapter
item(i int) suspendable
}
func (suspend suspendCommand) run(cmd *cobra.Command, args []string) error { func (suspend suspendCommand) run(cmd *cobra.Command, args []string) error {
if len(args) < 1 { if len(args) < 1 && !suspendArgs.all {
return fmt.Errorf("%s name is required", suspend.humanKind) return fmt.Errorf("%s name is required", suspend.humanKind)
} }
name := args[0]
ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout) ctx, cancel := context.WithTimeout(context.Background(), rootArgs.timeout)
defer cancel() defer cancel()
@@ -61,21 +74,33 @@ func (suspend suspendCommand) run(cmd *cobra.Command, args []string) error {
return err return err
} }
namespacedName := types.NamespacedName{ var listOpts []client.ListOption
Namespace: rootArgs.namespace, listOpts = append(listOpts, client.InNamespace(rootArgs.namespace))
Name: name, if len(args) > 0 {
listOpts = append(listOpts, client.MatchingFields{
"metadata.name": args[0],
})
} }
err = kubeClient.Get(ctx, namespacedName, suspend.object.asClientObject())
err = kubeClient.List(ctx, suspend.list.asClientList(), listOpts...)
if err != nil { if err != nil {
return err return err
} }
logger.Actionf("suspending %s %s in %s namespace", suspend.humanKind, name, rootArgs.namespace) if suspend.list.len() == 0 {
suspend.object.setSuspended() logger.Failuref("no %s objects found in %s namespace", suspend.kind, rootArgs.namespace)
if err := kubeClient.Update(ctx, suspend.object.asClientObject()); err != nil { return nil
return err }
for i := 0; i < suspend.list.len(); i++ {
logger.Actionf("suspending %s %s in %s namespace", suspend.humanKind, suspend.list.item(i).asClientObject().GetName(), rootArgs.namespace)
suspend.list.item(i).setSuspended()
if err := kubeClient.Update(ctx, suspend.list.item(i).asClientObject()); err != nil {
return err
}
logger.Successf("%s suspended", suspend.humanKind)
} }
logger.Successf("%s suspended", suspend.humanKind)
return nil return nil
} }

View File

@@ -31,6 +31,7 @@ var suspendAlertCmd = &cobra.Command{
RunE: suspendCommand{ RunE: suspendCommand{
apiType: alertType, apiType: alertType,
object: &alertAdapter{&notificationv1.Alert{}}, object: &alertAdapter{&notificationv1.Alert{}},
list: &alertListAdapter{&notificationv1.AlertList{}},
}.run, }.run,
} }
@@ -45,3 +46,7 @@ func (obj alertAdapter) isSuspended() bool {
func (obj alertAdapter) setSuspended() { func (obj alertAdapter) setSuspended() {
obj.Alert.Spec.Suspend = true obj.Alert.Spec.Suspend = true
} }
func (a alertListAdapter) item(i int) suspendable {
return &alertAdapter{&a.AlertList.Items[i]}
}

View File

@@ -32,6 +32,7 @@ var suspendHrCmd = &cobra.Command{
RunE: suspendCommand{ RunE: suspendCommand{
apiType: helmReleaseType, apiType: helmReleaseType,
object: &helmReleaseAdapter{&helmv2.HelmRelease{}}, object: &helmReleaseAdapter{&helmv2.HelmRelease{}},
list: &helmReleaseListAdapter{&helmv2.HelmReleaseList{}},
}.run, }.run,
} }
@@ -46,3 +47,7 @@ func (obj helmReleaseAdapter) isSuspended() bool {
func (obj helmReleaseAdapter) setSuspended() { func (obj helmReleaseAdapter) setSuspended() {
obj.HelmRelease.Spec.Suspend = true obj.HelmRelease.Spec.Suspend = true
} }
func (a helmReleaseListAdapter) item(i int) suspendable {
return &helmReleaseAdapter{&a.HelmReleaseList.Items[i]}
}

View File

@@ -19,7 +19,7 @@ package main
import ( import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha1" imagev1 "github.com/fluxcd/image-reflector-controller/api/v1alpha2"
) )
var suspendImageRepositoryCmd = &cobra.Command{ var suspendImageRepositoryCmd = &cobra.Command{
@@ -31,6 +31,7 @@ var suspendImageRepositoryCmd = &cobra.Command{
RunE: suspendCommand{ RunE: suspendCommand{
apiType: imageRepositoryType, apiType: imageRepositoryType,
object: imageRepositoryAdapter{&imagev1.ImageRepository{}}, object: imageRepositoryAdapter{&imagev1.ImageRepository{}},
list: &imageRepositoryListAdapter{&imagev1.ImageRepositoryList{}},
}.run, }.run,
} }
@@ -45,3 +46,7 @@ func (obj imageRepositoryAdapter) isSuspended() bool {
func (obj imageRepositoryAdapter) setSuspended() { func (obj imageRepositoryAdapter) setSuspended() {
obj.ImageRepository.Spec.Suspend = true obj.ImageRepository.Spec.Suspend = true
} }
func (a imageRepositoryListAdapter) item(i int) suspendable {
return &imageRepositoryAdapter{&a.ImageRepositoryList.Items[i]}
}

View File

@@ -19,7 +19,7 @@ package main
import ( import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha1" autov1 "github.com/fluxcd/image-automation-controller/api/v1alpha2"
) )
var suspendImageUpdateCmd = &cobra.Command{ var suspendImageUpdateCmd = &cobra.Command{
@@ -31,6 +31,7 @@ var suspendImageUpdateCmd = &cobra.Command{
RunE: suspendCommand{ RunE: suspendCommand{
apiType: imageUpdateAutomationType, apiType: imageUpdateAutomationType,
object: imageUpdateAutomationAdapter{&autov1.ImageUpdateAutomation{}}, object: imageUpdateAutomationAdapter{&autov1.ImageUpdateAutomation{}},
list: &imageUpdateAutomationListAdapter{&autov1.ImageUpdateAutomationList{}},
}.run, }.run,
} }
@@ -45,3 +46,7 @@ func (update imageUpdateAutomationAdapter) isSuspended() bool {
func (update imageUpdateAutomationAdapter) setSuspended() { func (update imageUpdateAutomationAdapter) setSuspended() {
update.ImageUpdateAutomation.Spec.Suspend = true update.ImageUpdateAutomation.Spec.Suspend = true
} }
func (a imageUpdateAutomationListAdapter) item(i int) suspendable {
return &imageUpdateAutomationAdapter{&a.ImageUpdateAutomationList.Items[i]}
}

View File

@@ -32,6 +32,7 @@ var suspendKsCmd = &cobra.Command{
RunE: suspendCommand{ RunE: suspendCommand{
apiType: kustomizationType, apiType: kustomizationType,
object: kustomizationAdapter{&kustomizev1.Kustomization{}}, object: kustomizationAdapter{&kustomizev1.Kustomization{}},
list: &kustomizationListAdapter{&kustomizev1.KustomizationList{}},
}.run, }.run,
} }
@@ -46,3 +47,7 @@ func (obj kustomizationAdapter) isSuspended() bool {
func (obj kustomizationAdapter) setSuspended() { func (obj kustomizationAdapter) setSuspended() {
obj.Kustomization.Spec.Suspend = true obj.Kustomization.Spec.Suspend = true
} }
func (a kustomizationListAdapter) item(i int) suspendable {
return &kustomizationAdapter{&a.KustomizationList.Items[i]}
}

View File

@@ -31,6 +31,7 @@ var suspendReceiverCmd = &cobra.Command{
RunE: suspendCommand{ RunE: suspendCommand{
apiType: receiverType, apiType: receiverType,
object: &receiverAdapter{&notificationv1.Receiver{}}, object: &receiverAdapter{&notificationv1.Receiver{}},
list: &receiverListAdapter{&notificationv1.ReceiverList{}},
}.run, }.run,
} }
@@ -45,3 +46,7 @@ func (obj receiverAdapter) isSuspended() bool {
func (obj receiverAdapter) setSuspended() { func (obj receiverAdapter) setSuspended() {
obj.Receiver.Spec.Suspend = true obj.Receiver.Spec.Suspend = true
} }
func (a receiverListAdapter) item(i int) suspendable {
return &receiverAdapter{&a.ReceiverList.Items[i]}
}

View File

@@ -31,6 +31,7 @@ var suspendSourceBucketCmd = &cobra.Command{
RunE: suspendCommand{ RunE: suspendCommand{
apiType: bucketType, apiType: bucketType,
object: bucketAdapter{&sourcev1.Bucket{}}, object: bucketAdapter{&sourcev1.Bucket{}},
list: bucketListAdapter{&sourcev1.BucketList{}},
}.run, }.run,
} }
@@ -45,3 +46,7 @@ func (obj bucketAdapter) isSuspended() bool {
func (obj bucketAdapter) setSuspended() { func (obj bucketAdapter) setSuspended() {
obj.Bucket.Spec.Suspend = true obj.Bucket.Spec.Suspend = true
} }
func (a bucketListAdapter) item(i int) suspendable {
return &bucketAdapter{&a.BucketList.Items[i]}
}

View File

@@ -31,6 +31,7 @@ var suspendSourceHelmChartCmd = &cobra.Command{
RunE: suspendCommand{ RunE: suspendCommand{
apiType: helmChartType, apiType: helmChartType,
object: helmChartAdapter{&sourcev1.HelmChart{}}, object: helmChartAdapter{&sourcev1.HelmChart{}},
list: helmChartListAdapter{&sourcev1.HelmChartList{}},
}.run, }.run,
} }
@@ -45,3 +46,7 @@ func (obj helmChartAdapter) isSuspended() bool {
func (obj helmChartAdapter) setSuspended() { func (obj helmChartAdapter) setSuspended() {
obj.HelmChart.Spec.Suspend = true obj.HelmChart.Spec.Suspend = true
} }
func (a helmChartListAdapter) item(i int) suspendable {
return &helmChartAdapter{&a.HelmChartList.Items[i]}
}

View File

@@ -31,6 +31,7 @@ var suspendSourceGitCmd = &cobra.Command{
RunE: suspendCommand{ RunE: suspendCommand{
apiType: gitRepositoryType, apiType: gitRepositoryType,
object: gitRepositoryAdapter{&sourcev1.GitRepository{}}, object: gitRepositoryAdapter{&sourcev1.GitRepository{}},
list: gitRepositoryListAdapter{&sourcev1.GitRepositoryList{}},
}.run, }.run,
} }
@@ -45,3 +46,7 @@ func (obj gitRepositoryAdapter) isSuspended() bool {
func (obj gitRepositoryAdapter) setSuspended() { func (obj gitRepositoryAdapter) setSuspended() {
obj.GitRepository.Spec.Suspend = true obj.GitRepository.Spec.Suspend = true
} }
func (a gitRepositoryListAdapter) item(i int) suspendable {
return &gitRepositoryAdapter{&a.GitRepositoryList.Items[i]}
}

View File

@@ -31,6 +31,7 @@ var suspendSourceHelmCmd = &cobra.Command{
RunE: suspendCommand{ RunE: suspendCommand{
apiType: helmRepositoryType, apiType: helmRepositoryType,
object: helmRepositoryAdapter{&sourcev1.HelmRepository{}}, object: helmRepositoryAdapter{&sourcev1.HelmRepository{}},
list: helmRepositoryListAdapter{&sourcev1.HelmRepositoryList{}},
}.run, }.run,
} }
@@ -45,3 +46,7 @@ func (obj helmRepositoryAdapter) isSuspended() bool {
func (obj helmRepositoryAdapter) setSuspended() { func (obj helmRepositoryAdapter) setSuspended() {
obj.HelmRepository.Spec.Suspend = true obj.HelmRepository.Spec.Suspend = true
} }
func (a helmRepositoryListAdapter) item(i int) suspendable {
return &helmRepositoryAdapter{&a.HelmRepositoryList.Items[i]}
}

17
docs/README.md Normal file
View File

@@ -0,0 +1,17 @@
# Flux v2 Documentation
The documentation for `flux2` has moved to this repository: <https://github.com/fluxcd/website>.
[The Website's README](https://github.com/fluxcd/website/#readme) has information on how to
- modify and extend documentation
- run the site <https://fluxcd.io> locally
- publish changes
and where all the individual pieces of content come from.
It will be easier for us to maintain a coherent web presences (and merge all of Flux documentation) in one central repository. This was partly discussed in <https://github.com/fluxcd/flux2/discussions/367>.
## toolkit.fluxcd.io
For historical reasons we are keeping a `_redirects` file in this directory. It defines how redirects from the old site `toolkit.fluxcd.io` to our new website <https://fluxcd.io> work. Changes to this file need to be merged and a manual build triggered in the Netlify App.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 232 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 KiB

View File

@@ -1,22 +0,0 @@
<?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>

Before

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

18
docs/_redirects Normal file
View File

@@ -0,0 +1,18 @@
# individual rules
/core-concepts https://fluxcd.io/docs/concepts 301!
/contributing https://fluxcd.io/contributing 301!
/install.sh https://fluxcd.io/install.sh 301!
# refer to https://github.com/fluxcd/flux2/discussions/367
/dev-guides/* https://fluxcd.io/docs/gitops-toolkit/:splat 301!
# this is how things looked in the navbar anyway..?
/guides/faq-migration https://fluxcd.io/docs/migration/faq-migration 301!
/guides/flux-v1-automation-migration https://fluxcd.io/docs/migration/flux-v1-automation-migration 301!
/guides/flux-v1-migration https://fluxcd.io/docs/migration/flux-v1-migration 301!
/guides/helm-operator-migration https://fluxcd.io/docs/migration/helm-operator-migration 301!
# catch all
/* https://fluxcd.io/docs/:splat 301!

View File

@@ -1,122 +0,0 @@
@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;
}
.check-bullet {
color:#07bfa5;
background-color: white;
margin-left:-22px;
}
/* Progress bar styling */
.progress-label {
position: absolute;
text-align: center;
font-weight: 700;
width: 100%;
/* remove original styling for thin styling
margin: 0 ! important; */
margin-top: -0.4rem ! important;
line-height: 1.2rem;
white-space: nowrap;
overflow: hidden;
}
.progress-bar {
/*remove original styling for thin styling
height: 1.2rem; */
height: 0.4rem;
float: left;
background: repeating-linear-gradient(
45deg,
rgba(255, 255, 255, 0.2),
rgba(255, 255, 255, 0.2) 10px,
rgba(255, 255, 255, 0.3) 10px,
rgba(255, 255, 255, 0.3) 20px
) #2979ff;
border-radius: 2px;
}
.progress {
display: block;
width: 100%;
/* remove original styling for thin styling
margin: 0.5rem 0;
height: 1.2rem; */
margin-top: 0.9rem;
height: 0.4rem;
background-color: #eeeeee;
position: relative;
border-radius: 2px;
}
.progress-100plus .progress-bar {
background-color: #00c853;
}
.progress-80plus .progress-bar {
background-color: #64dd17;
}
.progress-60plus .progress-bar {
background-color: #fbc02d;
}
.progress-40plus .progress-bar {
background-color: #ff9100;
}
.progress-20plus .progress-bar {
background-color: #ff5252;
}
.progress-0plus .progress-bar {
background-color: #ff1744;
}
/* Custom admonitions */
/* See https://squidfunk.github.io/mkdocs-material/reference/admonitions */
:root {
--md-admonition-icon--heart: url('data:image/svg+xml;charset=utf-8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 20.408c-.492.308-.903.546-1.192.709-.153.086-.308.17-.463.252h-.002a.75.75 0 0 1-.686 0 16.709 16.709 0 0 1-.465-.252 31.147 31.147 0 0 1-4.803-3.34C3.8 15.572 1 12.331 1 8.513 1 5.052 3.829 2.5 6.736 2.5 9.03 2.5 10.881 3.726 12 5.605 13.12 3.726 14.97 2.5 17.264 2.5 20.17 2.5 23 5.052 23 8.514c0 3.818-2.801 7.06-5.389 9.262A31.146 31.146 0 0 1 14 20.408z"/></svg>')
}
.md-typeset .admonition.heart,
.md-typeset details.heart {
border-color: rgb(233, 30, 99);
}
.md-typeset .heart > .admonition-title,
.md-typeset .heart > summary {
background-color: rgba(233, 30, 99, 0.1);
}
.md-typeset .heart > .admonition-title::before,
.md-typeset .heart > summary::before {
background-color: rgb(233, 30, 99);
-webkit-mask-image: var(--md-admonition-icon--heart);
mask-image: var(--md-admonition-icon--heart);
}
.timetable-explicit-col-widths th:nth-child(1) { width: 4%; }
.timetable-explicit-col-widths th:nth-child(2) { width: 32%; }
.timetable-explicit-col-widths th:nth-child(3) { width: 32%; }
.timetable-explicit-col-widths th:nth-child(4) { width: 32%; }

View File

@@ -1,96 +0,0 @@
---
title: "flux command"
---
## flux
Command line utility for assembling Kubernetes CD pipelines
### Synopsis
Command line utility for assembling Kubernetes CD pipelines the GitOps way.
### Examples
```
# Check prerequisites
flux check --pre
# Install the latest version of Flux
flux install --version=master
# Create a source for a public Git repository
flux create source git webapp-latest \
--url=https://github.com/stefanprodan/podinfo \
--branch=master \
--interval=3m
# List GitRepository sources and their status
flux get sources git
# Trigger a GitRepository source reconciliation
flux reconcile source git flux-system
# Export GitRepository sources in YAML format
flux export source git --all > sources.yaml
# Create a Kustomization for deploying a series of microservices
flux create kustomization webapp-dev \
--source=webapp-latest \
--path="./deploy/webapp/" \
--prune=true \
--interval=5m \
--validation=client \
--health-check="Deployment/backend.webapp" \
--health-check="Deployment/frontend.webapp" \
--health-check-timeout=2m
# Trigger a git sync of the Kustomization's source and apply changes
flux reconcile kustomization webapp-dev --with-source
# Suspend a Kustomization reconciliation
flux suspend kustomization webapp-dev
# Export Kustomizations in YAML format
flux export kustomization --all > kustomizations.yaml
# Resume a Kustomization reconciliation
flux resume kustomization webapp-dev
# Delete a Kustomization
flux delete kustomization webapp-dev
# Delete a GitRepository source
flux delete source git webapp-latest
# Uninstall Flux and delete CRDs
flux uninstall
```
### Options
```
--context string kubernetes context to use
-h, --help help for flux
--kubeconfig string absolute path to the kubeconfig file
-n, --namespace string the namespace scope for this operation (default "flux-system")
--timeout duration timeout for this operation (default 5m0s)
--verbose print generated objects
```
### SEE ALSO
* [flux bootstrap](../flux_bootstrap/) - Bootstrap toolkit components
* [flux check](../flux_check/) - Check requirements and installation
* [flux completion](../flux_completion/) - Generates completion scripts for various shells
* [flux create](../flux_create/) - Create or update sources and resources
* [flux delete](../flux_delete/) - Delete sources and resources
* [flux export](../flux_export/) - Export resources in YAML format
* [flux get](../flux_get/) - Get the resources and their status
* [flux install](../flux_install/) - Install or upgrade Flux
* [flux logs](../flux_logs/) - Display formatted logs for Flux components
* [flux reconcile](../flux_reconcile/) - Reconcile sources and resources
* [flux resume](../flux_resume/) - Resume suspended resources
* [flux suspend](../flux_suspend/) - Suspend resources
* [flux uninstall](../flux_uninstall/) - Uninstall Flux and its custom resource definitions

View File

@@ -1,57 +0,0 @@
---
title: "flux bootstrap command"
---
## flux bootstrap
Bootstrap toolkit components
### Synopsis
The bootstrap sub-commands bootstrap the toolkit components on the targeted Git provider.
### Options
```
--author-email string author email for Git commits
--author-name string author name for Git commits (default "Flux")
--branch string Git branch (default "main")
--ca-file string path to TLS CA file used for validating self-signed certificates
--cluster-domain string internal cluster domain (default "cluster.local")
--commit-message-appendix string string to add to the commit messages, e.g. '[ci skip]'
--components strings list of components, accepts comma-separated values (default [source-controller,kustomize-controller,helm-controller,notification-controller])
--components-extra strings list of components in addition to those supplied or defaulted, accepts comma-separated values
-h, --help help for bootstrap
--image-pull-secret string Kubernetes secret name used for pulling the toolkit images from a private registry
--log-level logLevel log level, available options are: (debug, info, error) (default info)
--network-policy deny ingress access to the toolkit controllers from other namespaces using network policies (default true)
--private-key-file string path to a private key file used for authenticating to the Git SSH server
--recurse-submodules when enabled, configures the GitRepository source to initialize and include Git submodules in the artifact it produces
--registry string container registry where the toolkit images are published (default "ghcr.io/fluxcd")
--secret-name string name of the secret the sync credentials can be found in or stored to (default "flux-system")
--ssh-ecdsa-curve ecdsaCurve SSH ECDSA public key curve (p256, p384, p521) (default p384)
--ssh-hostname string SSH hostname, to be used when the SSH host differs from the HTTPS one
--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)
--token-auth when enabled, the personal access token will be used instead of SSH deploy key
--toleration-keys strings list of toleration keys used to schedule the components pods onto nodes with matching taints
-v, --version string toolkit version, when specified the manifests are downloaded from https://github.com/fluxcd/flux2/releases
--watch-all-namespaces watch for custom resources in all namespaces, if set to false it will only watch the namespace where the toolkit is installed (default true)
```
### Options inherited from parent commands
```
--context string kubernetes context to use
--kubeconfig string absolute path to the kubeconfig file
-n, --namespace string the namespace scope for this operation (default "flux-system")
--timeout duration timeout for this operation (default 5m0s)
--verbose print generated objects
```
### SEE ALSO
* [flux](../flux/) - Command line utility for assembling Kubernetes CD pipelines
* [flux bootstrap git](../flux_bootstrap_git/) - Bootstrap toolkit components in a Git repository
* [flux bootstrap github](../flux_bootstrap_github/) - Bootstrap toolkit components in a GitHub repository
* [flux bootstrap gitlab](../flux_bootstrap_gitlab/) - Bootstrap toolkit components in a GitLab repository

View File

@@ -1,80 +0,0 @@
---
title: "flux bootstrap git command"
---
## flux bootstrap git
Bootstrap toolkit components in a Git repository
### Synopsis
The bootstrap git command commits the toolkit components manifests to the
branch of a Git repository. It then configures the target cluster to synchronize with
the repository. If the toolkit components are present on the cluster, the bootstrap
command will perform an upgrade if needed.
```
flux bootstrap git [flags]
```
### Examples
```
# Run bootstrap for a Git repository and authenticate with your SSH agent
flux bootstrap git --url=ssh://git@example.com/repository.git
# Run bootstrap for a Git repository and authenticate using a password
flux bootstrap git --url=https://example.com/repository.git --password=<password>
# Run bootstrap for a Git repository with a passwordless private key
flux bootstrap git --url=ssh://git@example.com/repository.git --private-key-file=<path/to/private.key>
```
### Options
```
-h, --help help for git
--interval duration sync interval (default 1m0s)
-p, --password string basic authentication password
--path safeRelativePath path relative to the repository root, when specified the cluster sync will be scoped to this path
--url string Git repository URL
-u, --username string basic authentication username (default "git")
```
### Options inherited from parent commands
```
--author-email string author email for Git commits
--author-name string author name for Git commits (default "Flux")
--branch string Git branch (default "main")
--ca-file string path to TLS CA file used for validating self-signed certificates
--cluster-domain string internal cluster domain (default "cluster.local")
--commit-message-appendix string string to add to the commit messages, e.g. '[ci skip]'
--components strings list of components, accepts comma-separated values (default [source-controller,kustomize-controller,helm-controller,notification-controller])
--components-extra strings list of components in addition to those supplied or defaulted, accepts comma-separated values
--context string kubernetes context to use
--image-pull-secret string Kubernetes secret name used for pulling the toolkit images from a private registry
--kubeconfig string absolute path to the kubeconfig file
--log-level logLevel log level, available options are: (debug, info, error) (default info)
-n, --namespace string the namespace scope for this operation (default "flux-system")
--network-policy deny ingress access to the toolkit controllers from other namespaces using network policies (default true)
--private-key-file string path to a private key file used for authenticating to the Git SSH server
--recurse-submodules when enabled, configures the GitRepository source to initialize and include Git submodules in the artifact it produces
--registry string container registry where the toolkit images are published (default "ghcr.io/fluxcd")
--secret-name string name of the secret the sync credentials can be found in or stored to (default "flux-system")
--ssh-ecdsa-curve ecdsaCurve SSH ECDSA public key curve (p256, p384, p521) (default p384)
--ssh-hostname string SSH hostname, to be used when the SSH host differs from the HTTPS one
--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)
--timeout duration timeout for this operation (default 5m0s)
--token-auth when enabled, the personal access token will be used instead of SSH deploy key
--toleration-keys strings list of toleration keys used to schedule the components pods onto nodes with matching taints
--verbose print generated objects
-v, --version string toolkit version, when specified the manifests are downloaded from https://github.com/fluxcd/flux2/releases
--watch-all-namespaces watch for custom resources in all namespaces, if set to false it will only watch the namespace where the toolkit is installed (default true)
```
### SEE ALSO
* [flux bootstrap](../flux_bootstrap/) - Bootstrap toolkit components

View File

@@ -1,99 +0,0 @@
---
title: "flux bootstrap github command"
---
## flux bootstrap github
Bootstrap toolkit components in a GitHub repository
### Synopsis
The bootstrap github command creates the GitHub repository if it doesn't exists and
commits the toolkit components manifests to the main branch.
Then it configures the target cluster to synchronize with the repository.
If the toolkit components are present on the cluster,
the bootstrap command will perform an upgrade if needed.
```
flux bootstrap github [flags]
```
### Examples
```
# Create a GitHub personal access token and export it as an env var
export GITHUB_TOKEN=<my-token>
# Run bootstrap for a private repository owned by a GitHub organization
flux bootstrap github --owner=<organization> --repository=<repository name>
# Run bootstrap for a private repository and assign organization teams to it
flux bootstrap github --owner=<organization> --repository=<repository name> --team=<team1 slug> --team=<team2 slug>
# Run bootstrap for a repository path
flux bootstrap github --owner=<organization> --repository=<repository name> --path=dev-cluster
# Run bootstrap for a public repository on a personal account
flux bootstrap github --owner=<user> --repository=<repository name> --private=false --personal=true
# Run bootstrap for a private repository hosted on GitHub Enterprise using SSH auth
flux bootstrap github --owner=<organization> --repository=<repository name> --hostname=<domain> --ssh-hostname=<domain>
# Run bootstrap for a private repository hosted on GitHub Enterprise using HTTPS auth
flux bootstrap github --owner=<organization> --repository=<repository name> --hostname=<domain> --token-auth
# Run bootstrap for an existing repository with a branch named main
flux bootstrap github --owner=<organization> --repository=<repository name> --branch=main
```
### Options
```
-h, --help help for github
--hostname string GitHub hostname (default "github.com")
--interval duration sync interval (default 1m0s)
--owner string GitHub user or organization name
--path safeRelativePath path relative to the repository root, when specified the cluster sync will be scoped to this path
--personal if true, the owner is assumed to be a GitHub user; otherwise an org
--private if true, the repository is assumed to be private (default true)
--read-write-key if true, the deploy key is configured with read/write permissions
--repository string GitHub repository name
--team stringArray GitHub team to be given maintainer access
```
### Options inherited from parent commands
```
--author-email string author email for Git commits
--author-name string author name for Git commits (default "Flux")
--branch string Git branch (default "main")
--ca-file string path to TLS CA file used for validating self-signed certificates
--cluster-domain string internal cluster domain (default "cluster.local")
--commit-message-appendix string string to add to the commit messages, e.g. '[ci skip]'
--components strings list of components, accepts comma-separated values (default [source-controller,kustomize-controller,helm-controller,notification-controller])
--components-extra strings list of components in addition to those supplied or defaulted, accepts comma-separated values
--context string kubernetes context to use
--image-pull-secret string Kubernetes secret name used for pulling the toolkit images from a private registry
--kubeconfig string absolute path to the kubeconfig file
--log-level logLevel log level, available options are: (debug, info, error) (default info)
-n, --namespace string the namespace scope for this operation (default "flux-system")
--network-policy deny ingress access to the toolkit controllers from other namespaces using network policies (default true)
--private-key-file string path to a private key file used for authenticating to the Git SSH server
--recurse-submodules when enabled, configures the GitRepository source to initialize and include Git submodules in the artifact it produces
--registry string container registry where the toolkit images are published (default "ghcr.io/fluxcd")
--secret-name string name of the secret the sync credentials can be found in or stored to (default "flux-system")
--ssh-ecdsa-curve ecdsaCurve SSH ECDSA public key curve (p256, p384, p521) (default p384)
--ssh-hostname string SSH hostname, to be used when the SSH host differs from the HTTPS one
--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)
--timeout duration timeout for this operation (default 5m0s)
--token-auth when enabled, the personal access token will be used instead of SSH deploy key
--toleration-keys strings list of toleration keys used to schedule the components pods onto nodes with matching taints
--verbose print generated objects
-v, --version string toolkit version, when specified the manifests are downloaded from https://github.com/fluxcd/flux2/releases
--watch-all-namespaces watch for custom resources in all namespaces, if set to false it will only watch the namespace where the toolkit is installed (default true)
```
### SEE ALSO
* [flux bootstrap](../flux_bootstrap/) - Bootstrap toolkit components

View File

@@ -1,96 +0,0 @@
---
title: "flux bootstrap gitlab command"
---
## flux bootstrap gitlab
Bootstrap toolkit components in a GitLab repository
### Synopsis
The bootstrap gitlab command creates the GitLab repository if it doesn't exists and
commits the toolkit components manifests to the master branch.
Then it configures the target cluster to synchronize with the repository.
If the toolkit components are present on the cluster,
the bootstrap command will perform an upgrade if needed.
```
flux bootstrap gitlab [flags]
```
### Examples
```
# Create a GitLab API token and export it as an env var
export GITLAB_TOKEN=<my-token>
# Run bootstrap for a private repository using HTTPS token authentication
flux bootstrap gitlab --owner=<group> --repository=<repository name> --token-auth
# Run bootstrap for a private repository using SSH authentication
flux bootstrap gitlab --owner=<group> --repository=<repository name>
# Run bootstrap for a repository path
flux bootstrap gitlab --owner=<group> --repository=<repository name> --path=dev-cluster
# Run bootstrap for a public repository on a personal account
flux bootstrap gitlab --owner=<user> --repository=<repository name> --private=false --personal --token-auth
# Run bootstrap for a private repository hosted on a GitLab server
flux bootstrap gitlab --owner=<group> --repository=<repository name> --hostname=<domain> --token-auth
# Run bootstrap for a an existing repository with a branch named main
flux bootstrap gitlab --owner=<organization> --repository=<repository name> --branch=main --token-auth
```
### Options
```
-h, --help help for gitlab
--hostname string GitLab hostname (default "gitlab.com")
--interval duration sync interval (default 1m0s)
--owner string GitLab user or group name
--path safeRelativePath path relative to the repository root, when specified the cluster sync will be scoped to this path
--personal if true, the owner is assumed to be a GitLab user; otherwise a group
--private if true, the repository is assumed to be private (default true)
--read-write-key if true, the deploy key is configured with read/write permissions
--repository string GitLab repository name
--team stringArray GitLab teams to be given maintainer access
```
### Options inherited from parent commands
```
--author-email string author email for Git commits
--author-name string author name for Git commits (default "Flux")
--branch string Git branch (default "main")
--ca-file string path to TLS CA file used for validating self-signed certificates
--cluster-domain string internal cluster domain (default "cluster.local")
--commit-message-appendix string string to add to the commit messages, e.g. '[ci skip]'
--components strings list of components, accepts comma-separated values (default [source-controller,kustomize-controller,helm-controller,notification-controller])
--components-extra strings list of components in addition to those supplied or defaulted, accepts comma-separated values
--context string kubernetes context to use
--image-pull-secret string Kubernetes secret name used for pulling the toolkit images from a private registry
--kubeconfig string absolute path to the kubeconfig file
--log-level logLevel log level, available options are: (debug, info, error) (default info)
-n, --namespace string the namespace scope for this operation (default "flux-system")
--network-policy deny ingress access to the toolkit controllers from other namespaces using network policies (default true)
--private-key-file string path to a private key file used for authenticating to the Git SSH server
--recurse-submodules when enabled, configures the GitRepository source to initialize and include Git submodules in the artifact it produces
--registry string container registry where the toolkit images are published (default "ghcr.io/fluxcd")
--secret-name string name of the secret the sync credentials can be found in or stored to (default "flux-system")
--ssh-ecdsa-curve ecdsaCurve SSH ECDSA public key curve (p256, p384, p521) (default p384)
--ssh-hostname string SSH hostname, to be used when the SSH host differs from the HTTPS one
--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)
--timeout duration timeout for this operation (default 5m0s)
--token-auth when enabled, the personal access token will be used instead of SSH deploy key
--toleration-keys strings list of toleration keys used to schedule the components pods onto nodes with matching taints
--verbose print generated objects
-v, --version string toolkit version, when specified the manifests are downloaded from https://github.com/fluxcd/flux2/releases
--watch-all-namespaces watch for custom resources in all namespaces, if set to false it will only watch the namespace where the toolkit is installed (default true)
```
### SEE ALSO
* [flux bootstrap](../flux_bootstrap/) - Bootstrap toolkit components

View File

@@ -1,49 +0,0 @@
---
title: "flux check command"
---
## flux check
Check requirements and installation
### Synopsis
The check command will perform a series of checks to validate that
the local environment is configured correctly and if the installed components are healthy.
```
flux check [flags]
```
### Examples
```
# Run pre-installation checks
flux check --pre
# Run installation checks
flux check
```
### Options
```
--components strings list of components, accepts comma-separated values (default [source-controller,kustomize-controller,helm-controller,notification-controller])
--components-extra strings list of components in addition to those supplied or defaulted, accepts comma-separated values
-h, --help help for check
--pre only run pre-installation checks
```
### Options inherited from parent commands
```
--context string kubernetes context to use
--kubeconfig string absolute path to the kubeconfig file
-n, --namespace string the namespace scope for this operation (default "flux-system")
--timeout duration timeout for this operation (default 5m0s)
--verbose print generated objects
```
### SEE ALSO
* [flux](../flux/) - Command line utility for assembling Kubernetes CD pipelines

View File

@@ -1,35 +0,0 @@
---
title: "flux completion command"
---
## flux completion
Generates completion scripts for various shells
### Synopsis
The completion sub-command generates completion scripts for various shells
### Options
```
-h, --help help for completion
```
### Options inherited from parent commands
```
--context string kubernetes context to use
--kubeconfig string absolute path to the kubeconfig file
-n, --namespace string the namespace scope for this operation (default "flux-system")
--timeout duration timeout for this operation (default 5m0s)
--verbose print generated objects
```
### SEE ALSO
* [flux](../flux/) - Command line utility for assembling Kubernetes CD pipelines
* [flux completion bash](../flux_completion_bash/) - Generates bash completion scripts
* [flux completion fish](../flux_completion_fish/) - Generates fish completion scripts
* [flux completion powershell](../flux_completion_powershell/) - Generates powershell completion scripts
* [flux completion zsh](../flux_completion_zsh/) - Generates zsh completion scripts

View File

@@ -1,44 +0,0 @@
---
title: "flux completion bash command"
---
## flux completion bash
Generates bash completion scripts
```
flux completion bash [flags]
```
### Examples
```
To load completion run
. <(flux completion bash)
To configure your bash shell to load completions for each session add to your bashrc
# ~/.bashrc or ~/.profile
command -v flux >/dev/null && . <(flux completion bash)
```
### Options
```
-h, --help help for bash
```
### Options inherited from parent commands
```
--context string kubernetes context to use
--kubeconfig string absolute path to the kubeconfig file
-n, --namespace string the namespace scope for this operation (default "flux-system")
--timeout duration timeout for this operation (default 5m0s)
--verbose print generated objects
```
### SEE ALSO
* [flux completion](../flux_completion/) - Generates completion scripts for various shells

View File

@@ -1,41 +0,0 @@
---
title: "flux completion fish command"
---
## flux completion fish
Generates fish completion scripts
```
flux completion fish [flags]
```
### Examples
```
To configure your fish shell to load completions for each session write this script to your completions dir:
flux completion fish > ~/.config/fish/completions/flux.fish
See http://fishshell.com/docs/current/index.html#completion-own for more details
```
### Options
```
-h, --help help for fish
```
### Options inherited from parent commands
```
--context string kubernetes context to use
--kubeconfig string absolute path to the kubeconfig file
-n, --namespace string the namespace scope for this operation (default "flux-system")
--timeout duration timeout for this operation (default 5m0s)
--verbose print generated objects
```
### SEE ALSO
* [flux completion](../flux_completion/) - Generates completion scripts for various shells

View File

@@ -1,51 +0,0 @@
---
title: "flux completion powershell command"
---
## flux completion powershell
Generates powershell completion scripts
```
flux completion powershell [flags]
```
### Examples
```
To load completion run
. <(flux completion powershell)
To configure your powershell shell to load completions for each session add to your powershell profile
Windows:
cd "$env:USERPROFILE\Documents\WindowsPowerShell\Modules"
flux completion >> flux-completion.ps1
Linux:
cd "${XDG_CONFIG_HOME:-"$HOME/.config/"}/powershell/modules"
flux completion >> flux-completions.ps1
```
### Options
```
-h, --help help for powershell
```
### Options inherited from parent commands
```
--context string kubernetes context to use
--kubeconfig string absolute path to the kubeconfig file
-n, --namespace string the namespace scope for this operation (default "flux-system")
--timeout duration timeout for this operation (default 5m0s)
--verbose print generated objects
```
### SEE ALSO
* [flux completion](../flux_completion/) - Generates completion scripts for various shells

View File

@@ -1,52 +0,0 @@
---
title: "flux completion zsh command"
---
## flux completion zsh
Generates zsh completion scripts
```
flux completion zsh [flags]
```
### Examples
```
To load completion run
. <(flux completion zsh) && compdef _flux flux
To configure your zsh shell to load completions for each session add to your zshrc
# ~/.zshrc or ~/.profile
command -v flux >/dev/null && . <(flux completion zsh) && compdef _flux flux
or write a cached file in one of the completion directories in your ${fpath}:
echo "${fpath// /\n}" | grep -i completion
flux completion zsh > _flux
mv _flux ~/.oh-my-zsh/completions # oh-my-zsh
mv _flux ~/.zprezto/modules/completion/external/src/ # zprezto
```
### Options
```
-h, --help help for zsh
```
### Options inherited from parent commands
```
--context string kubernetes context to use
--kubeconfig string absolute path to the kubeconfig file
-n, --namespace string the namespace scope for this operation (default "flux-system")
--timeout duration timeout for this operation (default 5m0s)
--verbose print generated objects
```
### SEE ALSO
* [flux completion](../flux_completion/) - Generates completion scripts for various shells

View File

@@ -1,43 +0,0 @@
---
title: "flux create command"
---
## flux create
Create or update sources and resources
### Synopsis
The create sub-commands generate sources and resources.
### Options
```
--export export in YAML format to stdout
-h, --help help for create
--interval duration source sync interval (default 1m0s)
--label strings set labels on the resource (can specify multiple labels with commas: label1=value1,label2=value2)
```
### Options inherited from parent commands
```
--context string kubernetes context to use
--kubeconfig string absolute path to the kubeconfig file
-n, --namespace string the namespace scope for this operation (default "flux-system")
--timeout duration timeout for this operation (default 5m0s)
--verbose print generated objects
```
### SEE ALSO
* [flux](../flux/) - Command line utility for assembling Kubernetes CD pipelines
* [flux create alert](../flux_create_alert/) - Create or update a Alert resource
* [flux create alert-provider](../flux_create_alert-provider/) - Create or update a Provider resource
* [flux create helmrelease](../flux_create_helmrelease/) - Create or update a HelmRelease resource
* [flux create image](../flux_create_image/) - Create or update resources dealing with image automation
* [flux create kustomization](../flux_create_kustomization/) - Create or update a Kustomization resource
* [flux create receiver](../flux_create_receiver/) - Create or update a Receiver resource
* [flux create secret](../flux_create_secret/) - Create or update Kubernetes secrets
* [flux create source](../flux_create_source/) - Create or update sources
* [flux create tenant](../flux_create_tenant/) - Create or update a tenant

View File

@@ -1,60 +0,0 @@
---
title: "flux create alert-provider command"
---
## flux create alert-provider
Create or update a Provider resource
### Synopsis
The create alert-provider command generates a Provider resource.
```
flux create alert-provider [name] [flags]
```
### Examples
```
# Create a Provider for a Slack channel
flux create alert-provider slack \
--type slack \
--channel general \
--address https://hooks.slack.com/services/YOUR/SLACK/WEBHOOK \
--secret-ref webhook-url
# Create a Provider for a Github repository
flux create alert-provider github-podinfo \
--type github \
--address https://github.com/stefanprodan/podinfo \
--secret-ref github-token
```
### Options
```
--address string path to either the git repository, chat provider or webhook
--channel string channel to send messages to in the case of a chat provider
-h, --help help for alert-provider
--secret-ref string name of secret containing authentication token
--type string type of provider
--username string bot username used by the provider
```
### Options inherited from parent commands
```
--context string kubernetes context to use
--export export in YAML format to stdout
--interval duration source sync interval (default 1m0s)
--kubeconfig string absolute path to the kubeconfig file
--label strings set labels on the resource (can specify multiple labels with commas: label1=value1,label2=value2)
-n, --namespace string the namespace scope for this operation (default "flux-system")
--timeout duration timeout for this operation (default 5m0s)
--verbose print generated objects
```
### SEE ALSO
* [flux create](../flux_create/) - Create or update sources and resources

View File

@@ -1,52 +0,0 @@
---
title: "flux create alert command"
---
## flux create alert
Create or update a Alert resource
### Synopsis
The create alert command generates a Alert resource.
```
flux create alert [name] [flags]
```
### Examples
```
# Create an Alert for kustomization events
flux create alert \
--event-severity info \
--event-source Kustomization/flux-system \
--provider-ref slack \
flux-system
```
### Options
```
--event-severity string severity of events to send alerts for
--event-source stringArray sources that should generate alerts (<kind>/<name>)
-h, --help help for alert
--provider-ref string reference to provider
```
### Options inherited from parent commands
```
--context string kubernetes context to use
--export export in YAML format to stdout
--interval duration source sync interval (default 1m0s)
--kubeconfig string absolute path to the kubeconfig file
--label strings set labels on the resource (can specify multiple labels with commas: label1=value1,label2=value2)
-n, --namespace string the namespace scope for this operation (default "flux-system")
--timeout duration timeout for this operation (default 5m0s)
--verbose print generated objects
```
### SEE ALSO
* [flux create](../flux_create/) - Create or update sources and resources

View File

@@ -1,110 +0,0 @@
---
title: "flux create helmrelease command"
---
## flux create helmrelease
Create or update a HelmRelease resource
### Synopsis
The helmrelease create command generates a HelmRelease resource for a given HelmRepository source.
```
flux create helmrelease [name] [flags]
```
### Examples
```
# Create a HelmRelease with a chart from a HelmRepository source
flux create hr podinfo \
--interval=10m \
--source=HelmRepository/podinfo \
--chart=podinfo \
--chart-version=">4.0.0"
# Create a HelmRelease with a chart from a GitRepository source
flux create hr podinfo \
--interval=10m \
--source=GitRepository/podinfo \
--chart=./charts/podinfo
# Create a HelmRelease with a chart from a Bucket source
flux create hr podinfo \
--interval=10m \
--source=Bucket/podinfo \
--chart=./charts/podinfo
# Create a HelmRelease with values from local YAML files
flux create hr podinfo \
--source=HelmRepository/podinfo \
--chart=podinfo \
--values=./my-values1.yaml \
--values=./my-values2.yaml
# Create a HelmRelease with values from a Kubernetes secret
kubectl -n app create secret generic my-secret-values \
--from-file=values.yaml=/path/to/my-secret-values.yaml
flux -n app create hr podinfo \
--source=HelmRepository/podinfo \
--chart=podinfo \
--values-from=Secret/my-secret-values
# Create a HelmRelease with a custom release name
flux create hr podinfo \
--release-name=podinfo-dev
--source=HelmRepository/podinfo \
--chart=podinfo \
# Create a HelmRelease targeting another namespace than the resource
flux create hr podinfo \
--target-namespace=default \
--source=HelmRepository/podinfo \
--chart=podinfo
# Create a HelmRelease using a source from a different namespace
flux create hr podinfo \
--namespace=default \
--source=HelmRepository/podinfo.flux-system \
--chart=podinfo
# Create a HelmRelease definition on disk without applying it on the cluster
flux create hr podinfo \
--source=HelmRepository/podinfo \
--chart=podinfo \
--values=./values.yaml \
--export > podinfo-release.yaml
```
### Options
```
--chart string Helm chart name or path
--chart-version string Helm chart version, accepts a semver range (ignored for charts from GitRepository sources)
--depends-on stringArray HelmReleases that must be ready before this release can be installed, supported formats '<name>' and '<namespace>/<name>'
-h, --help help for helmrelease
--release-name string name used for the Helm release, defaults to a composition of '[<target-namespace>-]<HelmRelease-name>'
--service-account string the name of the service account to impersonate when reconciling this HelmRelease
--source helmChartSource source that contains the chart in the format '<kind>/<name>.<namespace>', where kind must be one of: (HelmRepository, GitRepository, Bucket)
--target-namespace string namespace to install this release, defaults to the HelmRelease namespace
--values stringArray local path to values.yaml files
--values-from helmReleaseValuesFrom Kubernetes object reference that contains the values.yaml data key in the format '<kind>/<name>', where kind must be one of: (Secret, ConfigMap)
```
### Options inherited from parent commands
```
--context string kubernetes context to use
--export export in YAML format to stdout
--interval duration source sync interval (default 1m0s)
--kubeconfig string absolute path to the kubeconfig file
--label strings set labels on the resource (can specify multiple labels with commas: label1=value1,label2=value2)
-n, --namespace string the namespace scope for this operation (default "flux-system")
--timeout duration timeout for this operation (default 5m0s)
--verbose print generated objects
```
### SEE ALSO
* [flux create](../flux_create/) - Create or update sources and resources

View File

@@ -1,39 +0,0 @@
---
title: "flux create image command"
---
## flux create image
Create or update resources dealing with image automation
### Synopsis
The create image sub-commands work with image automation objects; that is,
object controlling updates to git based on e.g., new container images
being available.
### Options
```
-h, --help help for image
```
### Options inherited from parent commands
```
--context string kubernetes context to use
--export export in YAML format to stdout
--interval duration source sync interval (default 1m0s)
--kubeconfig string absolute path to the kubeconfig file
--label strings set labels on the resource (can specify multiple labels with commas: label1=value1,label2=value2)
-n, --namespace string the namespace scope for this operation (default "flux-system")
--timeout duration timeout for this operation (default 5m0s)
--verbose print generated objects
```
### SEE ALSO
* [flux create](../flux_create/) - Create or update sources and resources
* [flux create image policy](../flux_create_image_policy/) - Create or update an ImagePolicy object
* [flux create image repository](../flux_create_image_repository/) - Create or update an ImageRepository object
* [flux create image update](../flux_create_image_update/) - Create or update an ImageUpdateAutomation object

Some files were not shown because too many files have changed in this diff Show More