Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move labels and annotations under kubernetes.namespace. #27917

Merged
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
ef4757d
Move labels and annotations under kubernetes.namespace.
MichaelKatsoulis Sep 14, 2021
bcd66a3
Update fields.yml and replace namespace with namespace.name
MichaelKatsoulis Sep 16, 2021
34072db
Update tests
MichaelKatsoulis Sep 20, 2021
7da9566
Conflicts resolution
MichaelKatsoulis Sep 21, 2021
cbcaa6f
Update include/fields/fields.go
MichaelKatsoulis Sep 21, 2021
ffd5b99
Remove duplicate pod ip
MichaelKatsoulis Sep 22, 2021
3765b24
Fix tests of autodiscover kubernetes provider
MichaelKatsoulis Sep 22, 2021
6da8542
Merge remote-tracking branch 'upstream/master' into unify_namespace_r…
MichaelKatsoulis Sep 22, 2021
fd9a12e
Merge remote-tracking branch 'upstream/master' into unify_namespace_r…
MichaelKatsoulis Sep 22, 2021
2c87c46
Merge remote-tracking branch 'upstream/master' into unify_namespace_r…
MichaelKatsoulis Sep 22, 2021
4080d86
Merge remote-tracking branch 'upstream/master' into unify_namespace_r…
MichaelKatsoulis Sep 23, 2021
7ed43fa
Merge branch 'unify_namespace_resources' of github.com:MichaelKatsoul…
MichaelKatsoulis Sep 23, 2021
e8199cd
resolve conflicts
MichaelKatsoulis Sep 23, 2021
ab4802b
Update tests
MichaelKatsoulis Sep 23, 2021
befbea4
Fixing tests
MichaelKatsoulis Sep 27, 2021
3a4097f
Merge remote-tracking branch 'upstream/master' into unify_namespace_r…
MichaelKatsoulis Sep 29, 2021
d80bab0
Fix log ofsset
MichaelKatsoulis Sep 29, 2021
7309b70
Fix coredns log offste
MichaelKatsoulis Sep 30, 2021
0eabea3
Fix conflicts
MichaelKatsoulis Oct 1, 2021
71cc0b6
Fix log offset
MichaelKatsoulis Oct 1, 2021
6b2083f
Merge remote-tracking branch 'upstream/master' into unify_namespace_r…
MichaelKatsoulis Oct 4, 2021
3f251f0
Review update
MichaelKatsoulis Oct 4, 2021
112cac1
Merge remote-tracking branch 'upstream/master' into unify_namespace_r…
MichaelKatsoulis Oct 7, 2021
a85def1
Merge remote-tracking branch 'upstream/master' into unify_namespace_r…
MichaelKatsoulis Oct 11, 2021
9776bd9
Update changelog
MichaelKatsoulis Oct 11, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 33 additions & 2 deletions auditbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -17322,16 +17322,47 @@ type: ip

--

*`kubernetes.namespace`*::

*`kubernetes.namespace.name`*::
+
--
Kubernetes namespace
Kubernetes namespace name


type: keyword

--

*`kubernetes.namespace.uuid`*::
+
--
Kubernetes namespace uuid


type: keyword

--

*`kubernetes.namespace.labels.*`*::
+
--
Kubernetes namespace labels map


type: object

--

*`kubernetes.namespace.annotations.*`*::
+
--
Kubernetes namespace annotations map


type: object

--

*`kubernetes.node.name`*::
+
--
Expand Down
2 changes: 1 addition & 1 deletion auditbeat/include/fields.go

Large diffs are not rendered by default.

35 changes: 33 additions & 2 deletions filebeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -85721,16 +85721,47 @@ type: ip

--

*`kubernetes.namespace`*::

*`kubernetes.namespace.name`*::
+
--
Kubernetes namespace
Kubernetes namespace name


type: keyword

--

*`kubernetes.namespace.uuid`*::
+
--
Kubernetes namespace uuid


type: keyword

--

*`kubernetes.namespace.labels.*`*::
+
--
Kubernetes namespace labels map


type: object

--

*`kubernetes.namespace.annotations.*`*::
+
--
Kubernetes namespace annotations map


type: object

--

*`kubernetes.node.name`*::
+
--
Expand Down
2 changes: 1 addition & 1 deletion filebeat/include/fields.go

Large diffs are not rendered by default.

35 changes: 33 additions & 2 deletions heartbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -14904,16 +14904,47 @@ type: ip

--

*`kubernetes.namespace`*::

*`kubernetes.namespace.name`*::
+
--
Kubernetes namespace
Kubernetes namespace name


type: keyword

--

*`kubernetes.namespace.uuid`*::
+
--
Kubernetes namespace uuid


type: keyword

--

*`kubernetes.namespace.labels.*`*::
+
--
Kubernetes namespace labels map


type: object

--

*`kubernetes.namespace.annotations.*`*::
+
--
Kubernetes namespace annotations map


type: object

--

*`kubernetes.node.name`*::
+
--
Expand Down
2 changes: 1 addition & 1 deletion heartbeat/include/fields.go

Large diffs are not rendered by default.

35 changes: 33 additions & 2 deletions journalbeat/docs/fields.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -15249,16 +15249,47 @@ type: ip

--

*`kubernetes.namespace`*::

*`kubernetes.namespace.name`*::
+
--
Kubernetes namespace
Kubernetes namespace name


type: keyword

--

*`kubernetes.namespace.uuid`*::
+
--
Kubernetes namespace uuid


type: keyword

--

*`kubernetes.namespace.labels.*`*::
+
--
Kubernetes namespace labels map


type: object

--

*`kubernetes.namespace.annotations.*`*::
+
--
Kubernetes namespace annotations map


type: object

--

*`kubernetes.node.name`*::
+
--
Expand Down
2 changes: 1 addition & 1 deletion journalbeat/include/fields.go

Large diffs are not rendered by default.

8 changes: 5 additions & 3 deletions libbeat/autodiscover/providers/kubernetes/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ func (p *pod) GenerateHints(event bus.Event) bus.Event {
}

// Look at all the namespace level default annotations and do a merge with priority going to the pod annotations.
if rawNsAnn, ok := kubeMeta["namespace_annotations"]; ok {
rawNsAnn, err := kubeMeta.GetValue("namespace.annotations")
if err == nil {
namespaceAnnotations, _ := rawNsAnn.(common.MapStr)
if len(namespaceAnnotations) != 0 {
annotations.DeepUpdateNoOverwrite(namespaceAnnotations)
Expand Down Expand Up @@ -371,6 +372,7 @@ func (p *pod) containerPodEvents(flag string, pod *kubernetes.Pod, c *containerI

// Information that can be used in discovering a workload
kubemetaMap, _ := meta.GetValue("kubernetes")

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If not intentional please revert it.

kubemeta, _ := kubemetaMap.(common.MapStr)
kubemeta = kubemeta.Clone()
kubemeta["annotations"] = annotations
Expand All @@ -381,7 +383,7 @@ func (p *pod) containerPodEvents(flag string, pod *kubernetes.Pod, c *containerI
"runtime": c.runtime,
}
if len(namespaceAnnotations) != 0 {
kubemeta["namespace_annotations"] = namespaceAnnotations
kubemeta.Put("namespace.annotations", namespaceAnnotations)
}

ports := c.spec.Ports
Expand Down Expand Up @@ -433,7 +435,7 @@ func (p *pod) podEvent(flag string, pod *kubernetes.Pod, ports common.MapStr, in
kubemeta = kubemeta.Clone()
kubemeta["annotations"] = annotations
if len(namespaceAnnotations) != 0 {
kubemeta["namespace_annotations"] = namespaceAnnotations
kubemeta.Put("namespace.annotations", namespaceAnnotations)
}

// Don't set a port on the event
Expand Down
Loading