-
Notifications
You must be signed in to change notification settings - Fork 86
DNM: [wip] Use CCO credentials for CCM via CredentialsRequest #495
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| apiVersion: cloudcredential.openshift.io/v1 | ||
| kind: CredentialsRequest | ||
| metadata: | ||
| name: openshift-aws-cloud-controller-manager | ||
| namespace: openshift-cloud-credential-operator | ||
| annotations: | ||
| capability.openshift.io/name: CloudCredential+CloudControllerManager | ||
| include.release.openshift.io/self-managed-high-availability: "true" | ||
| include.release.openshift.io/single-node-developer: "true" | ||
| spec: | ||
| serviceAccountNames: | ||
| - cloud-controller-manager | ||
| secretRef: | ||
| name: cloud-controller-manager-credentials | ||
| namespace: openshift-cloud-controller-manager | ||
| cloudTokenPath: /var/run/secrets/openshift/serviceaccount/token | ||
| providerSpec: | ||
| apiVersion: cloudcredential.openshift.io/v1 | ||
| kind: AWSProviderSpec | ||
| stsIAMRoleARN: "" | ||
| statementEntries: | ||
| - effect: Allow | ||
| action: | ||
| # Node lifecycle | ||
| - ec2:Describe* | ||
| - ec2:CreateSecurityGroup | ||
| - ec2:CreateTags | ||
| - ec2:DeleteSecurityGroup | ||
| - ec2:AuthorizeSecurityGroupIngress | ||
| - ec2:RevokeSecurityGroupIngress | ||
| - ec2:ModifyInstanceAttribute | ||
| # Volume management | ||
| - ec2:AttachVolume | ||
| - ec2:CreateVolume | ||
| - ec2:DeleteVolume | ||
| - ec2:DetachVolume | ||
| - ec2:ModifyVolume | ||
| - kms:DescribeKey | ||
| # Load balancer management (CLB) | ||
| - elasticloadbalancing:AddTags | ||
| - elasticloadbalancing:AttachLoadBalancerToSubnets | ||
| - elasticloadbalancing:ApplySecurityGroupsToLoadBalancer | ||
| - elasticloadbalancing:CreateLoadBalancer | ||
| - elasticloadbalancing:CreateLoadBalancerPolicy | ||
| - elasticloadbalancing:CreateLoadBalancerListeners | ||
| - elasticloadbalancing:ConfigureHealthCheck | ||
| - elasticloadbalancing:DeleteLoadBalancer | ||
| - elasticloadbalancing:DeleteLoadBalancerListeners | ||
| - elasticloadbalancing:DeregisterInstancesFromLoadBalancer | ||
| - elasticloadbalancing:Describe* | ||
| - elasticloadbalancing:DetachLoadBalancerFromSubnets | ||
| - elasticloadbalancing:ModifyLoadBalancerAttributes | ||
| - elasticloadbalancing:RegisterInstancesWithLoadBalancer | ||
| - elasticloadbalancing:SetLoadBalancerPoliciesForBackendServer | ||
| - elasticloadbalancing:SetLoadBalancerPoliciesOfListener | ||
| # Load balancer management (NLB/ALB) | ||
| - elasticloadbalancing:CreateListener | ||
| - elasticloadbalancing:CreateTargetGroup | ||
| - elasticloadbalancing:DeleteListener | ||
| - elasticloadbalancing:DeleteTargetGroup | ||
| - elasticloadbalancing:DeregisterTargets | ||
| - elasticloadbalancing:ModifyListener | ||
| - elasticloadbalancing:ModifyTargetGroup | ||
| - elasticloadbalancing:ModifyTargetGroupAttributes | ||
| - elasticloadbalancing:RegisterTargets | ||
| # BYO Security Group for NLB | ||
| - elasticloadbalancing:SetSecurityGroups | ||
| resource: "*" | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -54,6 +54,8 @@ spec: | |
| env: | ||
| - name: CLOUD_CONFIG | ||
| value: /etc/kubernetes-cloud-config/cloud.conf | ||
| - name: AWS_SHARED_CREDENTIALS_FILE | ||
| value: /etc/aws-credentials/credentials | ||
|
Comment on lines
+57
to
+58
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This variable is read automatically by the AWS SDK and takes precedence over master node IAM credentials retrieved via IMDS. |
||
| image: {{ .images.CloudControllerManager }} | ||
| imagePullPolicy: IfNotPresent | ||
| name: cloud-controller-manager | ||
|
|
@@ -76,6 +78,12 @@ spec: | |
| - name: trusted-ca | ||
| mountPath: /etc/pki/ca-trust/extracted/pem | ||
| readOnly: true | ||
| - name: aws-credentials | ||
| mountPath: /etc/aws-credentials | ||
| readOnly: true | ||
| - name: bound-sa-token | ||
| mountPath: /var/run/secrets/openshift/serviceaccount | ||
| readOnly: true | ||
| hostNetwork: true | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I left this one but maybe can it be dropped? Not sure if CCM needs the hostNetwork for something other than IMDS calls which should become obsolete with this PR. Asking for feedback on this one. |
||
| nodeSelector: | ||
| node-role.kubernetes.io/master: "" | ||
|
|
@@ -123,3 +131,12 @@ spec: | |
| hostPath: | ||
| path: /etc/kubernetes | ||
| type: Directory | ||
| - name: aws-credentials | ||
| secret: | ||
| secretName: cloud-controller-manager-credentials | ||
| - name: bound-sa-token | ||
| projected: | ||
| sources: | ||
| - serviceAccountToken: | ||
| path: token | ||
| audience: sts.amazonaws.com | ||
Uh oh!
There was an error while loading. Please reload this page.
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.
Volume mgmt perms are ported from master node IAM role in latest rev since they were also listed in the upstream AWS CCM docs, but it is likely that these permissions are actually unused by OpenShift CCM. A permission cleanup is out of scope for this PR for now.