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

Create fields automatically in setup job #1064

Merged
merged 11 commits into from Nov 9, 2020

Conversation

pmalek-sumo
Copy link
Contributor

Description

Use https://github.com/SumoLogic/terraform-provider-sumologic/ (version v2.3.0 introduced fields support) to create fields in setup job.

Testing performed
  • ci/build.sh
  • Redeploy fluentd and fluentd-events pods
  • Confirm events, logs, and metrics are coming in

@pmalek-sumo pmalek-sumo force-pushed the create-fields-in-setup-job branch 3 times, most recently from d46d2e8 to db2fac5 Compare November 4, 2020 09:06
@pmalek-sumo pmalek-sumo linked an issue Nov 4, 2020 that may be closed by this pull request
Copy link
Contributor

@sumo-drosiek sumo-drosiek left a comment

Choose a reason for hiding this comment

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

🥁

Copy link
Contributor

@frankreno frankreno left a comment

Choose a reason for hiding this comment

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

LGTM, but left a few comments

deploy/helm/sumologic/conf/setup/setup.sh Outdated Show resolved Hide resolved
We've tried to automatically create fields. In an unlikely scenario that this
fails please refer to the following to create them manually:
https://github.com/SumoLogic/sumologic-kubernetes-collection/blob/2b3ca63/deploy/docs/Installation_with_Helm.md#prerequisite
Copy link
Contributor

Choose a reason for hiding this comment

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

There is no easy way to only show the text in the event of an actual failure I assume?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was discussed and we couldn't figure out a way of getting return feedback from the setup job to helm to conditionally render this message.

variable "create_fields" {
description = "If set, terraform will attempt to create fields at Sumo Logic"
type = bool
default = false
Copy link
Contributor

Choose a reason for hiding this comment

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

Why default to false?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No specific reason. I've provided the default as suggested by @sumo-drosiek prevent the need for specifying terraform variable during imports.

We can also default to true if that's more appropriate for our use case. It will be specified on terraform apply anyway

# Apply planned changes
terraform apply -auto-approve \
-var="create_fields=${CREATE_FIELDS}"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

After discussion with folks on PL sync I've changed this to true (which doesn't really change anything in our code but expresses our intent of creating fields by default)

Copy link
Contributor

@perk-sumo perk-sumo left a comment

Choose a reason for hiding this comment

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

One nit around function name and the result it produces.

deploy/helm/sumologic/conf/setup/setup.sh Show resolved Hide resolved
deploy/helm/sumologic/conf/setup/setup.sh Outdated Show resolved Hide resolved
@pmalek-sumo pmalek-sumo merged commit d759d01 into master Nov 9, 2020
@pmalek-sumo pmalek-sumo deleted the create-fields-in-setup-job branch November 9, 2020 11:27
Copy link
Contributor

@perk-sumo perk-sumo left a comment

Choose a reason for hiding this comment

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

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatically Create Fields as Part of installation
5 participants