Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Kubernetes YAML to Terraform HCL converter

License

NotificationsYou must be signed in to change notification settings

sl1pm4t/k2tf

Repository files navigation

Build StatusGo Report CardRelease

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 theTerraform Kubernetes Provider

asciicast

Installation

Pre-built Binaries

Download Binary from GitHubreleases page.

Build from source

See below

Homebrew

$ brew install k2tf

asdf

Use theasdf-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

Downloads


[8]ページ先頭

©2009-2025 Movatter.jp