Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
K

k2tf

> 数据库
Open source

Kubernetes YAML to Terraform HCL converter

1.2K stars0 likes1 views
WebsiteGitHub

About

Kubernetes YAML to Terraform HCL converter

k2tf - Kubernetes YAML to Terraform HCL converter

A tool for converting Kubernetes API Objects (in YAML format) into HashiCorp's Terraform configuration language.

The converted .tf files are suitable for use with the Terraform Kubernetes Provider

Installation

Pre-built Binaries

Download Binary from GitHub releases page.

Build from source

See below

Homebrew

$ brew install k2tf

asdf

Use the asdf-k2tf plugin.

Example Usage

Convert a single YAML file and write generated Terraform config to Stdout

$ k2tf -f test-fixtures/service.yaml

Convert a single YAML file and write output to file

$ k2tf -f test-fixtures/service.yaml -o service.tf

Convert a directory of Kubernetes YAML files

$ k2tf -f test-fixtures/

Read & convert Kubernetes objects directly from a cluster

$ kubectl get deployments -o yaml | ./k2tf -o deployments.tf

Building

NOTE Requires a working Golang build environment.

This project uses Golang modules for dependency management, so it can be cloned outside of the $GOPATH.

Clone the repository

$ git clone https://github.com/sl1pm4t/k2tf.git

Build

$ cd k2tf
$ make build

Run Tests

$ make test

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Gocommand-line-toolconverterhashicorphashicorp-terraform

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category数据库
PricingOpen source

> Related tools

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库