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

OCPBUGS-2158: operator: add service account issuers to KAS status #1313

Merged

Conversation

mfojtik
Copy link
Member

@mfojtik mfojtik commented Sep 27, 2022

According to the Kubernetes documentation, starting from Kubernetes 1.22, the service-account-issuer flag can be specified multiple times. The first value is then used to generate new tokens and other values are accepted. Using this field can prevent cluster disruptions and allows for smoother reconfiguration of this field.

see: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#service-account-token-volume-projection

The status field will allow us to keep track of "used" service account issuers and also expire/prune them.

this is a replacement for: #1309

xref: https://issues.redhat.com/browse/AUTH-309

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 27, 2022

Hello @mfojtik! Some important instructions when contributing to openshift/api:
API design plays an important part in the user experience of OpenShift and as such API PRs are subject to a high level of scrutiny to ensure they follow our best practices. If you haven't already done so, please review the OpenShift API Conventions and ensure that your proposed changes are compliant. Following these conventions will help expedite the api review process for your PR.

For merging purposes, this repository follows the no-Feature-Freeze process which means that in addition to the standard lgtm and approved labels this repository requires either:

bugzilla/valid-bug - applied if your PR references a valid bugzilla bug

OR

qe-approved, docs-approved, and px-approved - these labels can be applied by anyone in the openshift org via the /label <labelname> command.

Who should apply these qe/docs/px labels?

  • For a no-Feature-Freeze team who is merging a feature before code freeze, they need to get those labels applied to their api repo PR by the appropriate teams (i.e. qe, docs, px)
  • For a Feature Freeze (traditional) team who is merging a feature before FF, they can self-apply the labels (via /label commands), they are basically irrelevant for those teams
  • For a Feature Freeze team who is merging a feature after FF, the PR should be rejected barring an exception

@mfojtik
Copy link
Member Author

mfojtik commented Sep 27, 2022

/assign @stlaz

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 27, 2022
@stlaz
Copy link
Member

stlaz commented Sep 29, 2022

LGTM


// serviceAccountIssuers tracks history of used service account issuers.
// The item without expiration time represents the currently used service account issuer.
// The other items represents service account issuers that were used previously and are still being trusted.
Copy link
Contributor

Choose a reason for hiding this comment

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

How long will the entry be trusted for once it is no longer the present entry?

Where does the configuration for this come from?

Copy link
Member Author

Choose a reason for hiding this comment

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

The default is 24h, and it is hardcoded in the controller. I don't think we want to expose this to users to configure the expiration time.

Copy link
Contributor

Choose a reason for hiding this comment

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

Exposing it would allow users to force remove old entries, but I think we are discussing that elsewhere. Documenting the value is a requirement though IMO

operator/v1/types_kubeapiserver.go Outdated Show resolved Hide resolved
operator/v1/types_kubeapiserver.go Show resolved Hide resolved
Copy link
Contributor

@JoelSpeed JoelSpeed left a comment

Choose a reason for hiding this comment

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

I'd like to see a note about being subject to change otherwise LGTM

config/v1/types_authentication.go Show resolved Hide resolved
@mfojtik mfojtik force-pushed the serviceaccountissuer-v2 branch 2 times, most recently from 906a5ba to 95bbe01 Compare October 3, 2022 15:18
serviceAccountIssuers tracks history of used service account issuers.
The item without expiration time represents the currently used service account issuer.
The other items represents service account issuers that were used previously and are still being trusted.

See: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#service-account-token-volume-projection

xref: https://issues.redhat.com/browse/AUTH-309
@JoelSpeed
Copy link
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Oct 4, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 4, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JoelSpeed, mfojtik

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

The pull request process is described here

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

@mfojtik mfojtik changed the title operator: add service account issuers to KAS status AUTH-309: operator: add service account issuers to KAS status Oct 4, 2022
@gangwgr
Copy link

gangwgr commented Oct 10, 2022

/label cherry-pick-approved

@openshift-ci openshift-ci bot added the cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. label Oct 10, 2022
@wangke19
Copy link

/label qe-approved

@openshift-ci openshift-ci bot added the qe-approved Signifies that QE has signed off on this PR label Oct 10, 2022
@mfojtik
Copy link
Member Author

mfojtik commented Oct 10, 2022

/label docs-approved
/label px-approved

@openshift-ci openshift-ci bot added docs-approved Signifies that Docs has signed off on this PR px-approved Signifies that Product Support has signed off on this PR labels Oct 10, 2022
@mfojtik
Copy link
Member Author

mfojtik commented Oct 10, 2022

documentation team had been contacted and there will be need to update product documentation once the change is implemented.

@mfojtik
Copy link
Member Author

mfojtik commented Oct 10, 2022

/refresh

@mfojtik
Copy link
Member Author

mfojtik commented Oct 10, 2022

/cherrypick release-4.11

@openshift-cherrypick-robot

@mfojtik: once the present PR merges, I will cherry-pick it on top of release-4.11 in a new PR and assign it to you.

In response to this:

/cherrypick release-4.11

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-ci
Copy link
Contributor

openshift-ci bot commented Oct 10, 2022

@mfojtik: all tests passed!

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@openshift-merge-robot openshift-merge-robot merged commit ec3e449 into openshift:master Oct 10, 2022
@openshift-cherrypick-robot

@mfojtik: #1313 failed to apply on top of branch "release-4.11":

Applying: operator: add service account issuers into kubernetes apiserver operator
Applying: update generated
Using index info to reconstruct a base tree...
M	config/v1/0000_10_config-operator_01_authentication.crd.yaml
M	config/v1/zz_generated.swagger_doc_generated.go
A	openapi/generated_openapi/zz_generated.openapi.go
A	openapi/openapi.json
M	operator/v1/zz_generated.deepcopy.go
M	operator/v1/zz_generated.swagger_doc_generated.go
Falling back to patching base and 3-way merge...
Auto-merging operator/v1/zz_generated.swagger_doc_generated.go
Auto-merging operator/v1/zz_generated.deepcopy.go
CONFLICT (modify/delete): openapi/openapi.json deleted in HEAD and modified in update generated. Version update generated of openapi/openapi.json left in tree.
CONFLICT (modify/delete): openapi/generated_openapi/zz_generated.openapi.go deleted in HEAD and modified in update generated. Version update generated of openapi/generated_openapi/zz_generated.openapi.go left in tree.
Auto-merging config/v1/zz_generated.swagger_doc_generated.go
Auto-merging config/v1/0000_10_config-operator_01_authentication.crd.yaml
CONFLICT (content): Merge conflict in config/v1/0000_10_config-operator_01_authentication.crd.yaml
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0002 update generated
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherrypick release-4.11

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.

@mfojtik mfojtik changed the title AUTH-309: operator: add service account issuers to KAS status OCPBUGS-830: operator: add service account issuers to KAS status Oct 10, 2022
@openshift-ci-robot
Copy link

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

Jira Issue OCPBUGS-830 has been moved to the MODIFIED state.

In response to this:

According to the Kubernetes documentation, starting from Kubernetes 1.22, the service-account-issuer flag can be specified multiple times. The first value is then used to generate new tokens and other values are accepted. Using this field can prevent cluster disruptions and allows for smoother reconfiguration of this field.

see: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#service-account-token-volume-projection

The status field will allow us to keep track of "used" service account issuers and also expire/prune them.

this is a replacement for: #1309

xref: https://issues.redhat.com/browse/AUTH-309

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.

@mfojtik mfojtik changed the title OCPBUGS-830: operator: add service account issuers to KAS status OCPBUGS-2158: operator: add service account issuers to KAS status Oct 10, 2022
@openshift-ci-robot
Copy link

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

Jira Issue OCPBUGS-2158 has been moved to the MODIFIED state.

In response to this:

According to the Kubernetes documentation, starting from Kubernetes 1.22, the service-account-issuer flag can be specified multiple times. The first value is then used to generate new tokens and other values are accepted. Using this field can prevent cluster disruptions and allows for smoother reconfiguration of this field.

see: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/#service-account-token-volume-projection

The status field will allow us to keep track of "used" service account issuers and also expire/prune them.

this is a replacement for: #1309

xref: https://issues.redhat.com/browse/AUTH-309

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. cherry-pick-approved Indicates a cherry-pick PR into a release branch has been approved by the release branch manager. docs-approved Signifies that Docs has signed off on this PR lgtm Indicates that a PR is ready to be merged. px-approved Signifies that Product Support has signed off on this PR qe-approved Signifies that QE has signed off on this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants