Skip to content

Commit

Permalink
feat: Support Helm relationships
Browse files Browse the repository at this point in the history
Signed-off-by: Justin Toh <tohjustin@hotmail.com>
  • Loading branch information
tohjustin committed Oct 3, 2021
1 parent 4a3e0fa commit 9ee4162
Show file tree
Hide file tree
Showing 7 changed files with 1,091 additions and 10 deletions.
17 changes: 16 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
[![build](https://github.com/tohjustin/kube-lineage/actions/workflows/build.yaml/badge.svg)](https://github.com/tohjustin/kube-lineage/actions/workflows/build.yaml)
[![release](https://aegisbadges.appspot.com/static?subject=release&status=v0.2.0&color=318FE0)](https://github.com/tohjustin/kube-lineage/releases)
[![kubernetes compatibility](https://aegisbadges.appspot.com/static?subject=k8s%20compatibility&status=v1.19%2B&color=318FE0)](https://endoflife.date/kubernetes)
[![helm compatibility](https://aegisbadges.appspot.com/static?subject=helm%20compatibility&status=v3&color=318FE0)](https://endoflife.date/kubernetes)
[![license](https://aegisbadges.appspot.com/static?subject=license&status=Apache-2.0&color=318FE0)](./LICENSE.md)

A CLI tool to display all dependents of a Kubernetes object.
Expand Down Expand Up @@ -37,6 +38,19 @@ kube-system └── Secret/metrics-server-token-sz96w
kube-system └── Pod/metrics-server-7b4f8b595-mxtfp 1/1 Running 30m [PodVolume]
kube-system └── Service/metrics-server - 30m [Service]
kube-system └── EndpointSlice/metrics-server-lbhb9 - 30m [ControllerReference OwnerReference]

$ kube-lineage helm traefik --show-labels
NAMESPACE NAME READY STATUS AGE LABELS
kube-system traefik - 21d <none>
├── ClusterRole/traefik - 21d app.kubernetes.io/managed-by=Helm
├── ClusterRoleBinding/traefik - 21d app.kubernetes.io/managed-by=Helm
kube-system ├── ConfigMap/traefik - 21d app.kubernetes.io/managed-by=Helm,app=traefik,chart=traefik-1.81.0,heritage=Helm,release=traefik
kube-system ├── ConfigMap/traefik-test - 21d app.kubernetes.io/managed-by=Helm,app=traefik,chart=traefik-1.81.0,heritage=Helm,release=traefik
kube-system ├── Deployment/traefik 1/1 21d app.kubernetes.io/managed-by=Helm,app=traefik,chart=traefik-1.81.0,heritage=Helm,release=traefik
kube-system ├── Secret/traefik-default-cert - 21d app.kubernetes.io/managed-by=Helm,app=traefik,chart=traefik-1.81.0,heritage=Helm,release=traefik
kube-system ├── Service/traefik - 21d app.kubernetes.io/managed-by=Helm,app=traefik,chart=traefik-1.81.0,heritage=Helm,release=traefik
kube-system ├── Service/traefik-prometheus - 21d app.kubernetes.io/managed-by=Helm,app=traefik,chart=traefik-1.81.0,heritage=Helm,release=traefik
kube-system └── ServiceAccount/traefik - 21d app.kubernetes.io/managed-by=Helm
```

List of supported relationships used for discovering dependent objects:
Expand All @@ -51,7 +65,8 @@ List of supported relationships used for discovering dependent objects:
- [Pod References](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/)
- [Service References](https://kubernetes.io/docs/reference/kubernetes-api/service-resources/service-v1/)
- [ServiceAccount References](https://kubernetes.io/docs/reference/kubernetes-api/authentication-resources/service-account-v1/)
- Helm (Coming Soon)
- Helm
- [Release References](https://helm.sh/docs/intro/using_helm/#three-big-concepts)

## Installation

Expand Down
2 changes: 2 additions & 0 deletions cmd/kube-lineage/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/spf13/pflag"
"k8s.io/cli-runtime/pkg/genericclioptions"

"github.com/tohjustin/kube-lineage/pkg/cmd/helm"
"github.com/tohjustin/kube-lineage/pkg/cmd/lineage"
)

Expand All @@ -24,6 +25,7 @@ func init() {

func NewCmd(streams genericclioptions.IOStreams) *cobra.Command {
cmd := lineage.NewCmd(streams, rootCmdName, "")
cmd.AddCommand(helm.NewCmd(streams, "", rootCmdName))
addLogFlags(cmd)
addVersionFlags(cmd)
return cmd
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ module github.com/tohjustin/kube-lineage
go 1.16

require (
github.com/spf13/cobra v1.1.3
github.com/spf13/cobra v1.2.1
github.com/spf13/pflag v1.0.5
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c
helm.sh/helm/v3 v3.7.0
k8s.io/api v0.22.1
k8s.io/apimachinery v0.22.1
k8s.io/cli-runtime v0.22.1
Expand Down
Loading

0 comments on commit 9ee4162

Please sign in to comment.