Skip to content

Commit

Permalink
operator: add troubleshoot subcommands
Browse files Browse the repository at this point in the history
Make the same troubleshoot commands already introduced as part of the
cilium-dbg binary also available for the operator, to simplify
troubleshooting kvstore and remote clusters connectivity issues.

The troubleshoot commands can be run through something along the lines of:

$ kubectl exec -it -n kube-system deployments/cilium-operator -- \
      cilium-operator-generic troubleshoot kvstore
$ kubectl exec -it -n kube-system deployments/cilium-operator -- \
      cilium-operator-generic troubleshoot clustermesh

Signed-off-by: Marco Iorio <marco.iorio@isovalent.com>
giorio94 authored and squeed committed May 14, 2024
1 parent 3be5a0b commit 5f0e3e2
Showing 22 changed files with 329 additions and 1 deletion.
1 change: 1 addition & 0 deletions Documentation/cmdref/cilium-operator-alibabacloud.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions Documentation/cmdref/cilium-operator-alibabacloud_troubleshoot.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Documentation/cmdref/cilium-operator-aws.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions Documentation/cmdref/cilium-operator-aws_troubleshoot.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions Documentation/cmdref/cilium-operator-aws_troubleshoot_kvstore.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Documentation/cmdref/cilium-operator-azure.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions Documentation/cmdref/cilium-operator-azure_troubleshoot.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions Documentation/cmdref/cilium-operator-azure_troubleshoot_kvstore.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Documentation/cmdref/cilium-operator-generic.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions Documentation/cmdref/cilium-operator-generic_troubleshoot.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Documentation/cmdref/cilium-operator.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions Documentation/cmdref/cilium-operator_troubleshoot.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions Documentation/cmdref/cilium-operator_troubleshoot_clustermesh.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions Documentation/cmdref/cilium-operator_troubleshoot_kvstore.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion cilium-dbg/cmd/troubleshoot.go
Original file line number Diff line number Diff line change
@@ -21,7 +21,8 @@ import (
"github.com/cilium/cilium/pkg/loadbalancer"
)

// TroubleshootCmd represents the troubleshoot command
// TroubleshootCmd represents the troubleshoot command. Note that this command
// is additionally registered as a subcommand of the Cilium operator.
var TroubleshootCmd = &cobra.Command{
Use: "troubleshoot",
Short: "Run troubleshooting utilities to check control-plane connectivity",
2 changes: 2 additions & 0 deletions operator/cmd/root.go
Original file line number Diff line number Diff line change
@@ -27,6 +27,7 @@ import (
"k8s.io/client-go/tools/leaderelection/resourcelock"

operatorApi "github.com/cilium/cilium/api/v1/operator/server"
ciliumdbg "github.com/cilium/cilium/cilium-dbg/cmd"
"github.com/cilium/cilium/operator/api"
"github.com/cilium/cilium/operator/auth"
"github.com/cilium/cilium/operator/endpointgc"
@@ -281,6 +282,7 @@ func NewOperatorCmd(h *hive.Hive) *cobra.Command {
cmd.AddCommand(
MetricsCmd,
StatusCmd,
ciliumdbg.TroubleshootCmd,
h.Command(),
)

0 comments on commit 5f0e3e2

Please sign in to comment.