Skip to content

Conversation

@sjenning
Copy link
Contributor

@sjenning sjenning commented Nov 4, 2020

@joelddiaz @michaelgugino

Add a projected service account token to the machine-controller container in the machine-api-operator pod. We will use this token to get STS creds when that is wired in.

This is inert until then.

https://issues.redhat.com/browse/CO-1254 subtask https://issues.redhat.com/browse/CO-1274

Sources: []corev1.VolumeProjection{
{
ServiceAccountToken: &corev1.ServiceAccountTokenProjection{
Audience: "openshift",
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't understand why we need this.

Copy link
Contributor Author

@sjenning sjenning Nov 4, 2020

Choose a reason for hiding this comment

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

the token or the openshift audience?

We need the token to present to STS to do the AssumeRoleWIthWebIdentity calll, which will be validated by the OpenID Connect Provider registered in IAM

We need to set the audience to the same audience the OpenID Connect Provider was registered to accept. openshift is an arbitrary, but platform-neutral choice.

Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be setting the expiry? IIRC that's a field in this struct right? What happens if we don't set the expiry?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It defaults to 1h, which is in alignment with STS guidelines
https://github.com/kubernetes/kubernetes/blob/4b59044b8d2a3502ea490ba2c958008a098511a3/pkg/apis/core/v1/defaults.go#L273

Which is in alignment with default STS AssumeRole
https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRole.html

By default, the temporary security credentials created by AssumeRole last for one hour.

We can explicitly set it if you prefer. Just let me know.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer to see it explicitly set with a comment saying this is the recommended default and linking to the AWS docs if that's ok?

Copy link

@joelddiaz joelddiaz left a comment

Choose a reason for hiding this comment

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

This looks good. I like the naming scheme for /var/run/secrets/openshift/serviceaccount.

@sjenning
Copy link
Contributor Author

/retest

abhinavdahiya added a commit to abhinavdahiya/cluster-ingress-operator that referenced this pull request Nov 10, 2020
Add a projected service account token to the ingress-operator container in the ingress-operator pod. We will use this token to get STS creds when that is wired in.
This is inert until then. see https://issues.redhat.com/browse/CO-1256

The audience `openshift` chosen is arbitrary, but platform-neutral choice. also see openshift/machine-api-operator#743 for similar consistent change.
abhinavdahiya added a commit to abhinavdahiya/cluster-ingress-operator that referenced this pull request Nov 10, 2020
Add a projected service account token to the ingress-operator container in the ingress-operator pod. We will use this token to get STS creds when that is wired in.
This is inert until then. see https://issues.redhat.com/browse/CO-1256

The audience `openshift` chosen is arbitrary, but platform-neutral choice. also see openshift/machine-api-operator#743 for similar consistent change.
@michaelgugino
Copy link
Contributor

/hold

I don't want to merge this until there is an enhancement or other formalized documentation that lays out exactly what these components are for and how they fit into the larger system.

@openshift-ci-robot openshift-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 11, 2020
@JoelSpeed
Copy link
Contributor

Would like to see the counterpart PR that implements this being used in the AWS code linked here as well, is that being worked on yet?

@sjenning
Copy link
Contributor Author

@JoelSpeed i'm working on that PR now. will link here when i have it.

@sjenning
Copy link
Contributor Author

@JoelSpeed openshift/cluster-api-provider-aws#374

abhinavdahiya added a commit to abhinavdahiya/cluster-ingress-operator that referenced this pull request Nov 13, 2020
Add a projected service account token to the ingress-operator container in the ingress-operator pod. We will use this token to get STS creds when that is wired in.
This is inert until then. see https://issues.redhat.com/browse/CO-1256

The audience `openshift` chosen is arbitrary, but platform-neutral choice. also see openshift/machine-api-operator#743 for similar consistent change.
abhinavdahiya added a commit to abhinavdahiya/cluster-ingress-operator that referenced this pull request Nov 18, 2020
Add a projected service account token to the ingress-operator container in the ingress-operator pod. We will use this token to get STS creds when that is wired in.
This is inert until then. see https://issues.redhat.com/browse/CO-1256

The audience `openshift` chosen is arbitrary, but platform-neutral choice. also see openshift/machine-api-operator#743 for similar consistent change.
abhinavdahiya added a commit to abhinavdahiya/cluster-ingress-operator that referenced this pull request Nov 18, 2020
Add a projected service account token to the ingress-operator container in the ingress-operator pod. We will use this token to get STS creds when that is wired in.
This is inert until then. see https://issues.redhat.com/browse/CO-1256

The audience `openshift` chosen is arbitrary, but platform-neutral choice. also see openshift/machine-api-operator#743 for similar consistent change.
@JoelSpeed
Copy link
Contributor

/approve

@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JoelSpeed

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 Dec 1, 2020
@enxebre
Copy link
Member

enxebre commented Dec 2, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 2, 2020
@michaelgugino
Copy link
Contributor

/hold cancel

We worked out some details in chat, we'll need to capture those in some kind of docs in our repo in the near future.

@openshift-ci-robot openshift-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 4, 2020
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link
Contributor

/retest

Please review the full test history for this PR and help us cut down flakes.

@openshift-merge-robot openshift-merge-robot merged commit bf4ec1b into openshift:master Dec 5, 2020
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. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants