# Install kubectl-cnpg with Homebrew, apk, Nix, zypper

CloudNativePG plugin for kubectl. Version 1.30.0 via Homebrew; verified 2026-06-29.

## Install

```sh
sudo av install brew:kubectl-cnpg
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install kubectl-cnpg
```

  Evidence: local Homebrew formula metadata

### Linux

- apk (92%):

```sh
sudo apk add kubectl-cnpg
```

  Evidence: Alpine Linux edge package indexes: kubectl-cnpg from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz

- Nix (92%):

```sh
nix profile install nixpkgs#kubectl-cnpg
```

  Evidence: nixpkgs package indexes: pkgs/by-name/ku/kubectl-cnpg/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- zypper (92%):

```sh
sudo zypper install kubectl-cnpg
```

  Evidence: openSUSE Tumbleweed package metadata: kubectl-cnpg from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst

## Package facts

- **Package key:** brew:kubectl-cnpg
- **Package manager:** Homebrew
- **Package manager page:** <https://formulae.brew.sh/formula/kubectl-cnpg>
- **Version:** 1.30.0
- **Source summary:** CloudNativePG plugin for kubectl
- **Homepage:** <https://cloudnative-pg.io/>
- **Repository:** <https://github.com/cloudnative-pg/cloudnative-pg>
- **Upstream docs:** <https://cloudnative-pg.io/docs/devel/kubectl-plugin>
- **License:** Apache-2.0
- **Source archive:** <https://github.com/cloudnative-pg/cloudnative-pg.git>
- **Last updated:** 2026-06-29T18:38:45Z
- **Generated:** 2026-07-08T18:08:21+00:00

## Executables

- kubectl-cnpg (cli)
- kubectl_complete-cnpg (cli)
- kubectl-cnpg (alias)
- kubectl_complete-cnpg (alias)

## Build dependencies

- go

## Install behavior

- Post-install hook: not defined
- Bottle: available on arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## Freshness

- Page generated: 2026-07-08
- Package-manager version: 1.30.0
- Package-manager updated: 2026-06-29
- Local data: ok
- Upstream repository: https://github.com/cloudnative-pg/cloudnative-pg
- info: No cached GitHub release or tag data was available.
## Project history and usage

kubectl-cnpg is the kubectl plugin shipped by the CloudNativePG project for managing PostgreSQL clusters on Kubernetes. The plugin is part of the main CloudNativePG repository rather than a separate utility repository.

### Project history

The CloudNativePG GitHub repository was created on 2022-03-10. The project describes CloudNativePG as a platform for managing PostgreSQL databases in Kubernetes across the operational lifecycle, and its repository topics include `kubectl-plugin`, `operator`, `postgresql`, and high-availability concepts.

The kubectl plugin became one of the operator's user-facing control surfaces: the official plugin documentation covers installation scripts, Debian and RPM packages, AUR, Krew, Homebrew, supported architectures, completion, and command usage.

### Adoption history

The plugin's adoption follows CloudNativePG adoption rather than an independent CLI culture. The package appears in Homebrew, APK, Nix, and zypper, and the official docs name Homebrew and Krew as supported install paths for workstation users.

The repository metadata observed on 2026-07-01 showed more than 8000 GitHub stars for CloudNativePG, which makes kubectl-cnpg a plugin attached to a prominent Kubernetes database operator rather than a tiny standalone addon.

### How it is used

After installation, users run commands as `kubectl cnpg COMMAND [ARGS...]`. The official documentation emphasizes management tasks such as generating installation manifests and interacting with CloudNativePG-managed database clusters.

The plugin uses the normal kubectl configuration path through `~/.kube/config`, so it fits existing Kubernetes authentication and context workflows rather than defining a separate credentials store.

### Why package nerds care

kubectl-cnpg is interesting as a packaged operator companion: the binary is distributed across OS package systems even though its value is tied to a cluster-side controller. It shows how serious Kubernetes operators often grow their own kubectl plugin for operational ergonomics.

### Timeline

- 2022-03-10: CloudNativePG repository created.
- 2025-05-08: CloudNativePG release v1.29.1 published.
- 2026-06-29: CloudNativePG release v1.30.0 published, with plugin package examples in the documentation using v1.30.0 assets.

### Related projects

- Related projects include Kubernetes, kubectl, Krew, PostgreSQL, and the CloudNativePG operator. The package is not a general PostgreSQL client; it is an operational frontend for CloudNativePG resources.

### Sources

- <https://api.github.com/repos/cloudnative-pg/cloudnative-pg>
- <https://cloudnative-pg.io/docs/devel/kubectl-plugin>
- <https://cloudnative-pg.io/documentation/current/kubectl-plugin>
- <https://formulae.brew.sh/formula/kubectl-cnpg>
- <https://github.com/cloudnative-pg/cloudnative-pg>
- <https://krew.sigs.k8s.io/docs/user-guide/setup/install/>


## Security Notes

infrastructure mutation or orchestration signal.

- **Geiger risk:** orange / medium
- infrastructure mutation or orchestration signal


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: ~/.kube/config
## Source Database Details

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** kubectl-cnpg
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## Other Package-Manager Records

- Nix - kubectl-cnpg: normalized package name match | nixpkgs package indexes: pkgs/by-name/ku/kubectl-cnpg/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- apk - kubectl-cnpg - 1.29.0-r2: normalized package name match | Alpine Linux edge package indexes: kubectl-cnpg from https://dl-cdn.alpinelinux.org/alpine/edge/testing/x86_64/APKINDEX.tar.gz | kubectl plugin for cloudnative-pg | https://github.com/cloudnative-pg/cloudnative-pg
- zypper - kubectl-cnpg - 1.29.1-1.1: normalized package name match | openSUSE Tumbleweed package metadata: kubectl-cnpg from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst | Manage PostgreSQL clusters built using CloudNativePG | https://github.com/cloudnative-pg/cloudnative-pg
- zypper - kubectl-cnpg-bash-completion - 1.29.1-1.1: normalized package name match | openSUSE Tumbleweed package metadata: kubectl-cnpg-bash-completion from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst | Bash Completion for kubectl-cnpg | https://github.com/cloudnative-pg/cloudnative-pg
- zypper - kubectl-cnpg-fish-completion - 1.29.1-1.1: normalized package name match | openSUSE Tumbleweed package metadata: kubectl-cnpg-fish-completion from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst | Fish Completion for kubectl-cnpg | https://github.com/cloudnative-pg/cloudnative-pg
- zypper - kubectl-cnpg-zsh-completion - 1.29.1-1.1: normalized package name match | openSUSE Tumbleweed package metadata: kubectl-cnpg-zsh-completion from https://download.opensuse.org/tumbleweed/repo/oss/repodata/be8d3611d25469107f32075a1697e69ec57a2b850b42348a658cc671ad5ec2b50760d02c3e59524d50da9a11d5be799bdaffba2e166e8ca8858512e3c0bd665d-primary.xml.zst | Zsh Completion for kubectl-cnpg | https://github.com/cloudnative-pg/cloudnative-pg


## Related links

- [Cloud CLI packages](https://www.automicvault.com/pkg/cloud-clis/) - Belongs to a cloud or infrastructure command family.
- [Secret-risk packages](https://www.automicvault.com/pkg/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://www.automicvault.com/pkg/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://www.automicvault.com/pkg/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [go](https://www.automicvault.com/pkg/brew/go/) - Build dependency declared by Homebrew.
- [kubectl-rook-ceph](https://www.automicvault.com/pkg/brew/kubectl-rook-ceph/) - Shares av.db curated category or tags: cli, developer-tools, kubectl-plugin, kubernetes.
- [kubectl-tree](https://www.automicvault.com/pkg/brew/kubectl-tree/) - Shares av.db curated category or tags: cli, developer-tools, kubectl-plugin, kubernetes.
- [kubecolor](https://www.automicvault.com/pkg/brew/kubecolor/) - Shares av.db curated category or tags: cli, developer-tools, kubectl-plugin, kubernetes.
- [chart-releaser](https://www.automicvault.com/pkg/brew/chart-releaser/) - Shares av.db curated category or tags: cli, developer-tools, kubernetes.
- [chart-testing](https://www.automicvault.com/pkg/brew/chart-testing/) - Shares av.db curated category or tags: cli, developer-tools, kubernetes.
- [cmctl](https://www.automicvault.com/pkg/brew/cmctl/) - Shares av.db curated category or tags: cli, developer-tools, kubernetes.
- [cri-tools](https://www.automicvault.com/pkg/brew/cri-tools/) - Shares av.db curated category or tags: cli, developer-tools, kubernetes.
- [kamel](https://www.automicvault.com/pkg/brew/kamel/) - Shares av.db curated category or tags: cli, developer-tools, kubernetes.
- [kubectl-ai](https://www.automicvault.com/pkg/brew/kubectl-ai/) - Package names and metadata indicate a similar tool family. Shared terms: cli, developer, developer-tools, kubectl, kubernetes.

## Combined YAML source

View the package source record on GitHub. [combined/kubectl-cnpg.yml](https://github.com/automic-vault/db/blob/main/combined/kubectl-cnpg.yml)


## Sources

- Nucleus package database
- Geiger risk classifier
- package-page enrichment
- curated configuration and credential file locations
- curated package history
- package version freshness
- av.db category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
