Installing kubectl-moco
kubectl-moco is a plugin for kubectl
to control MySQL clusters of MOCO.
Pre-built binaries are available on GitHub releases for Windows, Linux, and MacOS.
Installing using Krew
Krew is the plugin manager for kubectl command-line tool.
See the documentation for how to install Krew.
$ kubectl krew update
$ kubectl krew install moco
Installing manually
-
Set
OS
to the operating system nameOS is one of
linux
,windows
, ordarwin
(MacOS).If Go is available,
OS
can be set automatically as follows:$ OS=$(go env GOOS)
-
Set
ARCH
to the architecture nameARCH is one of
amd64
orarm64
.If Go is available,
ARCH
can be set automatically as follows:$ ARCH=$(go env GOARCH)
-
Set
VERSION
to the MOCO versionSee the MOCO release page: https://github.com/cybozu-go/moco/releases
$ VERSION=< The version you want to install >
-
Download the binary and put it in a directory of your
PATH
.The following is an example to install the plugin in
/usr/local/bin
.$ curl -L -sS https://github.com/cybozu-go/moco/releases/download/${VERSION}/kubectl-moco_${VERSION}_${OS}_${ARCH}.tar.gz \ | tar xz -C /usr/local/bin kubectl-moco
-
Check the installation by running
kubectl moco -h
.$ kubectl moco -h the utility command for MOCO. Usage: kubectl-moco [command] Available Commands: credential Fetch the credential of a specified user help Help about any command mysql Run mysql command in a specified MySQL instance switchover Switch the primary instance ...