Skip to content

Conversation

@staebler
Copy link
Contributor

@staebler staebler commented Mar 15, 2021

Add a new field userTags to .status.aws of the infrastructure.config.openshift.io type. Tags included in the userTags field will be applied to new resources created for the cluster.

https://issues.redhat.com/browse/CORS-1657

@staebler
Copy link
Contributor Author

Would you mind giving this a review, Jeremiah?

/cc @jstuever

@gregsheremeta
Copy link

ping, ETA on this?

frobware added a commit to frobware/cluster-ingress-operator that referenced this pull request Mar 23, 2021
This is temporary; will drop when 864 merges.
Comment on lines 305 to 307
// userTags is a list of additional tags to apply to AWS resources created for the cluster. Changes made to userTags
// will not be reflected in existing AWS resources. The userTags are only applied to an AWS resource when the
// resource is created.
Copy link
Contributor

Choose a reason for hiding this comment

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

@alexander-demichev is this how it works upstream or do they reconcile as well? I think we will want to mimic their behaviour ideally so we can make the behaviour consistent across various openshift topologies

Choose a reason for hiding this comment

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

This also feels like we're implicitly saying we shouldn't change existing resources, and we're stating we won't. This might require special handling depending on the component in the future.

Copy link

@michaelgugino michaelgugino left a comment

Choose a reason for hiding this comment

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

We should have an enhancement for this.

created for the cluster.
type: object
properties:
key:

Choose a reason for hiding this comment

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

What if users want to have different tags for the machine-api and other components? This API does not allow for this facility.

Also, having this be platform specific means we need special logic for each platform in the future. Why would we define centralized cluster tags for one platform and not another?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

What if users want to have different tags for the machine-api and other components? This API does not allow for this facility.

The user still retains the capability of adding additional tags to specific machinesets/machines just like they do now. Those tags would be additive with the global tags, where the global tags have precedence.

Choose a reason for hiding this comment

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

Those tags would be additive with the global tags, where the global tags have precedence.

This is not stated in the CRD description and should be. Also, this runs contrary to how most config is typically applied (specific should override the general).

Also, since this mechanism is being tied IAM permissions in a particular use case, we need to make sure this mechanism is granular.

@ricardomaraschini
Copy link
Contributor

I am giving my LGTM on this (looking from the internal image registry point of view).

@gregsheremeta
Copy link

previous discussion on a similar enhancement
#231 (comment)

@Miciah
Copy link
Contributor

Miciah commented Mar 23, 2021

Should the new UserTags field be added to AWSPlatformStatus rather than to AWSPlatformSpec? If I understand correctly, the field is going to be set at installation time by the installer, and changing it later on will produce inconsistent results, so it seems more like a status field (implying it is set by the installer or a controller) than a spec field (implying it is set by the user).

If we added a status field now, that would make it easier to add a day-2 configurable later on, with more time to implement consistent behavior and have some controller validate the spec and copy it to status.

@frobware
Copy link
Contributor

Where is validation being done for the key and values?
It would be better if this was not done on a component by component basis.

AWS docs call out the following tag restrictions (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html):

The following basic restrictions apply to tags:

  • Maximum number of tags per resource – 50
  • For each resource, each tag key must be unique, and each tag key can have only one value.
  • Maximum key length – 128 Unicode characters in UTF-8
  • Maximum value length – 256 Unicode characters in UTF-8

Although EC2 allows for any character in its tags, other services are more restrictive. The allowed characters across services are: letters, numbers, and spaces representable in UTF-8, and the following characters: + - = . _ : / @.

Tag keys and values are case-sensitive.

The aws: prefix is reserved for AWS use. If a tag has a tag key with this prefix, then you can't edit or delete the tag's key or value. Tags with the aws: prefix do not count against your tags per resource limit.

@staebler
Copy link
Contributor Author

staebler commented Apr 9, 2021

37d7b08...00709ec

  • Updated to move the new field to status.

@staebler
Copy link
Contributor Author

staebler commented Apr 9, 2021

00709ec...268cd65

  • forgot to update swagger

@JoelSpeed
Copy link
Contributor

Based on what is described in the enhancement, I think this fits the description
/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 12, 2021
@frobware
Copy link
Contributor

Cross reference enhancement proposal: openshift/enhancements#706.

@frobware
Copy link
Contributor

/lgtm
Anything to stop this merging if we're also good with the EP?

@deads2k
Copy link
Contributor

deads2k commented Apr 15, 2021

The low level pieces of the API look good. The final higher level question I have is about having user input here on status and not on spec. I would expect this on spec.

We're discussing in slack at the moment.

Add a new field resourceTags to `.status.aws` of the
infrastructure.config.openshift.io type. Tags included
in the resourceTags field will be applied to new resources
created for the cluster.

https://issues.redhat.com/browse/CORS-1657
@staebler
Copy link
Contributor Author

The low level pieces of the API look good. The final higher level question I have is about having user input here on status and not on spec. I would expect this on spec.

We're discussing in slack at the moment.

The long-term sketch of the design on this is to add a resourceTags field to the spec. The field in the spec will be open for the user to mutate. Changes in the field in the spec will be reconciled to the status field. Tag tuples that are removed from the field in the spec will be reconciled to a different status field. Operators will be expected to apply to their AWS resources those tags that are in the current status field and remove from their AWS resources those tags that are in the future removed field.

@deads2k
Copy link
Contributor

deads2k commented Apr 15, 2021

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: deads2k, frobware, JoelSpeed, staebler

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-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 15, 2021
@staebler staebler changed the title config: add aws usertags to infrastructure Bug 1950113: config: add aws usertags to infrastructure Apr 15, 2021
@openshift-ci-robot openshift-ci-robot added bugzilla/severity-urgent Referenced Bugzilla bug's severity is urgent for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Apr 15, 2021
@openshift-ci-robot
Copy link

@staebler: This pull request references Bugzilla bug 1950113, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.8.0) matches configured target release for branch (4.8.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

No GitHub users were found matching the public email listed for the QA contact in Bugzilla ([email protected]), skipping review request.

Details

In response to this:

Bug 1950113: config: add aws usertags to infrastructure

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/test-infra repository.

@openshift-merge-robot openshift-merge-robot merged commit 38058be into openshift:master Apr 15, 2021
@openshift-ci-robot
Copy link

@staebler: All pull requests linked via external trackers have merged:

Bugzilla bug 1950113 has been moved to the MODIFIED state.

Details

In response to this:

Bug 1950113: config: add aws usertags to infrastructure

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/test-infra repository.

frobware added a commit to frobware/cluster-ingress-operator that referenced this pull request Apr 16, 2021
frobware added a commit to frobware/cluster-ingress-operator that referenced this pull request Apr 16, 2021
frobware added a commit to frobware/cluster-ingress-operator that referenced this pull request Apr 16, 2021
@michaelgugino
Copy link

Tag tuples that are removed from the field in the spec will be reconciled to a different status field. Operators will be expected to apply to their AWS resources those tags that are in the current status field and remove from their AWS resources those tags that are in the future removed field.

This is not reflected in the enhancement, nor did anyone agree to removing tags from resources. Changing and not applying to new resources is not the same as removing tags.

@bparees
Copy link
Contributor

bparees commented Apr 16, 2021

This is not reflected in the enhancement, nor did anyone agree to removing tags from resources. Changing and not applying to new resources is not the same as removing tags.

in fact the enhancement explicitly says we must NOT remove tags from the underlying cloud resources. (That was a request from Clayton). Additive only.

@staebler
Copy link
Contributor Author

/cherry-pick release-4.7

@openshift-cherrypick-robot

@staebler: new pull request created: #914

Details

In response to this:

/cherry-pick release-4.7

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/test-infra repository.

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. bugzilla/severity-urgent Referenced Bugzilla bug's severity is urgent for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.