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

osd: allow for injecting extra env. variables via ConfigMap #9647

Merged
merged 1 commit into from
Jan 26, 2022

Conversation

rzarzynski
Copy link
Contributor

@rzarzynski rzarzynski commented Jan 25, 2022

This is a reworked, implemented in a very different way version of the PR #9516.

Checklist:

  • Commit Message Formatting: Commit titles and messages follow guidelines in the developer guide.
  • Skip Tests for Docs: Add the flag for skipping the build if this is only a documentation change. See here for the flag.
  • Skip Unrelated Tests: Add a flag to run tests for a specific storage provider. See test options.
  • Reviewed the developer guide on Submitting a Pull Request
  • Documentation has been updated, if necessary.
  • Unit tests have been added, if necessary.
  • Integration tests have been added, if necessary.
  • Pending release notes updated with breaking and/or notable changes, if necessary.
  • Upgrade from previous release is tested and upgrade user guide is updated, if necessary.
  • Code generation (make codegen) has been run to update object specifications, if necessary.

deploy/examples/crimson-asan-env-override.yaml Outdated Show resolved Hide resolved
pkg/operator/ceph/cluster/osd/envs.go Outdated Show resolved Hide resolved
pkg/operator/ceph/cluster/osd/envs.go Show resolved Hide resolved
Copy link
Member

@leseb leseb left a comment

Choose a reason for hiding this comment

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

I don't think we need two commits for this, please squash :), small nit otherwise LGTM.

pkg/operator/ceph/cluster/osd/envs.go Outdated Show resolved Hide resolved
Copy link
Member

@leseb leseb left a comment

Choose a reason for hiding this comment

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

One general request and perhaps a bit of documentation will be good. I'm sure @travisn has an idea on where we could put it.

@@ -32,6 +32,7 @@ const (
osdWalSizeEnvVarName = "ROOK_OSD_WAL_SIZE"
osdsPerDeviceEnvVarName = "ROOK_OSDS_PER_DEVICE"
osdDeviceClassEnvVarName = "ROOK_OSD_DEVICE_CLASS"
osdConfigMapOverrideName = "rook-ceph-osd-env-override"
Copy link
Member

Choose a reason for hiding this comment

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

Can we make this more generic and apply it to all the daemons instead of just the OSD?

Copy link
Member

Choose a reason for hiding this comment

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

I just requested the opposite here. :)

Copy link
Member

Choose a reason for hiding this comment

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

@travisn why not? This might be useful in the future for other daemons too..., looks simple too.

Copy link
Member

Choose a reason for hiding this comment

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

How about if we merge this and follow up on this discussion? It will help unblock @rzarzynski.

For the follow-up, this is more like a development-only feature. This change is needed to work with Crimson in the short term, but is there another scenario? For any scenario we are aware of, the operator is expected to add env vars on the pod spec instead of the admin customizing it, so I'm not sure it's worth doing this for other daemons.

@rzarzynski
Copy link
Contributor Author

@leseb: I would be fine with extending this. How about a follow-up PR?

@leseb
Copy link
Member

leseb commented Jan 26, 2022

@leseb: I would be fine with extending this. How about a follow-up PR?

I'm fine with that.

@@ -32,6 +32,7 @@ const (
osdWalSizeEnvVarName = "ROOK_OSD_WAL_SIZE"
osdsPerDeviceEnvVarName = "ROOK_OSDS_PER_DEVICE"
osdDeviceClassEnvVarName = "ROOK_OSD_DEVICE_CLASS"
osdConfigMapOverrideName = "rook-ceph-osd-env-override"
Copy link
Member

Choose a reason for hiding this comment

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

I just requested the opposite here. :)

@@ -0,0 +1,7 @@
apiVersion: v1
Copy link
Member

Choose a reason for hiding this comment

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

How about the following?

  • Name this file osd-env-override.yaml
  • Add comments at the top about how this configmap will be used. I don't think we need official documentation on this developer feature, just documenting here in the configmap seems sufficient.
  • Add a simple comment below on why the ASAN_OPTIONS would be used in the example

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reworked.

This patch brings a mechanism to define arbitrary environment
variables in OSD containers (both prepare and main ones).
It bases on idea proposed by Sebastien Han to use an optional
`ConfigMap` instance named `aook-ceph-daemon-env-override`
as the source of these settings.

The need for the patch comes from the fact that, although
crimson finally exposes the same CLI interface as the classical
OSD, the broadly used development builds have ASan built in.
As ASan, by default, complains if it isn't the very first loaded
DSO, we need a way to set the `ASAN_OPTIONS` environment variable
to `verify_asan_link_order=0` to mitigate the early aborts.

Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
@@ -32,6 +32,7 @@ const (
osdWalSizeEnvVarName = "ROOK_OSD_WAL_SIZE"
osdsPerDeviceEnvVarName = "ROOK_OSDS_PER_DEVICE"
osdDeviceClassEnvVarName = "ROOK_OSD_DEVICE_CLASS"
osdConfigMapOverrideName = "rook-ceph-osd-env-override"
Copy link
Member

Choose a reason for hiding this comment

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

How about if we merge this and follow up on this discussion? It will help unblock @rzarzynski.

For the follow-up, this is more like a development-only feature. This change is needed to work with Crimson in the short term, but is there another scenario? For any scenario we are aware of, the operator is expected to add env vars on the pod spec instead of the admin customizing it, so I'm not sure it's worth doing this for other daemons.

@leseb leseb merged commit 287d9a3 into rook:master Jan 26, 2022
mergify bot added a commit that referenced this pull request Jan 26, 2022
osd: allow for injecting extra env. variables via ConfigMap (backport #9647)
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.

None yet

3 participants