diff --git a/cmd/helmChart.go b/cmd/helmChart.go index 55ed62d8a..4f6555e46 100644 --- a/cmd/helmChart.go +++ b/cmd/helmChart.go @@ -268,7 +268,7 @@ func dumpHelmChart(objects map[string]interface{}) error { } path := filepath.Join(templatesFolder, filename) - err = os.WriteFile(path, []byte(manifest), 0644) + err = os.WriteFile(path, []byte(manifestHeader+manifest), 0644) if err != nil { return err } diff --git a/cmd/manifests.go b/cmd/manifests.go index 7856f3ded..ce1b2ad35 100644 --- a/cmd/manifests.go +++ b/cmd/manifests.go @@ -18,6 +18,7 @@ import ( ) const manifestSeperator = "---" +const manifestHeader = "# THIS FILE IS AUTOMATICALLY GENERATED BY KUBESHARK CLI. DO NOT EDIT!\n" + manifestSeperator + "\n" var manifestsCmd = &cobra.Command{ Use: "manifests", @@ -183,7 +184,7 @@ func dumpManifests(objects map[string]interface{}) error { } path := filepath.Join(folder, filename) - err = os.WriteFile(path, []byte(manifest), 0644) + err = os.WriteFile(path, []byte(manifestHeader+manifest), 0644) if err != nil { return err } diff --git a/helm-chart/templates/00-namespace.yaml b/helm-chart/templates/00-namespace.yaml index 80fd11578..e0b7d15d0 100644 --- a/helm-chart/templates/00-namespace.yaml +++ b/helm-chart/templates/00-namespace.yaml @@ -1,3 +1,5 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY KUBESHARK CLI. DO NOT EDIT! +--- apiVersion: v1 kind: Namespace metadata: diff --git a/helm-chart/templates/01-service-account.yaml b/helm-chart/templates/01-service-account.yaml index 23128bbee..0e6b074b4 100644 --- a/helm-chart/templates/01-service-account.yaml +++ b/helm-chart/templates/01-service-account.yaml @@ -1,3 +1,5 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY KUBESHARK CLI. DO NOT EDIT! +--- apiVersion: v1 kind: ServiceAccount metadata: diff --git a/helm-chart/templates/02-cluster-role.yaml b/helm-chart/templates/02-cluster-role.yaml index 6f48a7296..cd5115890 100644 --- a/helm-chart/templates/02-cluster-role.yaml +++ b/helm-chart/templates/02-cluster-role.yaml @@ -1,3 +1,5 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY KUBESHARK CLI. DO NOT EDIT! +--- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: diff --git a/helm-chart/templates/03-cluster-role-binding.yaml b/helm-chart/templates/03-cluster-role-binding.yaml index 1b2034e38..a08a8b9a6 100644 --- a/helm-chart/templates/03-cluster-role-binding.yaml +++ b/helm-chart/templates/03-cluster-role-binding.yaml @@ -1,3 +1,5 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY KUBESHARK CLI. DO NOT EDIT! +--- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: @@ -6,7 +8,7 @@ metadata: kubeshark-cli-version: v1 kubeshark-created-by: kubeshark kubeshark-managed-by: kubeshark - name: kubeshark-service-account + name: kubeshark-cluster-role-binding namespace: '{{ .Values.tap.selfnamespace }}' roleRef: apiGroup: rbac.authorization.k8s.io diff --git a/helm-chart/templates/04-hub-pod.yaml b/helm-chart/templates/04-hub-pod.yaml index 11e453b20..b96f56cce 100644 --- a/helm-chart/templates/04-hub-pod.yaml +++ b/helm-chart/templates/04-hub-pod.yaml @@ -1,3 +1,5 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY KUBESHARK CLI. DO NOT EDIT! +--- apiVersion: v1 kind: Pod metadata: diff --git a/helm-chart/templates/05-hub-service.yaml b/helm-chart/templates/05-hub-service.yaml index ae95eeb82..71879eae2 100644 --- a/helm-chart/templates/05-hub-service.yaml +++ b/helm-chart/templates/05-hub-service.yaml @@ -1,3 +1,5 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY KUBESHARK CLI. DO NOT EDIT! +--- apiVersion: v1 kind: Service metadata: diff --git a/helm-chart/templates/06-front-pod.yaml b/helm-chart/templates/06-front-pod.yaml index bfeea99f0..d7c490637 100644 --- a/helm-chart/templates/06-front-pod.yaml +++ b/helm-chart/templates/06-front-pod.yaml @@ -1,3 +1,5 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY KUBESHARK CLI. DO NOT EDIT! +--- apiVersion: v1 kind: Pod metadata: diff --git a/helm-chart/templates/07-front-service.yaml b/helm-chart/templates/07-front-service.yaml index 08b3b8f4c..056624fd2 100644 --- a/helm-chart/templates/07-front-service.yaml +++ b/helm-chart/templates/07-front-service.yaml @@ -1,3 +1,5 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY KUBESHARK CLI. DO NOT EDIT! +--- apiVersion: v1 kind: Service metadata: diff --git a/helm-chart/templates/08-worker-daemon-set.yaml b/helm-chart/templates/08-worker-daemon-set.yaml index 2db7e95be..fc0c557c6 100644 --- a/helm-chart/templates/08-worker-daemon-set.yaml +++ b/helm-chart/templates/08-worker-daemon-set.yaml @@ -1,3 +1,5 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY KUBESHARK CLI. DO NOT EDIT! +--- apiVersion: apps/v1 kind: DaemonSet metadata: diff --git a/kubernetes/provider.go b/kubernetes/provider.go index a13ce09f0..4f7e66743 100644 --- a/kubernetes/provider.go +++ b/kubernetes/provider.go @@ -575,7 +575,7 @@ func (provider *Provider) BuildClusterRoleBinding() *rbac.ClusterRoleBinding { APIVersion: "rbac.authorization.k8s.io/v1", }, ObjectMeta: metav1.ObjectMeta{ - Name: ServiceAccountName, + Name: ClusterRoleBindingName, Namespace: config.Config.Tap.SelfNamespace, Labels: buildWithDefaultLabels(map[string]string{ fmt.Sprintf("%s-cli-version", misc.Program): misc.RBACVersion, diff --git a/manifests/00-namespace.yaml b/manifests/00-namespace.yaml index 90f85f1ab..02d6870b8 100644 --- a/manifests/00-namespace.yaml +++ b/manifests/00-namespace.yaml @@ -1,3 +1,5 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY KUBESHARK CLI. DO NOT EDIT! +--- apiVersion: v1 kind: Namespace metadata: diff --git a/manifests/01-service-account.yaml b/manifests/01-service-account.yaml index 6a26a0460..196bbdad1 100644 --- a/manifests/01-service-account.yaml +++ b/manifests/01-service-account.yaml @@ -1,3 +1,5 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY KUBESHARK CLI. DO NOT EDIT! +--- apiVersion: v1 kind: ServiceAccount metadata: diff --git a/manifests/02-cluster-role.yaml b/manifests/02-cluster-role.yaml index 46584034e..d2cb28482 100644 --- a/manifests/02-cluster-role.yaml +++ b/manifests/02-cluster-role.yaml @@ -1,3 +1,5 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY KUBESHARK CLI. DO NOT EDIT! +--- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: diff --git a/manifests/03-cluster-role-binding.yaml b/manifests/03-cluster-role-binding.yaml index 2ead4cc73..40919222a 100644 --- a/manifests/03-cluster-role-binding.yaml +++ b/manifests/03-cluster-role-binding.yaml @@ -1,3 +1,5 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY KUBESHARK CLI. DO NOT EDIT! +--- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: @@ -6,7 +8,7 @@ metadata: kubeshark-cli-version: v1 kubeshark-created-by: kubeshark kubeshark-managed-by: kubeshark - name: kubeshark-service-account + name: kubeshark-cluster-role-binding namespace: kubeshark roleRef: apiGroup: rbac.authorization.k8s.io diff --git a/manifests/04-hub-pod.yaml b/manifests/04-hub-pod.yaml index 1ad08f4ae..51a02f46b 100644 --- a/manifests/04-hub-pod.yaml +++ b/manifests/04-hub-pod.yaml @@ -1,3 +1,5 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY KUBESHARK CLI. DO NOT EDIT! +--- apiVersion: v1 kind: Pod metadata: diff --git a/manifests/05-hub-service.yaml b/manifests/05-hub-service.yaml index ffa72931c..94863fa89 100644 --- a/manifests/05-hub-service.yaml +++ b/manifests/05-hub-service.yaml @@ -1,3 +1,5 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY KUBESHARK CLI. DO NOT EDIT! +--- apiVersion: v1 kind: Service metadata: diff --git a/manifests/06-front-pod.yaml b/manifests/06-front-pod.yaml index 8077952bf..b0bb19768 100644 --- a/manifests/06-front-pod.yaml +++ b/manifests/06-front-pod.yaml @@ -1,3 +1,5 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY KUBESHARK CLI. DO NOT EDIT! +--- apiVersion: v1 kind: Pod metadata: diff --git a/manifests/07-front-service.yaml b/manifests/07-front-service.yaml index 2fdc0f409..3fab9583c 100644 --- a/manifests/07-front-service.yaml +++ b/manifests/07-front-service.yaml @@ -1,3 +1,5 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY KUBESHARK CLI. DO NOT EDIT! +--- apiVersion: v1 kind: Service metadata: diff --git a/manifests/08-worker-daemon-set.yaml b/manifests/08-worker-daemon-set.yaml index 073ad9d21..82ed36d27 100644 --- a/manifests/08-worker-daemon-set.yaml +++ b/manifests/08-worker-daemon-set.yaml @@ -1,3 +1,5 @@ +# THIS FILE IS AUTOMATICALLY GENERATED BY KUBESHARK CLI. DO NOT EDIT! +--- apiVersion: apps/v1 kind: DaemonSet metadata: