Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add new example for bootstrapping cluster using Forgejo repository #744

Merged
merged 1 commit into from
Feb 23, 2025

Conversation

acch
Copy link
Contributor

@acch acch commented Feb 22, 2025

Description

This commit adds sample code and documentation for bootstrapping KinD cluster with Flux using Git repository hosted in Forgejo.

Motivation and Context

Thanks to the awsome work of @zeidlos, it's now possible to configure Forgejo repository, Forgejo deploy key, and Flux all from Terraform / OpenTofu. Hence, we thought that it would be worth adding this example to the docs of the Flux provider, to let others take advantage...

See this issue for the details.

How has this been tested?

This is purely a documentation update. No Go (acc-)testing done...

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Documentation

  • I have updated the documentation (if required) with make docs

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have signed-off my commits with git commit -s

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritise this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

@acch acch force-pushed the main branch 2 times, most recently from ca1262f to 6b28584 Compare February 22, 2025 19:23
@acch acch changed the title add new example for bootstrapping cluster using Forgejo repository Add new example for bootstrapping cluster using Forgejo repository Feb 22, 2025
@stefanprodan stefanprodan added the area/docs Documentation related issues and pull requests label Feb 23, 2025
@stefanprodan
Copy link
Member

This doesn't seem to work:

│ Error: Failed to query available provider packages
│ 
│ Could not retrieve the list of available versions for provider
│ hashicorp/forgejo: provider registry registry.terraform.io does not have a
│ provider named registry.terraform.io/hashicorp/forgejo
│ 
│ Did you intend to use svalabs/forgejo? If so, you must specify that source
│ address in each module which requires that provider. To see which modules
│ are currently depending on hashicorp/forgejo, run the following command:
│     terraform providers

…epository.

Signed-off-by: Achim Christ <acch@users.noreply.github.com>
@acch
Copy link
Contributor Author

acch commented Feb 23, 2025

Aah dang, a typo (copy & paste)! 🤦‍♂️ My apologies, don't know how I could have missed that...

Configuration now validates successfully:

➜ terraform init
Initializing the backend...
Initializing provider plugins...
- Finding svalabs/forgejo versions matching ">= 0.2.0"...
- Finding tehcyx/kind versions matching ">= 0.8.0"...
- Finding hashicorp/tls versions matching ">= 4.0.0"...
- Finding fluxcd/flux versions matching ">= 1.5.0"...
- Installing tehcyx/kind v0.8.0...
- Installed tehcyx/kind v0.8.0 (self-signed, key ID F471C773A530ED1B)
- Installing hashicorp/tls v4.0.6...
- Installed hashicorp/tls v4.0.6 (signed by HashiCorp)
- Installing fluxcd/flux v1.5.0...
- Installed fluxcd/flux v1.5.0 (self-signed, key ID D5D3316A880BB5B9)
- Installing svalabs/forgejo v0.2.0...
- Installed svalabs/forgejo v0.2.0 (self-signed, key ID B50B0D17F7964C79)
Partner and community providers are signed by their developers.
If you'd like to know more about provider signing, you can read about it here:
https://www.terraform.io/docs/cli/plugins/signing.html
Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.

➜ terraform validate
Success! The configuration is valid.

➜ tflint --recursive && echo $?
0

Sorry for having wasted your time. Please let me know if there's anything else I can do to help!

Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks @acch 🏅

@stefanprodan stefanprodan merged commit 0b6dd31 into fluxcd:main Feb 23, 2025
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docs Documentation related issues and pull requests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants