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

Bug 1538560 - [RFE]rename the project name mux-undefined #1065

Merged
merged 1 commit into from
Apr 23, 2018

Conversation

nhosoi
Copy link
Contributor

@nhosoi nhosoi commented Apr 5, 2018

mux-undefined ==> .orphaned
mux.sh: if there are any tests which create project "mux-undefined"
just remove that project checking and creation.

@openshift-ci-robot openshift-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 5, 2018
use a namespace of `mux-undefined`, so the log records will be in an index
named something like `project.mux-undefined.$mux-undefined_uuid.YYYY.MM.DD`
use a namespace of `.orphaned`, so the log records will be in an index
named something like `project..orphaned.$mux-undefined_uuid.YYYY.MM.DD`
Copy link
Contributor

Choose a reason for hiding this comment

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

.orphaned isn't a namespace - @jcantrill - what is the full index name for orphaned records? .orphaned.orphan-uuid.YYYY.MM.DD?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -277,7 +277,7 @@ of the cluster. It is expected that the record has the `@timestamp` field and
is already formatted for the ViaQ data model. If the tag matches
`project.namespacename.**`, mux extracts the `namespacename` and passes this to
the k8s meta filter plugin in order to get the namespace uuid. If the tag does
not match, mux uses a namespacename of `mux-undefined`. Except for the k8s
not match, mux uses a namespacename of `.orphaned`. Except for the k8s
Copy link
Contributor

Choose a reason for hiding this comment

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

.orphaned isn't a namespace

@@ -360,7 +360,7 @@ The next stage in the pipeline is this filter:

This examines the tag to see if it is of the form
`project.namespacename.whatever`, and sets the field `mux_namespace_name` to
the value of `namespacename` if it is in that form, or `mux-undefined`
the value of `namespacename` if it is in that form, or `.orphaned`
Copy link
Contributor

Choose a reason for hiding this comment

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

.orphaned isn't a namespace

mux_need_k8s_meta ${(record['namespace_uuid'] || record.fetch('kubernetes', Hash.new)['namespace_id'].nil?) ? "true" : "false"}
kubernetes {"namespace_name":"${record['namespace_name'] || (tag_parts[0] == 'project' && tag_parts[1]) || ENV['MUX_UNDEFINED_NAMESPACE'] || 'mux-undefined'}","namespace_id":"${record['namespace_uuid'] || record.fetch('kubernetes', Hash.new)['namespace_id']}"}
kubernetes {"namespace_name":"${record['namespace_name'] || (tag_parts[0] == 'project' && tag_parts[1]) || ENV['MUX_UNDEFINED_NAMESPACE'] || '.orphaned'}","namespace_id":"${record['namespace_uuid'] || record.fetch('kubernetes', Hash.new)['namespace_id']}"}
Copy link
Contributor

Choose a reason for hiding this comment

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

@jcantrill what is the namespace_id for .orphaned?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fluent-plugin-kubernetes_metadata_filter/README.md:

  • orphaned_namespace_name - The namespace to associate with records where the namespace can not be determined (default: .orphaned)
  • orphaned_namespace_id - The namespace id to associate with records where the namespace can not be determined (default: orphaned)

Could there be a possibility record.fetch('kubernetes', Hash.new)['namespace_id'] is nil? If so, we should add another default for orphane?

  •  kubernetes {"namespace_name":"${record['namespace_name'] || (tag_parts[0] == 'project' && tag_parts[1]) || ENV['MUX_UNDEFINED_NAMESPACE'] || '.orphaned'}","namespace_id":"${record['namespace_uuid'] || record.fetch('kubernetes', Hash.new)['namespace_id'] || 'orphaned'}"}
    

Copy link
Contributor

Choose a reason for hiding this comment

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

Could there be a possibility record.fetch('kubernetes', Hash.new)['namespace_id'] is nil? If so, we should add another default for orphane?

Yes. If we cannot determine the namespace_id in any other way, we should use orphaned.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

https://github.com/openshift/origin-aggregated-logging/blob/master/fluentd/configs.d/input-post-forward-mux.conf#L87-L88
If mux_namespace_name is ENV["MUX_UNDEFINED_NAMESPACE"] or ".orphaned", do we want to set the tag to "mux" to skip "k8s meta"?

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, good idea

test/mux.sh Outdated
espod=$es_pod
# make sure this namespace exists
os::cmd::try_until_success "oc get project mux-undefined" 2>&1 | artifact_out
os::cmd::try_until_success "oc get project .orphaned" 2>&1 | artifact_out
Copy link
Contributor

Choose a reason for hiding this comment

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

I thought this didn't work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right. It fails...

Copy link
Contributor

Choose a reason for hiding this comment

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

we don't need this check anymore

@richm
Copy link
Contributor

richm commented Apr 20, 2018

/retest

@nhosoi nhosoi force-pushed the bz1538560 branch 2 times, most recently from 1e07f63 to 46faaf8 Compare April 20, 2018 23:49
The logs which failed to associate with the namespace/project will be
indexed into the ES index file .orphaned.YYYY.MM.DD instead of the
project.mux-undefined.*.

In rewrite_tag_filter (input-post-forward-mux.conf), if mux_namespace_name
is .orphaned, we will skip the effort to get k8s_metadata.
@nhosoi
Copy link
Contributor Author

nhosoi commented Apr 23, 2018

Note: This pr is supposed to be released with openshift/openshift-ansible#7792.

@nhosoi nhosoi changed the title [WIP] Bug 1538560 - [RFE]rename the project name mux-undefined Bug 1538560 - [RFE]rename the project name mux-undefined Apr 23, 2018
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 23, 2018
@nhosoi nhosoi added the backport/3.9 backport this PR to release-3.9 label Apr 23, 2018
@richm
Copy link
Contributor

richm commented Apr 23, 2018

does this PR work without the corresponding ansible change? If so, what happens?

@nhosoi
Copy link
Contributor Author

nhosoi commented Apr 23, 2018

The corresponding openshift-ansible is for eliminating openshift_logging_mux_default_namespaces. Functionality-wise, there is no impact with or without the openshift-ansible pr7792, I'd think.

@richm
Copy link
Contributor

richm commented Apr 23, 2018

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 23, 2018
@richm
Copy link
Contributor

richm commented Apr 23, 2018

There is a backport 3.9 - do we need this in 3.9?

@nhosoi
Copy link
Contributor Author

nhosoi commented Apr 23, 2018

There is a backport 3.9 - do we need this in 3.9?

I set it just because the target release of bz1538560 is 3.9.z. Probably, we could reset it to 3.10?

@richm
Copy link
Contributor

richm commented Apr 23, 2018

I set it just because the target release of bz1538560 is 3.9.z. Probably, we could reset it to 3.10?

Yes, I think so. The other related change to rename logging to openshift-logging is also in 3.10 and is not backported.

@nhosoi nhosoi removed the backport/3.9 backport this PR to release-3.9 label Apr 23, 2018
@nhosoi
Copy link
Contributor Author

nhosoi commented Apr 23, 2018

Reset the target release of bz. Removing backport/3.9, as well...

@openshift-merge-robot openshift-merge-robot merged commit fb557c7 into openshift:master Apr 23, 2018
@richm richm mentioned this pull request Jun 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport/es5.x lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants