Version:
4.5.8
$ openshift-install version
./openshift-install 4.5.8
built from commit 0d5c871ce7d03f3d03ab4371dc39916a5415cf5c
release image quay.io/openshift-release-dev/ocp-release@sha256:ae61753ad8c8a26ed67fa233eea578194600d6c72622edab2516879cfbf019fd
Platform:
aws
- UPI (semi-manual installation on customised infrastructure)
What happened?
Using export $AWS_CONFIG_FILE, $AWS_DEFAULT_PROFILE, $AWS_SDK_LOAD_CONFIG and $AWS_SHARED_CREDENTIALS_FILE env vars to assume role while creating manifest for installation I retrieve:
level=debug msg= Generating Master Ignition Config...
level=debug msg=Generating Master Machines...
level=fatal msg=failed to fetch Master Machines: failed to generate asset "Master Machines": creating AWS session: fetching availability zones: UnauthorizedOperation: You are not authorized to perform this operation.
level=fatal msg= status code: 403, request id: b5cdf37d-bdab-4a01-8d83-ffeb71b5d01e
What you expected to happen?
It works perfectly with a user created in the account with KEy and secret credentials but unfortunatelly we use child accounts in our org and I expected to assume the role specified in the profile, child accounts in aws need to be role based accesed
How to reproduce it (as minimally and precisely as possible)?
simply configure env vars to force the profile and config files and run openshift-install create manifest with an already created install-config.yaml
$ export AWS_CONFIG_FILE=config location
$ export AWS_DEFAULT_PROFILE=desired profile
$ export AWS_SDK_LOAD_CONFIG=1 (to force sdk to gather those values)
$ export AWS_SHARED_CREDENTIALS_FILE= cred file location
$ openshift-install create manifest
$ openshift-install create cluster
Anything else we need to know?
I've been debuging the code and as you can see here https://github.com/Burnerator/installer/tree/aws-role-based-credentials it works to create manifests, however while creating cluster it retrieves the next error in platformpermscheck.go file while calling cloud credential operator package
FATAL failed to fetch Cluster: failed to fetch dependency of "Cluster": failed to generate asset "Platform Permissions Check": validate AWS credentials: checking install permissions: error gathering AWS credentials details: error querying username: ValidationError: Must specify userName when calling with non-User credentials
FATAL status code: 400, request id: 7c5c4dad-e594-4ef3-a456-4e06c82a3f18
basically it fails but now in pkg github.com/openshift/cloud-credential-operator/pkg/aws/utils.go I've been checking it and it uses Get UserID what is valid for non arn role users, for arn roled based user the id needs to be gathered from sts get-caller-identity.
References
https://github.com/openshift/cloud-credential-operator/pkg/aws/utils.go
https://github.com/Burnerator/installer/tree/aws-role-based-credentials
I was able to modify the installer to assume the role and pass the checks, but unfortunatelly cloud-credential-operator is going to be installed just without assumerole support that's why i didn't do the pull request to the installer.
I got an approach that works with CCO and assume role but i think that they are having strong dependency, I've reviewing how to contribute but unfortunatelly i dont see any information about how to create a pull request which depends on other pr for another project. I mean the installer PR will make no sense if the cloud-credential-operator PR is not approved.
Could you please kindly let me know how to proceed?
Thanks inadvance and kind regards
Version:
4.5.8
Platform:
aws
What happened?
Using export $AWS_CONFIG_FILE, $AWS_DEFAULT_PROFILE, $AWS_SDK_LOAD_CONFIG and $AWS_SHARED_CREDENTIALS_FILE env vars to assume role while creating manifest for installation I retrieve:
level=debug msg= Generating Master Ignition Config...
level=debug msg=Generating Master Machines...
level=fatal msg=failed to fetch Master Machines: failed to generate asset "Master Machines": creating AWS session: fetching availability zones: UnauthorizedOperation: You are not authorized to perform this operation.
level=fatal msg= status code: 403, request id: b5cdf37d-bdab-4a01-8d83-ffeb71b5d01e
What you expected to happen?
It works perfectly with a user created in the account with KEy and secret credentials but unfortunatelly we use child accounts in our org and I expected to assume the role specified in the profile, child accounts in aws need to be role based accesed
How to reproduce it (as minimally and precisely as possible)?
simply configure env vars to force the profile and config files and run openshift-install create manifest with an already created install-config.yaml
Anything else we need to know?
I've been debuging the code and as you can see here https://github.com/Burnerator/installer/tree/aws-role-based-credentials it works to create manifests, however while creating cluster it retrieves the next error in platformpermscheck.go file while calling cloud credential operator package
FATAL failed to fetch Cluster: failed to fetch dependency of "Cluster": failed to generate asset "Platform Permissions Check": validate AWS credentials: checking install permissions: error gathering AWS credentials details: error querying username: ValidationError: Must specify userName when calling with non-User credentials
FATAL status code: 400, request id: 7c5c4dad-e594-4ef3-a456-4e06c82a3f18
basically it fails but now in pkg github.com/openshift/cloud-credential-operator/pkg/aws/utils.go I've been checking it and it uses Get UserID what is valid for non arn role users, for arn roled based user the id needs to be gathered from sts get-caller-identity.
References
https://github.com/openshift/cloud-credential-operator/pkg/aws/utils.go
https://github.com/Burnerator/installer/tree/aws-role-based-credentials
I was able to modify the installer to assume the role and pass the checks, but unfortunatelly cloud-credential-operator is going to be installed just without assumerole support that's why i didn't do the pull request to the installer.
I got an approach that works with CCO and assume role but i think that they are having strong dependency, I've reviewing how to contribute but unfortunatelly i dont see any information about how to create a pull request which depends on other pr for another project. I mean the installer PR will make no sense if the cloud-credential-operator PR is not approved.
Could you please kindly let me know how to proceed?
Thanks inadvance and kind regards