Skip to content

Commit

Permalink
Add long explanation, with install instructions
Browse files Browse the repository at this point in the history
It was sometimes unclear that Kubecost has to be installed in the target
cluster for kubectl-cost to function. This commit adds two things to
`kubectl cost help`:
- clarification of the need for Kubecost to be installed
- a pre-formatted Helm install for Kubecost!
  • Loading branch information
michaelmdresser committed May 3, 2022
1 parent e5932dd commit a183c1c
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions pkg/cmd/cost.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,26 @@ func NewCmdCost(
BuildDate string,
) *cobra.Command {
cmd := &cobra.Command{
Use: "cost",
Short: "View cluster cost information.",
Use: "cost",
Short: "View cluster cost information.",
Long: `
kubectl-cost is a CLI frontend for Kubecost, a highly accurate provider of
Kubernetes cluster cost information and optimization opportunities.
kubectl-cost requires Kubecost to be installed in your Kubernetes cluster. Make
sure to check out the examples and full set of flags (--help) if you have a
non-default Kubecost install, like running in a custom namespace!
If you don't have Kubecost installed yet, all it takes is Helm and two minutes:
kubectl create namespace kubecost
helm repo add kubecost https://kubecost.github.io/cost-analyzer/
helm install \
kubecost \
kubecost/cost-analyzer \
--namespace kubecost \
--set kubecostToken="WljaGFdC5jctl20df98"
`,
Example: fmt.Sprintf(costExample, "kubectl"),
SilenceUsage: true,
RunE: func(c *cobra.Command, args []string) error {
Expand Down

0 comments on commit a183c1c

Please sign in to comment.