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

[FEATURE] Use index templates for tenant_template #1222

Closed
AMoo-Miki opened this issue Nov 22, 2022 · 3 comments
Closed

[FEATURE] Use index templates for tenant_template #1222

AMoo-Miki opened this issue Nov 22, 2022 · 3 comments
Labels
enhancement New feature or request triaged

Comments

@AMoo-Miki
Copy link
Contributor

AMoo-Miki commented Nov 22, 2022

Is your feature request related to a problem?

await esClient.indices.putTemplate({
name: 'tenant_template',
body: {
index_patterns: [
opensearchDashboardsIndex + '_-*_*',
opensearchDashboardsIndex + '_0*_*',
opensearchDashboardsIndex + '_1*_*',
opensearchDashboardsIndex + '_2*_*',
opensearchDashboardsIndex + '_3*_*',
opensearchDashboardsIndex + '_4*_*',
opensearchDashboardsIndex + '_5*_*',
opensearchDashboardsIndex + '_6*_*',
opensearchDashboardsIndex + '_7*_*',
opensearchDashboardsIndex + '_8*_*',
opensearchDashboardsIndex + '_9*_*',
],
settings: {
number_of_shards: 1,
},
mappings,
},
});

Since the legacy template currently being used can be overridden by index templates, it would be better to have tenant_template created as an index template and with the highest possible priority to protect all .kibana* system indices from being corrupted simply because their mapping was overridden by some overzealous index template.

What solution would you like?
Use client.indices.putIndexTemplate and set priority to perhaps 263-1.

What alternatives have you considered?
None

Do you have any additional context?
No

@AMoo-Miki AMoo-Miki added enhancement New feature or request untriaged labels Nov 22, 2022
@cliu123
Copy link
Member

cliu123 commented Nov 22, 2022

@AMoo-Miki Thanks for filing the issue! I'm changing priority to order.
But if the order is set to 263-1 would disallow users to override the the tenant-template. Would something like 99 fit this case better? Then users would be able to override tenant-template by explicitly setting custom index templates to something > 99.

@AMoo-Miki
Copy link
Contributor Author

AMoo-Miki commented Nov 23, 2022

@cliu123 AFAIK, index templates don't use order and use priority; the legacy templates used order.

Why would this plugin want to allow overriding its mapping or configuration? Even a tiny bit of change to this template would break the functionality of Dashboards.

@cliu123
Copy link
Member

cliu123 commented Dec 2, 2022

@AMoo-Miki You're right. order is only for the lagacy template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request triaged
Projects
None yet
Development

No branches or pull requests

3 participants