Skip to content

Commit

Permalink
feat(terraform): Use OCI repo
Browse files Browse the repository at this point in the history
  • Loading branch information
bjw-s committed Nov 8, 2022
1 parent 20ef352 commit c61fb43
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 33 deletions.
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
---
apiVersion: source.toolkit.fluxcd.io/v1beta1
kind: GitRepository
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: OCIRepository
metadata:
name: home-ops-tf-cloudflare
name: oci-terraform-cloudflare
namespace: infrastructure
spec:
interval: 30m
interval: 1m
url: oci://ghcr.io/bjw-s/terraform-cloudflare
ref:
branch: main
url: https://github.com/bjw-s/home-ops.git
ignore: |
/*
!/infrastructure/terraform/cloudflare
tag: main
---
apiVersion: infra.contrib.fluxcd.io/v1alpha1
kind: Terraform
Expand All @@ -27,8 +24,8 @@ spec:
name: tfe-cli-config
path: "./infrastructure/terraform/cloudflare"
sourceRef:
kind: GitRepository
name: home-ops-tf-cloudflare
kind: OCIRepository
name: oci-terraform-cloudflare
namespace: infrastructure
runnerPodTemplate:
spec:
Expand Down
19 changes: 8 additions & 11 deletions kubernetes/clusters/cluster-0/infrastructure/terraform/github.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
---
apiVersion: source.toolkit.fluxcd.io/v1beta1
kind: GitRepository
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: OCIRepository
metadata:
name: home-ops-tf-github
name: oci-terraform-github
namespace: infrastructure
spec:
interval: 30m
interval: 1m
url: oci://ghcr.io/bjw-s/terraform-github
ref:
branch: main
url: https://github.com/bjw-s/home-ops.git
ignore: |
/*
!/infrastructure/terraform/github
tag: main
---
apiVersion: infra.contrib.fluxcd.io/v1alpha1
kind: Terraform
Expand All @@ -27,8 +24,8 @@ spec:
name: tfe-cli-config
path: "./infrastructure/terraform/github"
sourceRef:
kind: GitRepository
name: home-ops-tf-github
kind: OCIRepository
name: oci-terraform-github
namespace: infrastructure
runnerPodTemplate:
spec:
Expand Down
39 changes: 39 additions & 0 deletions kubernetes/clusters/cluster-0/infrastructure/terraform/s3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: OCIRepository
metadata:
name: oci-terraform-s3
namespace: infrastructure
spec:
interval: 1m
url: oci://ghcr.io/bjw-s/terraform-s3
ref:
tag: main
---
apiVersion: infra.contrib.fluxcd.io/v1alpha1
kind: Terraform
metadata:
name: s3
namespace: infrastructure
spec:
interval: 30m
approvePlan: "auto"
backendConfig:
disable: true
cliConfigSecretRef:
name: tfe-cli-config
path: "./infrastructure/terraform/s3"
sourceRef:
kind: OCIRepository
name: oci-terraform-s3
namespace: infrastructure
runnerPodTemplate:
spec:
volumeMounts:
- name: tf-controller-sops-key
mountPath: /home/runner/.config/sops/age/keys.txt
subPath: keys.txt
volumes:
- name: tf-controller-sops-key
secret:
secretName: tf-controller-sops-key
19 changes: 8 additions & 11 deletions kubernetes/clusters/cluster-0/infrastructure/terraform/unifi.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
---
apiVersion: source.toolkit.fluxcd.io/v1beta1
kind: GitRepository
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: OCIRepository
metadata:
name: home-ops-tf-unifi
name: oci-terraform-unifi
namespace: infrastructure
spec:
interval: 30m
interval: 1m
url: oci://ghcr.io/bjw-s/terraform-unifi
ref:
branch: main
url: https://github.com/bjw-s/home-ops.git
ignore: |
/*
!/infrastructure/terraform/unifi
tag: main
---
apiVersion: infra.contrib.fluxcd.io/v1alpha1
kind: Terraform
Expand All @@ -27,8 +24,8 @@ spec:
name: tfe-cli-config
path: "./infrastructure/terraform/unifi"
sourceRef:
kind: GitRepository
name: home-ops-tf-unifi
kind: OCIRepository
name: oci-terraform-unifi
namespace: infrastructure
runnerPodTemplate:
spec:
Expand Down

0 comments on commit c61fb43

Please sign in to comment.