Skip to content

Conversation

@Clee2691
Copy link
Contributor

@Clee2691 Clee2691 commented Apr 4, 2025

Description

This PR adds the ability for the ClusterLogForwarder to utilize multiple distinct role_arns to authenticate to amazon's Cloudwatch on an STS enabled openshift cluster.

Changes:

  1. Removes validation for multiple role_arns.
  2. Adds validation to ensure valid role_arns.
  3. Creates and reconciles a credentials file as a configMap with multiple profiles mounted in /var/run/ocp-collector/config/<CONFIGMAP NAME>/credentials.
  4. The cloudwatch sink will specify the credentials file along with the profile name when iamRole is used as authentication.
  5. No longer sets environment variables for cloudwatch.
  6. Added documentation for an example workflow.

This PR depends on changes to the RH Vector build to include a fix for the region when authenticating to AWS.

/cc @cahartma @vparfonov
/assign @jcantrill

Links

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Apr 4, 2025
@openshift-ci-robot
Copy link

openshift-ci-robot commented Apr 4, 2025

@Clee2691: This pull request references LOG-6790 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.8.0" version, but no target version was set.

Details

In response to this:

Description

This PR adds the ability for the ClusterLogForwarder to utilize multiple distinct role_arns to authenticate to amazon's Cloudwatch on an STS enabled openshift cluster.

Changes:

  1. Removes validation for multiple role_arns.
  2. Adds validation to ensure valid role_arns.
  3. Creates and reconciles a credentials file as a configMap with multiple profiles mounted in /var/run/ocp-collector/config/<CONFIGMAP NAME>/credentials.
  4. The cloudwatch sink will specify the credentials file along with the profile name when iamRole is used as authentication.
  5. No longer sets environment variables for cloudwatch.
  6. Added documentation for an example workflow.

This PR depends on changes to the RH Vector build to include a fix for the when authenticating to AWS.

/cc @cahartma @vparfonov
/assign @jcantrill

Links

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 4, 2025
@openshift-ci openshift-ci bot requested review from cahartma and vparfonov April 4, 2025 19:25
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 4, 2025

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@Clee2691
Copy link
Contributor Author

Clee2691 commented Apr 4, 2025

/test all

@openshift-ci-robot
Copy link

openshift-ci-robot commented Apr 7, 2025

@Clee2691: This pull request references LOG-6790 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "4.8.0" version, but no target version was set.

Details

In response to this:

Description

This PR adds the ability for the ClusterLogForwarder to utilize multiple distinct role_arns to authenticate to amazon's Cloudwatch on an STS enabled openshift cluster.

Changes:

  1. Removes validation for multiple role_arns.
  2. Adds validation to ensure valid role_arns.
  3. Creates and reconciles a credentials file as a configMap with multiple profiles mounted in /var/run/ocp-collector/config/<CONFIGMAP NAME>/credentials.
  4. The cloudwatch sink will specify the credentials file along with the profile name when iamRole is used as authentication.
  5. No longer sets environment variables for cloudwatch.
  6. Added documentation for an example workflow.

This PR depends on changes to the RH Vector build to include a fix for the region when authenticating to AWS.

/cc @cahartma @vparfonov
/assign @jcantrill

Links

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

}

// ReconcileAWSCredentialsConfigMap reconciles a configmap with credential profile(s) for Cloudwatch output(s).
func ReconcileAWSCredentialsConfigMap(k8sClient client.Client, reader client.Reader, namespace, name string, outputs []obs.OutputSpec, secrets observability.Secrets, configMaps map[string]*corev1.ConfigMap, owner metav1.OwnerReference) (*corev1.ConfigMap, error) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need the uncached reader other then k8sClient here? Usually that is only an issue when trying to read a cluster resource that we don't own

Copy link
Contributor Author

@Clee2691 Clee2691 Apr 8, 2025

Choose a reason for hiding this comment

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

Well the reader is used in reconcile.configmap probably because it is used for reconciling the dashboard configmap. So yes

Copy link
Contributor

Choose a reason for hiding this comment

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

The dashboard, however, lives in an unmanaged namespace. You should not need to pass the reader here and simply pass the client as the reader in the dependent function

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see what you mean. Will make the change


// Add generated credentials configmap to contexts to be mounted in pod
if credCm != nil {
context.ConfigMaps[credCm.Name] = credCm
Copy link
Contributor

Choose a reason for hiding this comment

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

Chance of collision wiht a spec'd secret name. We may need an early validation to ensure there is none

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We create other configmaps without name collision validation. I've already generated the name with the forwarder name + aws-creds as that follows our current resource name conventions. I could implement early validation but then should we validate other resource names?

Copy link
Contributor

Choose a reason for hiding this comment

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

If we have precedence and are certain there is limited chance of collision then leave it as-is

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we will have precedence because it will overwrite what is spec'd when the data etc does not match

@Clee2691
Copy link
Contributor Author

Clee2691 commented Apr 8, 2025

/test all

@Clee2691
Copy link
Contributor Author

Clee2691 commented Apr 8, 2025

/test unit

@Clee2691 Clee2691 marked this pull request as ready for review April 9, 2025 17:42
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 9, 2025
@Clee2691
Copy link
Contributor Author

Clee2691 commented Apr 9, 2025

/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 9, 2025
@jcantrill
Copy link
Contributor

/approve

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 9, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Clee2691, jcantrill

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 9, 2025
@Clee2691
Copy link
Contributor Author

Clee2691 commented Apr 9, 2025

/retest

5 similar comments
@Clee2691
Copy link
Contributor Author

/retest

@Clee2691
Copy link
Contributor Author

/retest

@Clee2691
Copy link
Contributor Author

/retest

@Clee2691
Copy link
Contributor Author

/retest

@Clee2691
Copy link
Contributor Author

/retest

@openshift-merge-robot openshift-merge-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 11, 2025
@openshift-merge-robot openshift-merge-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 14, 2025
@Clee2691
Copy link
Contributor Author

/hold cancel

@openshift-ci openshift-ci bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 18, 2025
@cahartma
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 18, 2025
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD ad4c79f and 2 for PR HEAD b927d68 in total

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Apr 18, 2025

@Clee2691: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot bot merged commit dbeb897 into openshift:master Apr 18, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. release/6.3

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants