Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c42826c6de | |||
| 38ab457ac1 | |||
| 9351ea30a9 | |||
| 292392a024 | |||
| 9058eb3f59 |
@@ -1,3 +1,11 @@
|
|||||||
# terraform-artifactapi
|
# terraform-artifactapi
|
||||||
|
|
||||||
Terraform configuration for managing ArtifactAPI remote and virtual repositories
|
Terraform configuration for managing ArtifactAPI remote, local, and virtual repositories.
|
||||||
|
|
||||||
|
Repositories are declared as YAML files under `config/<kind>/<name>.yaml`, where the
|
||||||
|
filename is the repository name. `make plan` / `make apply` (via Terragrunt) reconcile
|
||||||
|
them against the ArtifactAPI instance.
|
||||||
|
|
||||||
|
Kinds: `remote_*` (caching proxies of an upstream), `local_*` (real registries hosted
|
||||||
|
directly — `local_docker`, `local_pypi`, `local_rpm`, `local_terraform`), and `virtual`
|
||||||
|
(merged views over members of one package type).
|
||||||
|
|||||||
@@ -57,6 +57,11 @@ locals {
|
|||||||
trimsuffix(basename(file_path), ".yaml") => content
|
trimsuffix(basename(file_path), ".yaml") => content
|
||||||
if startswith(file_path, "local_rpm/")
|
if startswith(file_path, "local_rpm/")
|
||||||
}
|
}
|
||||||
|
local_docker = {
|
||||||
|
for file_path, content in local.all_configs :
|
||||||
|
trimsuffix(basename(file_path), ".yaml") => content
|
||||||
|
if startswith(file_path, "local_docker/")
|
||||||
|
}
|
||||||
virtual = {
|
virtual = {
|
||||||
for file_path, content in local.all_configs :
|
for file_path, content in local.all_configs :
|
||||||
trimsuffix(basename(file_path), ".yaml") => content
|
trimsuffix(basename(file_path), ".yaml") => content
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
description: "Internal container image registry"
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
description: "Internal RPM packages for Enterprise Linux 10 (RHEL/AlmaLinux/Rocky 10)"
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
description: "Internal RPM packages for Enterprise Linux 8 (RHEL/AlmaLinux/Rocky 8)"
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
description: "Internal RPM packages for Enterprise Linux 9 (RHEL/AlmaLinux/Rocky 9)"
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
description: "Internal RPM packages for Fedora 42"
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
description: "Internal RPM packages for Fedora 43"
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
description: "Internal RPM packages for Fedora 44"
|
||||||
@@ -1 +1 @@
|
|||||||
description: "Internal RPM packages"
|
description: "Internal RPM packages (distribution-agnostic)"
|
||||||
|
|||||||
@@ -3,7 +3,9 @@ description: Docker Hub registry
|
|||||||
immutable_ttl: 0
|
immutable_ttl: 0
|
||||||
mutable_ttl: 300
|
mutable_ttl: 300
|
||||||
patterns:
|
patterns:
|
||||||
|
- "^alpine/"
|
||||||
- "^library/almalinux"
|
- "^library/almalinux"
|
||||||
|
- "^library/alpine"
|
||||||
- "^library/busybox"
|
- "^library/busybox"
|
||||||
- "^library/debian"
|
- "^library/debian"
|
||||||
- "^library/fedora"
|
- "^library/fedora"
|
||||||
@@ -16,10 +18,15 @@ patterns:
|
|||||||
- "^emberstack/kubernetes-reflector"
|
- "^emberstack/kubernetes-reflector"
|
||||||
- "^hashicorp/consul"
|
- "^hashicorp/consul"
|
||||||
- "^hashicorp/vault"
|
- "^hashicorp/vault"
|
||||||
|
- "^intel/"
|
||||||
|
- "^internetsystemsconsortium/bind9"
|
||||||
- "^jfrog/"
|
- "^jfrog/"
|
||||||
|
- "^jpgouin/"
|
||||||
- "^kanidm/"
|
- "^kanidm/"
|
||||||
|
- "^osixia/"
|
||||||
- "^rancher/"
|
- "^rancher/"
|
||||||
- "^rspamd/rspamd"
|
- "^rspamd/rspamd"
|
||||||
|
- "^tiredofit/"
|
||||||
- "^tozd/postfix"
|
- "^tozd/postfix"
|
||||||
- "^traefik/"
|
- "^traefik/"
|
||||||
- "^valkey/valkey"
|
- "^valkey/valkey"
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
base_url: https://public.ecr.aws
|
||||||
|
description: Amazon ECR Public registry
|
||||||
|
immutable_ttl: 0
|
||||||
|
mutable_ttl: 300
|
||||||
|
patterns:
|
||||||
|
- "^docker/library/"
|
||||||
@@ -3,10 +3,18 @@ description: GitHub Container Registry
|
|||||||
immutable_ttl: 0
|
immutable_ttl: 0
|
||||||
mutable_ttl: 300
|
mutable_ttl: 300
|
||||||
patterns:
|
patterns:
|
||||||
- "^cloudnative-pg/cloudnative-pg"
|
- "^cloudnative-pg/"
|
||||||
|
- "^dexidp/"
|
||||||
- "^emberstack/helm-charts"
|
- "^emberstack/helm-charts"
|
||||||
|
- "^fallenbagel/"
|
||||||
|
- "^goauthentik/"
|
||||||
|
- "^home-operations/"
|
||||||
|
- "^jellyfin/"
|
||||||
|
- "^onedr0p/"
|
||||||
- "^open-webui/open-webui"
|
- "^open-webui/open-webui"
|
||||||
- "^openvoxproject/"
|
- "^openvoxproject/"
|
||||||
|
- "^paperclipai/"
|
||||||
|
- "^plexguide/"
|
||||||
- "^stakater/reloader"
|
- "^stakater/reloader"
|
||||||
- "^stalwartlabs/stalwart"
|
- "^stalwartlabs/stalwart"
|
||||||
- "^voxpupuli/puppetboard"
|
- "^voxpupuli/puppetboard"
|
||||||
|
|||||||
@@ -0,0 +1,6 @@
|
|||||||
|
base_url: https://docker.litellm.ai
|
||||||
|
description: LiteLLM container registry
|
||||||
|
immutable_ttl: 0
|
||||||
|
mutable_ttl: 300
|
||||||
|
patterns:
|
||||||
|
- "^berriai/"
|
||||||
@@ -3,6 +3,7 @@ description: Quay.io container registry
|
|||||||
immutable_ttl: 0
|
immutable_ttl: 0
|
||||||
mutable_ttl: 300
|
mutable_ttl: 300
|
||||||
patterns:
|
patterns:
|
||||||
|
- "^argoproj/"
|
||||||
- "^brancz/kube-rbac-proxy"
|
- "^brancz/kube-rbac-proxy"
|
||||||
- "^cephcsi/cephcsi"
|
- "^cephcsi/cephcsi"
|
||||||
- "^jetstack/cert-manager-"
|
- "^jetstack/cert-manager-"
|
||||||
|
|||||||
@@ -4,5 +4,6 @@ immutable_ttl: 0
|
|||||||
mutable_ttl: 7200
|
mutable_ttl: 7200
|
||||||
patterns:
|
patterns:
|
||||||
- "argoproj/argo-cd/.*.yaml$"
|
- "argoproj/argo-cd/.*.yaml$"
|
||||||
- "yannh/kubernetes-json-schema/master/.*.json$"
|
|
||||||
- "datreeio/CRDs-catalog/main/.*.json$"
|
- "datreeio/CRDs-catalog/main/.*.json$"
|
||||||
|
- "kubernetes/kubernetes/.*.json$"
|
||||||
|
- "yannh/kubernetes-json-schema/master/.*.json$"
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
base_url: https://charts.goauthentik.io
|
||||||
|
description: Authentik Charts
|
||||||
|
immutable_ttl: 0
|
||||||
|
mutable_ttl: 3600
|
||||||
|
check_mutable: true
|
||||||
|
immutable_patterns:
|
||||||
|
- "\\.tgz$"
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
base_url: https://grafana.github.io/helm-charts
|
||||||
|
description: Grafana Helm charts
|
||||||
|
immutable_ttl: 0
|
||||||
|
mutable_ttl: 3600
|
||||||
|
check_mutable: true
|
||||||
|
immutable_patterns:
|
||||||
|
- "\\.tgz$"
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
base_url: "https://downloads.claude.ai/claude-code/rpm/stable"
|
||||||
|
description: "Claude Code RPM repository"
|
||||||
|
immutable_patterns:
|
||||||
|
- ".*/x86_64/.*\\.rpm$"
|
||||||
|
- ".*/noarch/.*\\.rpm$"
|
||||||
|
- ".*/repodata/.*\\.xml.*$"
|
||||||
@@ -1,10 +1,12 @@
|
|||||||
package_type: helm
|
package_type: helm
|
||||||
description: "Virtual repository merging all helm remotes — member order is priority order for duplicate chart+version"
|
description: "Virtual repository merging all helm remotes — member order is priority order for duplicate chart+version"
|
||||||
members:
|
members:
|
||||||
|
- authentik
|
||||||
- ceph-csi
|
- ceph-csi
|
||||||
- cnpg
|
- cnpg
|
||||||
- elastic-helm
|
- elastic-helm
|
||||||
- external-dns
|
- external-dns
|
||||||
|
- grafana
|
||||||
- hashicorp-helm
|
- hashicorp-helm
|
||||||
- intel-helm
|
- intel-helm
|
||||||
- jetstack
|
- jetstack
|
||||||
|
|||||||
+2
-1
@@ -13,7 +13,7 @@ locals {
|
|||||||
}
|
}
|
||||||
|
|
||||||
terraform {
|
terraform {
|
||||||
source = "../../../modules/artifactapi"
|
source = "../../modules/artifactapi"
|
||||||
}
|
}
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
@@ -27,5 +27,6 @@ inputs = {
|
|||||||
local_terraform = local.config.local_terraform
|
local_terraform = local.config.local_terraform
|
||||||
local_pypi = local.config.local_pypi
|
local_pypi = local.config.local_pypi
|
||||||
local_rpm = local.config.local_rpm
|
local_rpm = local.config.local_rpm
|
||||||
|
local_docker = local.config.local_docker
|
||||||
virtual = local.config.virtual
|
virtual = local.config.virtual
|
||||||
}
|
}
|
||||||
@@ -3,7 +3,7 @@ generate "backend" {
|
|||||||
if_exists = "overwrite"
|
if_exists = "overwrite"
|
||||||
contents = <<EOF
|
contents = <<EOF
|
||||||
provider "artifactapi" {
|
provider "artifactapi" {
|
||||||
endpoint = "https://artifactapi.k8s.syd1.au.unkin.net"
|
endpoint = "https://${path_relative_to_include()}"
|
||||||
}
|
}
|
||||||
|
|
||||||
terraform {
|
terraform {
|
||||||
@@ -15,12 +15,6 @@ terraform {
|
|||||||
ca_file = "/etc/pki/tls/certs/ca-bundle.crt"
|
ca_file = "/etc/pki/tls/certs/ca-bundle.crt"
|
||||||
}
|
}
|
||||||
required_version = ">= 1.10"
|
required_version = ">= 1.10"
|
||||||
required_providers {
|
|
||||||
artifactapi = {
|
|
||||||
source = "git.unkin.net/unkin/artifactapi"
|
|
||||||
version = "0.0.1"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -110,6 +110,13 @@ resource "artifactapi_local_rpm" "this" {
|
|||||||
description = each.value.description
|
description = each.value.description
|
||||||
}
|
}
|
||||||
|
|
||||||
|
resource "artifactapi_local_docker" "this" {
|
||||||
|
for_each = var.local_docker
|
||||||
|
|
||||||
|
name = each.key
|
||||||
|
description = each.value.description
|
||||||
|
}
|
||||||
|
|
||||||
resource "artifactapi_virtual" "this" {
|
resource "artifactapi_virtual" "this" {
|
||||||
for_each = var.virtual
|
for_each = var.virtual
|
||||||
|
|
||||||
|
|||||||
@@ -96,14 +96,6 @@ variable "remote_pypi" {
|
|||||||
default = {}
|
default = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "local_terraform" {
|
|
||||||
description = "Map of local Terraform registry repositories"
|
|
||||||
type = map(object({
|
|
||||||
description = optional(string, "")
|
|
||||||
}))
|
|
||||||
default = {}
|
|
||||||
}
|
|
||||||
|
|
||||||
variable "local_pypi" {
|
variable "local_pypi" {
|
||||||
description = "Map of local PyPI repositories"
|
description = "Map of local PyPI repositories"
|
||||||
type = map(object({
|
type = map(object({
|
||||||
@@ -120,6 +112,22 @@ variable "local_rpm" {
|
|||||||
default = {}
|
default = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "local_terraform" {
|
||||||
|
description = "Map of local Terraform repositories"
|
||||||
|
type = map(object({
|
||||||
|
description = optional(string, "")
|
||||||
|
}))
|
||||||
|
default = {}
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "local_docker" {
|
||||||
|
description = "Map of local Docker repositories (real container registries)"
|
||||||
|
type = map(object({
|
||||||
|
description = optional(string, "")
|
||||||
|
}))
|
||||||
|
default = {}
|
||||||
|
}
|
||||||
|
|
||||||
variable "virtual" {
|
variable "virtual" {
|
||||||
description = "Map of virtual repositories"
|
description = "Map of virtual repositories"
|
||||||
type = map(object({
|
type = map(object({
|
||||||
|
|||||||
@@ -0,0 +1,9 @@
|
|||||||
|
terraform {
|
||||||
|
required_version = ">= 1.10"
|
||||||
|
required_providers {
|
||||||
|
artifactapi = {
|
||||||
|
source = "artifactapi.k8s.syd1.au.unkin.net/terraform-unkin/artifactapi"
|
||||||
|
version = "0.1.3"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user