• Stars
    star
    177
  • Rank 215,985 (Top 5 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created about 8 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Terraform provider for converting Butane Configs to Ignition

terraform-provider-ct

GoDoc Workflow Downloads Sponsors Mastodon

terraform-provider-ct allows Terraform to validate a Butane config and transpile to an Ignition config for machine consumption.

Usage

Configure the config transpiler provider (e.g. providers.tf).

provider "ct" {}

terraform {
  required_providers {
    ct = {
      source  = "poseidon/ct"
      version = "0.13.0"
    }
  }
}

Define a Butane config for Fedora CoreOS or Flatcar Linux:

variant: fcos
version: 1.5.0
passwd:
  users:
    - name: core
      ssh_authorized_keys:
        - ssh-key foo
variant: flatcar
version: 1.1.0
passwd:
  users:
    - name: core
      ssh_authorized_keys:
        - ssh-key foo

Define a ct_config data source with strict validation.

data "ct_config" "worker" {
  content      = file("worker.yaml")
  strict       = true
  pretty_print = false

  snippets = [
    file("units.yaml"),
    file("storage.yaml"),
  ]
}

Optionally, template the content.

data "ct_config" "worker" {
  content = templatefile("worker.yaml", {
    ssh_authorized_key = "ssh-ed25519 AAAA...",
  })
  strict       = true
}

Render the ct_config as Ignition for use by machine instances.

resource "aws_instance" "worker" {
  user_data = data.ct_config.worker.rendered
}

Run terraform init to ensure plugin version requirements are met.

$ terraform init

Requirements

Versions

Butane configs are converted to the current (according to this provider) stable Ignition config and merged together. For example, poseidon/ct v0.12.0 would convert a Butane Config with variant: fcos and version: 1.2.0 to an Ignition config with version v3.3.0. This relies on Ignition's forward compatibility.

poseidon/ct Butane variant Butane version Ignition verison
0.13.x fcos 1.0.0, 1.1.0, 1.2.0, 1.3.0, 1.4.0, 1.5.0 3.4.0
0.13.x flatcar 1.0.0, 1.1.0 3.4.0
0.12.x fcos 1.0.0, 1.1.0, 1.2.0, 1.3.0, 1.4.0 3.3.0
0.12.x flatcar 1.0.0 3.3.0

Before poseidon/ct v0.12.0, ct_config content could be a Butane Config or a Container Linux Config (CLC). Before poseidon/ct v0.10.0, Butane configs contained a version that was associated with an Ignition format version. For example, a Butane config with version: 1.0.0 would produce an Ignition config with version 3.0.0.

terraform-provider-ct CLC to Ignition Butane to Ignition
0.11.x Renders 2.3.0 Butane (1.0, 1.1, 1.2, 1.3, 1.4) -> Ignition 3.3
0.10.x Renders 2.3.0 Butane (1.0, 1.1, 1.2, 1.3, 1.4) -> Ignition 3.3
0.9.x Renders 2.3.0 Butane (1.0, 1.1, 1.2, 1.3, 1.4) -> Ignition (3.0, 3.1, 3.2, 3.2, 3.3)
0.8.x Renders 2.3.0 Butane (1.0, 1.1, 1.2, 1.3) -> Ignition (3.0, 3.1, 3.2, 3.2)
0.7.x Renders 2.3.0 Butane (1.0, 1.1, 1.2) -> Ignition (3.0, 3.1, 3.2)
0.6.x Renders 2.3.0 Butane (1.0, 1.1) -> Ignition (3.0, 3.1)
0.5.x Renders 2.2.0 Butane 1.0.0 -> Ignition 3.0.0
0.4.x Renders 2.2.0 Butane 1.0.0 -> Ignition 3.0.0
0.3.x Renders 2.2.0 NA
0.2.x Renders 2.0.0 NA

Development

Binary

To develop the provider plugin locally, build an executable with Go v1.18+.

make

More Repositories

1

typhoon

Minimal and free Kubernetes distribution with Terraform
HCL
1,859
star
2

matchbox

Network boot and provision Fedora CoreOS and Flatcar Linux clusters
Go
1,177
star
3

terraform-provider-matchbox

Terraform provider for Matchbox on-premise / bare-metal provisioning
Go
119
star
4

terraform-render-bootstrap

Low-level bootstrap a Kubernetes control plane with Terraform (part of Typhoon)
HCL
101
star
5

fleetlock

Reboot coordinator for Fedora CoreOS nodes using the Zincati FleetLock protocol
Go
69
star
6

terraform-digitalocean-kubernetes

Typhoon DigitalOcean - minimal and free Kubernetes (mirror)
HCL
33
star
7

terraform-aws-kubernetes

Typhoon AWS - minimal and free Kubernetes (mirror)
HCL
31
star
8

terraform-onprem-kubernetes

Typhoon bare-metal - minimal and free Kubernetes (mirror)
HCL
31
star
9

terraform-google-kubernetes

Typhoon Google Cloud - minimal and free Kubernetes (mirror)
HCL
25
star
10

dnsmasq

Network infrastructure for small networks
Makefile
20
star
11

scuttle

Kubelet graceful node drain/delete and spot termination watcher
Go
16
star
12

kubelet

Upstream Kubelet packaged as a container image
Makefile
15
star
13

wait-for-status-checks

GitHub Action that waits for check runs
TypeScript
9
star
14

terraform-provider-cue

Terraform provider for evaluting CUE to render JSON
Go
8
star
15

terraform-provider-util

Terraform provider for special utilities
Go
3
star
16

flannel-cni

Flannel init container to install a CNI config and CNI plugins
Shell
2
star
17

blog-bits

Code from the Poseidon Labs blog
Shell
1
star
18

terraform-azure-kubernetes

Typhoon Azure - minimal and free Kubernetes (mirror)
HCL
1
star
19

system-containers

System container images for Typhoon for Fedora Atomic
Makefile
1
star
20

github-runner

GitHub Actions self-hosted runner container image that registers itself
Go
1
star