-
Notifications
You must be signed in to change notification settings - Fork 15
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
NE-1381: API - add STSIAMRoleARN field #113
Conversation
@alebedev87: This pull request references NE-1381 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 story to target the "4.15.0" version, but no target version was set. In response to this:
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. |
@alebedev87: This pull request references NE-1381 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 story to target the "4.15.0" version, but no target version was set. In response to this:
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. |
// This field won't have any effect if credentials have already been provided through the `Credentials` field, | ||
// as a request for credentials from the Cloud Credentials Operator will not be triggered. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could enforce this validation using a CEL validation rule
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CEL validation is added.
// | ||
// +kubebuilder:validation:Optional | ||
// +optional | ||
CredentialsRequestConfig *AWSLoadBalancerCredentialsRequestConfig `json:"credentialsRequestConfig,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So this allows me to configure a credentials request that is created by the load balancer type? Or to refer to an existing credentials request?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to configure a credentials request that is created for the managed load balancer controller. The credentials request is defined by the operator. The new field is the only moving part in it for the moment.
36d4061
to
731de07
Compare
7c2022d
to
6a8130a
Compare
6a8130a
to
f1a1b7c
Compare
@alebedev87: This pull request references NE-1381 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 story to target the "4.15.0" version, but no target version was set. In response to this:
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. |
Needs openshift/release#44017 to make the rosa e2e work. |
/test e2e-aws-proxy-operator |
@alebedev87: This pull request references NE-1381 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 story to target the "4.15.0" version, but no target version was set. In response to this:
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. |
/test e2e-aws-rosa-operator |
ROSA cluster provisioning is blocked by openshift/rosa#1548. |
/assign @gcs278 |
eb71d9d
to
7548094
Compare
Docs updated to truncate the role name used by |
/test e2e-aws-rosa-operator |
1 similar comment
/test e2e-aws-rosa-operator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, mostly nit picks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tangential nit I think the names of these documents are confusing.
docs/prerequisities.md
:
- For STS, shows you how to create IAM Role and then install ALBO
- VPC and Subnets
docs/install.md
- For STS, assumes ALBO is already installed, and shows you how to create the
AWSLoadBalancerController
with STS IAM Role ARN. - Nothing for non-STS
prerequisties.md
documents STS install, but install.md
documents how to configure an ALBC instance (only for STS).
My thoughts:
- It shouldn't be
prerequisites.md
if we describe how to install ALBO on an STS cluster, that should beinstall.md
install.md
isn't showing how to install, it's showing how to finish configuring ALBC (post-install?)install.md
lacks showing how to install non-STS clusters
I think these suggestions are out of scope of this PR, so I don't want to hold you to it right now, but what do you think about someone addressing this as a bug in another PR? Do you agree something seems funky with organization?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you agree something seems funky with organization?
Yes, I agree. The 3 docs (prerequisistes, install, tutorial) overlap and mislead sometimes. It's a problem of this repository from the very beginning. Many reshuffles were done with different success rates.
I did another one to exclude the overlap, feel free to leave comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it. It feels like it flows a bit better.
docs/install.md
Outdated
|
||
2. For `AWSLoadBalancerController` CR the **aws-load-balancer-operator** creates a `CredentialsRequest` named `aws-load-balancer-controller-cluster` in the `openshift-cloud-credential-operator` namespace. Extract and save the created `CredentialsRequest` in a directory: | ||
#### Option 1. Using `ccoctl` | ||
The dedicated controller's `CredentialsRequest` is maintained in [hack/controller](../hack/controller/) directory of this repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit I think this information is good, but arguably shouldn't it be added to prerequisites.md
to be symmetrical? These two documents seem to describe very similar things, and this statement also applies there.
Also, do you think it should be an absolute link, [hack/controller](/hack/controller/)
, to be more resilient to moving docs around?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit I think this information is good, but arguably shouldn't it be added to prerequisites.md to be symmetrical? These two documents seem to describe very similar things, and this statement also applies there.
Both docs are aligned now.
Also, do you think it should be an absolute link, hack/controller, to be more resilient to moving docs around?
The path you proposed doesn't seem to be 100% absolute, it's still relative to the repository. I'm fine with it but does this syntax work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah sorry. I was wrong about how github markdown works. You'd need to do the full URL in order to make it absolute, and that feels wrong. Seems like relative paths are preferred anyways. mkdocs/mkdocs#192
// withCredSecretIf adds the credentials secret only if the given condition is true. | ||
func (b *albcBuilder) withCredSecretIf(condition bool, name string) *albcBuilder { | ||
// withRoleARNIf adds given role ARN to the credentials request config if the given condition is true. | ||
func (b *albcBuilder) withRoleARNIf(condition bool, roleARN string) *albcBuilder { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I tried to run E2E in my STS cluster, non-ROSA, but this logic won't allow me to provide a roleARN manually, right?
I feel like we should support directly provide ENV while not in a Rosa cluster, otherwise I can't test your changes manually in my STS cluster.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a dedicated README chapter for the manual testing on a ROSA cluster. But I believe it should work on any STS cluster too. I think I should add ALBO_E2E_CONTROLLER_ROLE_ARN
variable in there and maybe make it more generic: change the chapter name and add new platform toALBO_E2E_PLATFORM
envvar.
Does it sound like what you were looking for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah okay, I didn't realize the platform was controlled by a ENV Variables, I thought it was looking at some sort of cluster config object. Yea I suppose I could say I'm "ROSA" to test, but that does feel a little funky because I'd be lying.
I think your suggestion makes sense. If I provide ALBO_E2E_CONTROLLER_ROLE_ARN
, I feel like it should use that in ALBC creation regardless of my platform, but at the same time, I don't think I should have to set ALBO_E2E_PLATFORM
to ROSA
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah okay, I didn't realize the platform was controlled by a ENV Variables, I thought it was looking at some sort of cluster config object.
I don't know any reliable way of how to detect whether your container runs on a cluster which uses STS credentials. Infrastructure
resource doesn't have any info about it. CCO in manual mode != STS. We could check the format of the contents of the cluster operator's secrets but that seems to be a little too much. Overall, it's a good question which needs to be digged in. I'll try to follow up on it.
I tried to address the comment in this commit. Let me know if it's still unclear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea your approach is fine.
@alebedev87 It passes the provision tests. My fix was in and it no longer blocks that step :)
|
Thanks @chenz4027! The provisioning is back indeed. |
/test e2e-aws-operator |
Problems pulling
Since it's pulled from docker.io, I decided to replace it with |
Another ROSA provisioning issue: openshift/release#44633. |
d7185cc
to
b9932fb
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the updates, I like the reformatting.
In an STS cluster, the **cloud-credential-operator** does not automatically provision secrets for `CredentialsRequest`s, | ||
so the cluster-admin must provision them manually. | ||
IAM role and policies must also be provisioned manually. | ||
## STS clusters |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit This is install.md
, but only shows how to install STS clusters. Is it worth adding a Non-STS Cluster
section for completeness?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-STS clusters
chapter added.
docs/install.md
Outdated
1. Extract and prepare the `ccoctl` binary as described in [Configuring the Cloud Credential Operator utility](https://docs.openshift.com/container-platform/4.13/authentication/managing_cloud_provider_credentials/cco-mode-sts.html#cco-ccoctl-configuring_cco-mode-sts). | ||
|
||
2. For `AWSLoadBalancerController` CR the **aws-load-balancer-operator** creates a `CredentialsRequest` named `aws-load-balancer-controller-cluster` in the `openshift-cloud-credential-operator` namespace. Extract and save the created `CredentialsRequest` in a directory: | ||
The operator can be installed using [the OperatorHub web UI](https://docs.openshift.com/container-platform/latest/operators/understanding/olm-understanding-operatorhub.html) or by running the following commands: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When installing from the UI, don't you also need to apply:
config:
env:
- name: ROLEARN
value: "${ROLEARN}"
to the subscription object? How is this done when you install it via the UI? I'm confused, because looking at https://github.com/alebedev87/aws-load-balancer-operator/blob/ne-1381-api-rolearn/bundle/manifests/aws-load-balancer-operator.clusterserviceversion.yaml, I followed to https://docs.openshift.com/container-platform/4.13/networking/aws_load_balancer_operator/installing-albo-sts-cluster.html#nw-bootstra-albo-on-sts-cluster_albo-sts-cluster and that didn't tell me how to include the ROLEARN env? Or is that automatic somehow when using the Web UI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The OperatorHub's web UI is supposed to be updated with a new input box for the role ARN. A screenshot of how this is supposed to look like can be found in How To STS doc. Let me say this explicitly in our markdown.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rephrased.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like it. It feels like it flows a bit better.
@@ -1111,6 +1178,25 @@ func TestAWSLoadBalancerControllerWithExternalTypeNLBAndNonStandardPort(t *testi | |||
} | |||
} | |||
|
|||
// TestAWSLoadBalancerControllerOpenAPIValidation tests validations added to AWSLoadBalancerController CRD. | |||
func TestAWSLoadBalancerControllerOpenAPIValidation(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this test is a good addition, but future looking, are you familiar with the API integration test suite? https://github.com/openshift/api/tree/master/tests#readme. You can create API tests like this in YAML files. Not sure how easy it would be to port that over here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting. That may be useful to test the openAPI validations indeed. The setup may be a little heavy for this concrete PR but if the API will grow in complexity we can think of it.
b9932fb
to
c081ccc
Compare
c081ccc
to
e5e259f
Compare
ROSA provisions 4.13.x clusters which don't have |
Thanks for working through these reviews with me. Hopefully CI will sort itself out. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: gcs278 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 |
/test e2e-aws-rosa-operator |
@alebedev87: 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. |
/label docs-approved |
I edited Kevin's comment from /label docs-approved |
/label px-approved |
The ALBO can be created on ROSA STS with secrets created by ccoctl or the AWS CLI. |
/label qe-approved I believe that's what Shudi wanted to say 😉. |
@alebedev87: This pull request references NE-1381 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 story to target the "4.15.0" version, but no target version was set. In response to this:
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. |
Context
According to Tokenized Cloud Auth Enablement For Operators EP CCO can now provision secrets on STS clusters too. However this EP is meant for the operators only, the operands are supposed to be managed via their APIs.
Goal
The goal of this PR is to add a new field for the Role ARN which is supposed to be added to
CredentialsRequest
CR created by the operator for its operand (AWS LoadBalancer Controller).