gnmik is a kubectl plugin for working with gNMIc operator custom resources (Cluster, Pipeline, Target, etc.).
Build and install so the binary name is kubectl-gnmic (kubectl discovers plugins as kubectl <plugin>):
go install github.com/gnmic/gnmik@latestEnsure $(go env GOPATH)/bin is on your PATH.
Override the embedded version string at link time:
go install -ldflags "-X github.com/gnmic/gnmik/cmd.Version=1.2.3" github.com/gnmic/gnmik@latestkubectl gnmic get clusters
kubectl gnmic describe cluster my-cluster
kubectl gnmic status pipeline my-pipeline
kubectl gnmic plan cluster my-cluster
kubectl gnmic graph
kubectl gnmic logs cluster my-cluster --follow
kubectl gnmic version- Namespace: use
kubectl gnmic -n <namespace> ...or set the namespace in your current kubeconfig context. If unset, the plugin defaults todefault(after checking the kubeconfig context namespace).
Calls the operator HTTP API through the Kubernetes API service proxy:
/api/v1/namespaces/<operator-ns>/services/<svc>:<port>/proxy/clusters/<cluster-ns>/<cluster-name>/plan
Flags (defaults match a typical operator install):
--operator-namespace(default:gnmic-system)--service-name(default:gnmic-controller-manager-api)--service-port(default:8082)
You need RBAC to get the service and use connect/proxy to that endpoint.
- Kubernetes cluster with the gNMIc operator and CRDs installed
kubectl/ kubeconfig access to the API server
go test ./...
go vet ./...