Kube Sync is a CLI application to copy/sync ConfigMaps and secrets from one namespace to another.
While working with Kubernetes, all of us might have encountered a situation where applications deployed in a new namespace were failing because of missing image pull secret, which we forgot to create in the new namespace. This tool helps us in copying such secrets or ConfigMaps from an already existing namespace to a new namespace.
Stable binaries are also available on the releases page. Stable releases are generally recommended for CI usage in particular. To install, download the binary for your platform from "Assets" and place this into your $PATH:
curl -Lo ./kube-sync https://github.com/viveksyngh/kube-sync/releases/download/v0.1.0/kube-sync-$(uname)-amd64
chmod +x ./kube-sync
mv ./kube-sync /usr/local/bin/kube-sync
curl -Lo ./kube-sync https://github.com/viveksyngh/kube-sync/releases/download/v0.1.0/kube-sync-darwin-amd64
chmod +x ./kube-sync
mv ./kube-sync /usr/local/bin/kube-sync
curl.exe -Lo kube-sync-windows-amd64.exe https://github.com/viveksyngh/kube-sync/releases/download/v0.1.0/kube-sync-windows-amd64
Move-Item .\kube-sync-windows-amd64.exe c:\some-dir-in-your-PATH\kube-sync-windows-amd64.exe
NAME:
kube-sync - A CLI to sync kubernetes resources
USAGE:
kube-sync [global options] command [command options] [arguments...]
DESCRIPTION:
A CLI to sync resources in a kubernetes cluster
COMMANDS:
configmap, cm Copy a configmap from one namespace to another
secret, sec Copy a secret from one namespace to another
version, v print version
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--kubeconfig value path to the kubeconfig file to use for CLI requests (default: "~/.kube/config") [$KUBECONFIG]
--namespace value, -n value namespace of the source resource (default: "default")
--target-namespace value, --tn value target namespace in which resource will be copied (default: "default")
--help, -h show help (default: false)
kube-sync configmap --help
NAME:
kube-sync configmap - Copy a configmap from one namespace to another
USAGE:
kube-sync configmap [command options] NAME
OPTIONS:
--help, -h show help (default: false)
kube-sync --namespace source-ns --target-namespace target-ns configmap configmap-name
kube-sync --namespace source-ns --target-namespace target-ns cm configmap-name
kube-sync secret --help
NAME:
kube-sync secret - Copy a secret from one namespace to another
USAGE:
kube-sync secret [command options] NAME
OPTIONS:
--help, -h show help (default: false)
kube-sync --namespace source-ns --target-namespace target-ns secret secret-name
kube-sync --namespace source-ns --target-namespace target-ns sec secret-name