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

Use kustomize for example manifest #221

Merged

Conversation

nckturner
Copy link
Contributor

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

  • Default to --use-service-account-credentials=true in base manifest.
  • reduce permissions on default manifest for use with --use-service-account-credentials=true.
  • still give a "superset" configuration overlay for when this flag is disabled.
  • disable route controller by default with --configure-cloud-routes=false.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

Use kustomize for manifest installation and reduce role to minimum required permissions when using service account credentials per controller.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 18, 2021
@k8s-ci-robot k8s-ci-robot requested review from justinsb and M00nF1sh May 18, 2021 21:05
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 18, 2021
- update
- watch
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No change, just reordered.

- update
- watch
Copy link
Contributor Author

Choose a reason for hiding this comment

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

No change, just reordered.

- list
- patch
- update
- watch
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The cloud node controllers do not need create node or delete node.

- apiGroups:
- ""
resourceNames:
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Only allow service account creation for the cloud controller resource names.

Comment on lines -62 to -65
- list
- patch
- update
- watch
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think list is possible with subresources, and I'm not sure about watch but we definitely don't do it.

@nckturner
Copy link
Contributor Author

/cc @wongma7 @ayberk

@k8s-ci-robot k8s-ci-robot requested review from ayberk and wongma7 May 18, 2021 22:24
1. Deploy the cloud-controller-manager to your cluster:
`kubectl apply -f https://raw.githubusercontent.com/kubernetes/cloud-provider-aws/master/manifests/aws-cloud-controller-manager-daemonset.yaml`
1. Apply the kustomize configuration:
`kubectl apply -k ./manifests/base`
Copy link
Contributor

Choose a reason for hiding this comment

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

this assumes you cloned it though compared to above ones

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Correct. I thought it was a reasonable to require customers to clone the repo if we end up doing kustomize, but there are ways around it--kustomize supports some kinds of remote builds, i.e: kustomize build "github.com/kubernetes-sigs/kustomize/examples/multibases/dev/?ref=v1.0.6" is given as an example.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Its actually pretty cool, try this: kustomize build 'github.com/nckturner/cloud-provider-aws/manifests/base/?ref=use-kustomize-to-reduce-permissions'. I'll update the build command.

@nckturner nckturner force-pushed the use-kustomize-to-reduce-permissions branch from 786944d to 941cd81 Compare May 20, 2021 06:01
- reduce permissions on default manifest for use
  with --use-service-account-credentials=true
- still give a "superset" configuration overlay
  for when this flag is disabled.
@nckturner nckturner force-pushed the use-kustomize-to-reduce-permissions branch from 941cd81 to 064d63b Compare May 20, 2021 19:57
@wongma7
Copy link
Contributor

wongma7 commented May 20, 2021

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 20, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nckturner, wongma7

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

@k8s-ci-robot k8s-ci-robot merged commit 54f2b5c into kubernetes:master May 20, 2021
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants