# 使用 Homebrew, MacPorts, Nix, scoop 安装 k2tf

查看 k2tf 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:k2tf
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install k2tf
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install k2tf
```

  证据: MacPorts ports tree: sysutils/k2tf/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- Nix (92%):

```sh
nix profile install nixpkgs#k2tf
```

  证据: nixpkgs package indexes: pkgs/by-name/k2/k2tf/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

### Windows

- Scoop (92%):

```sh
scoop install main/k2tf
```

  证据: Scoop official bucket manifest trees: bucket/k2tf.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1

## 软件包事实

- **软件包键:** brew:k2tf
- **软件包管理器:** Homebrew
- **版本:** 0.8.0
- **来源摘要:** Kubernetes YAML to Terraform HCL converter
- **主页:** <https://github.com/sl1pm4t/k2tf>
- **仓库:** <https://github.com/sl1pm4t/k2tf>
- **最后更新:** 2026-07-27T21:58:34+02:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- k2tf (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 0.8.0
## 项目历史与用法

k2tf is a focused converter that turns Kubernetes API objects written as YAML into Terraform HCL suitable for the Terraform Kubernetes provider.

### 项目历史

The project started publishing releases in February 2019. Its README defines a narrow purpose: convert Kubernetes YAML into Terraform configuration rather than manage clusters or replace Terraform itself.

### 采用历史

k2tf fits teams that already have Kubernetes manifests but want Terraform-managed resources. Its adoption is niche because the need is specific, but package-manager presence in Homebrew, MacPorts, Nix, and Scoop shows enough CLI demand to keep it distributed.

### 使用方式

Users feed Kubernetes YAML files or directories to `k2tf` and receive `.tf` output compatible with the Terraform Kubernetes provider. It is most useful during migrations from manifest-based workflows to Terraform-managed Kubernetes resources.

### 为什么软件包爱好者会关心

k2tf is a small but very package-nerdy bridge tool: it exists because two declarative ecosystems, Kubernetes YAML and Terraform HCL, overlap without sharing a native file format.

### 时间线

- 2019: k2tf v0.1.0 was released in February.
- 2021: v0.6.0 updated the Terraform Kubernetes provider dependency and noted Homebrew core migration documentation.
- 2024: v0.8.0 was published.

### Related projects

- k2tf is related to the Terraform Kubernetes provider, Kubernetes manifests, and sibling conversion tools such as tfk8s.

### 来源

- <https://github.com/jrhouston/tfk8s>
- <https://github.com/sl1pm4t/k2tf>
- <https://github.com/sl1pm4t/k2tf/releases/tag/v0.1.0>
- <https://github.com/sl1pm4t/k2tf/releases/tag/v0.6.0>
- <https://registry.terraform.io/providers/hashicorp/kubernetes/latest/docs>


## 安全说明

infrastructure mutation or orchestration signal.

- **Geiger 风险:** orange / 中
- infrastructure mutation or orchestration signal

## 其他软件包管理器记录

- Nix - k2tf: normalized package name match | nixpkgs package indexes: pkgs/by-name/k2/k2tf/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- MacPorts - k2tf: normalized package name match | MacPorts ports tree: sysutils/k2tf/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Scoop - main/k2tf: normalized package name match | Scoop official bucket manifest trees: bucket/k2tf.json from https://api.github.com/repos/ScoopInstaller/Main/git/trees/master?recursive=1


## Combined YAML source

View the package source record on GitHub. [combined/k2tf.yml](https://github.com/mxcl/pkgdb/blob/main/combined/k2tf.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
