Skip to content

Commit

Permalink
Add guide for reconciling 3rd-party Git sources
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Prodan <[email protected]>
  • Loading branch information
stefanprodan authored and darkowlzz committed May 29, 2023
1 parent b17d105 commit 3b6a69e
Show file tree
Hide file tree
Showing 2 changed files with 108 additions and 0 deletions.
54 changes: 54 additions & 0 deletions docs/guides/extra-syncs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
subcategory: ""
page_title: "Reconcile 3rd-party Git sources"
description: |-
A guide for setting up reconciliation of 3rd-party Git sources after Flux bootstrap.
---

# Reconcile 3rd-party Git sources

To generate `GitRepository` and `Kustomization` objects for reconciling
other repositories besides the bootstrap one,
you can use the [flux2-sync Helm chart](https://artifacthub.io/packages/helm/fluxcd-community/flux2-sync)
and the Helm Terraform Provider.

Example:

```terraform
terraform {
required_providers {
helm = {
source = "hashicorp/helm"
}
kind = {
source = "tehcyx/kind"
}
}
}
provider "kind" {}
resource "kind_cluster" "this" {
name = "flux-e2e"
}
provider "helm" {
kubernetes {
host = kind_cluster.this.endpoint
client_certificate = kind_cluster.this.client_certificate
client_key = kind_cluster.this.client_key
cluster_ca_certificate = kind_cluster.this.cluster_ca_certificate
}
}
resource "helm_release" "my-app-sync" {
repository = "https://fluxcd-community.github.io/helm-charts"
chart = "flux2-sync"
name = "my-app-sync"
namespace = "flux-system"
values = [
file("${path.module}/my-app-sync-values.yaml")
]
}
```

54 changes: 54 additions & 0 deletions templates/guides/extra-syncs.md.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
subcategory: ""
page_title: "Reconcile 3rd-party Git sources"
description: |-
A guide for setting up reconciliation of 3rd-party Git sources after Flux bootstrap.
---

# Reconcile 3rd-party Git sources

To generate `GitRepository` and `Kustomization` objects for reconciling
other repositories besides the bootstrap one,
you can use the [flux2-sync Helm chart](https://artifacthub.io/packages/helm/fluxcd-community/flux2-sync)
and the Helm Terraform Provider.

Example:

```terraform
terraform {
required_providers {
helm = {
source = "hashicorp/helm"
}
kind = {
source = "tehcyx/kind"
}
}
}

provider "kind" {}

resource "kind_cluster" "this" {
name = "flux-e2e"
}

provider "helm" {
kubernetes {
host = kind_cluster.this.endpoint
client_certificate = kind_cluster.this.client_certificate
client_key = kind_cluster.this.client_key
cluster_ca_certificate = kind_cluster.this.cluster_ca_certificate
}
}

resource "helm_release" "my-app-sync" {
repository = "https://fluxcd-community.github.io/helm-charts"
chart = "flux2-sync"
name = "my-app-sync"
namespace = "flux-system"
values = [
file("${path.module}/my-app-sync-values.yaml")
]
}
```

0 comments on commit 3b6a69e

Please sign in to comment.