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 all 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
1 change: 1 addition & 0 deletions CHANGELOG.next.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ https://github.com/elastic/beats/compare/v7.0.0-alpha2...master[Check the HEAD d
- Remove deprecated/undocumented IncludeCreatorMetadata setting from kubernetes metadata config options {pull}28006[28006]
- Remove deprecated fields from kubernetes module {pull}28046[28046]
- Remove deprecated config option aws_partition. {pull}28120[28120]
- Update kubernetes.namespace from keyword to group field and add name, labels, annotations, uuid as its fields {pull}27917[27917]

*Auditbeat*

Expand Down
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.

7 changes: 4 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 @@ -381,7 +382,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 +434,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