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

[Fleet] Add missing package policies for managed preconfigured policies #119488

Merged

Conversation

nchaulet
Copy link
Member

@nchaulet nchaulet commented Nov 23, 2021

Summary

Resolve #113921

Change the behavior of the preconfiguration service to allow to add new package policy to an already created policy.
Also I removed the deletion of the policy in case an error happen during the package policy creation as this new behavior will allow to get the package policy on the next call to setup.

How to tests

From a new kibana ES environment

start you kibana a first time with that config

xpack.fleet.packages:
  - name: apm
    version: latest
xpack.fleet.agentPolicies:
  # Cloud Agent policy
  - name: Elastic Cloud agent policy
    description: Default agent policy for agents hosted on Elastic Cloud
    is_default: false
    is_managed: true
    is_default_fleet_server: true
    namespace: default
    monitoring_enabled: []
    package_policies:
      - name: Fleet Server
        package:
          name: fleet_server
        inputs:
          - type: fleet-server
            keep_enabled: true
            vars:
              - name: host
                value: 0.0.0.0
              - name: port
                value: 8220

Than restart Kibana with that config, you should see an APM package policy in your policy

xpack.fleet.packages:
  - name: apm
    version: latest
xpack.fleet.agentPolicies:
  # Cloud Agent policy
  - name: Elastic Cloud agent policy
    description: Default agent policy for agents hosted on Elastic Cloud
    is_default: false
    is_managed: true
    is_default_fleet_server: true
    namespace: default
    monitoring_enabled: []
    package_policies:
      - name: apm-cloud-123
        package:
          name: apm
      - name: Fleet Server
        package:
          name: fleet_server
        inputs:
          - type: fleet-server
            keep_enabled: true
            vars:
              - name: host
                value: 0.0.0.0
              - name: port
                value: 8220

@nchaulet nchaulet added v8.0.0 release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team auto-backport Deprecated - use backport:version if exact versions are needed v8.1.0 labels Nov 23, 2021
@nchaulet nchaulet self-assigned this Nov 23, 2021
@nchaulet nchaulet marked this pull request as ready for review November 24, 2021 16:23
@nchaulet nchaulet requested a review from a team as a code owner November 24, 2021 16:23
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

Copy link
Member

@kpollich kpollich left a comment

Choose a reason for hiding this comment

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

Tested locally and LGTM 🚀

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @nchaulet

@nchaulet nchaulet merged commit dbf47c6 into elastic:main Nov 24, 2021
@nchaulet nchaulet deleted the feature-add-missing-package-policies-managed branch November 24, 2021 21:03
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 24, 2021
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
8.0

This backport PR will be merged automatically after passing CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed release_note:skip Skip the PR/issue when compiling release notes Team:Fleet Team label for Observability Data Collection Fleet team v7.16.4 v7.17.1 v8.0.0 v8.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Preconfiguration API behavior for missing package policies
6 participants