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

Add Ambassador addon to kops #9115

Merged
merged 1 commit into from
Jun 30, 2020

Conversation

concaf
Copy link
Contributor

@concaf concaf commented May 11, 2020

This commit adds Ambassador (https://getambassador.io/) addon to
Kops.

Ambassador is installed via Ambassador Operator which is the
recommended way of installed Ambassador - it makes sure users
always have the latest version of Ambassador installed and takes
care of the update schedule as well.

CC: @brucehorn @inercia

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 11, 2020
@k8s-ci-robot
Copy link
Contributor

Welcome @concaf!

It looks like this is your first PR to kubernetes/kops 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/kops has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 11, 2020
@k8s-ci-robot
Copy link
Contributor

Hi @concaf. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@olemarkus
Copy link
Member

Hi,

Thanks for contributing this. I am curious about how you see the value of installing a single ambassador instance as an addon versus using helm or other install methods.
I support any addon that needs specific configuration of kops, and adds validation logic for that (take nodelocaldns or any CNI for example). But this addon just install basic resources without any configuration options or other forms of kops-specific logic.

Comment on lines 272 to 276
- apiGroups: ['*']
resources: ['*']
verbs: ['*']
- nonResourceURLs: ['*']
verbs: ['*']
Copy link
Member

Choose a reason for hiding this comment

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

This is a bit overly permissive. Could it be tightened up?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could tighten it based on the current resources that the operator installs however the main point of concern is that since this operator uses Helm to install the later Ambassador version and keeps it up to date over time, these permissions will go stale and cause unexpected errors for our users - so we've kept the permissions relaxed intentionally.
There are other operators (specifically which perform upgrades) in the wild which do the same - one example would be https://github.com/fluxcd/helm-operator/blob/157d422bc11f127b1d9a5eba18fc8882c4b9cde9/deploy/rbac.yaml#L10-L21. WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with John, this is pretty permissive. That said, I get that an operator can require widely scoped permissions.

I guess my biggest concern is to whom these permissions are granted. Currently it's a service account in the default namespace. Personally, I consider default a dangerous place for an SA that has global permissions. Maybe moving it to kube-system or another namespace we know exists would reduce some risk here as well? I know we don't want to avoid deviating from your official docs but just throwing out a few ideas.

At minimum, maybe we could document the permissiveness in the readme?

Copy link
Member

Choose a reason for hiding this comment

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

I've been mulling my position on this. I'm having a hard time supporting such carte blanche permissions. They're not even scoped to the namespace that Ambassador would be installed in.

It seems not unreasonable to me that an addition to the functionality of a subsystem, requiring it to have new types of resources, would also require an upgrade to the operator that manages it. I'm presuming the operator provides some functionality to the subsystem beyond just calling Helm and this would be likely to need to be upgraded as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mikesplain @johngmyers I've made a couple of changes as suggested. I've moved operator and Ambassador's installation to kube-system and documented scope of the permissions here - https://github.com/kubernetes/kops/pull/9115/files#diff-b45153696dcf1520ef38065366461babR16-R19. PTAL 👍

@johngmyers
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels May 11, 2020
@brucehorn
Copy link

Ole, thanks for the comment. We had a good discussion about this at the office hours last week. We understand the Helm approach (we use Helm ourselves), but we think that addons have some advantages over just using Helm. When looking for ways to provide new functionality such as ingress to kops, web search lands you right in the project at one of the addon directories, which is good--we want people to land in a useful place. Addons provide a good UX for the end users, with a nice integration process. One of the things that we discussed at the office hours was the fact that some of the addons seem not to have been maintained recently--we addressed that by committing to keeping our Datawire addons up to date, and there will be an effort to recruit maintainers for the existing addons. Finally we committed to follow whatever new directions the kops team takes us to provide extension functionality in the future.

@concaf
Copy link
Contributor Author

concaf commented May 19, 2020

@johngmyers @olemarkus gentle nudge ;) Is there anything I can do to take this forward?

@concaf
Copy link
Contributor Author

concaf commented May 19, 2020

/test pull-kops-e2e-kubernetes-aws

Copy link
Contributor

@mikesplain mikesplain left a comment

Choose a reason for hiding this comment

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

Thanks so much for your contribution! As a current tester of ambassador and glad to see us suggesting it to users. Hopefully we can talk through a few points and get this out soon!

Comment on lines 272 to 276
- apiGroups: ['*']
resources: ['*']
verbs: ['*']
- nonResourceURLs: ['*']
verbs: ['*']
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree with John, this is pretty permissive. That said, I get that an operator can require widely scoped permissions.

I guess my biggest concern is to whom these permissions are granted. Currently it's a service account in the default namespace. Personally, I consider default a dangerous place for an SA that has global permissions. Maybe moving it to kube-system or another namespace we know exists would reduce some risk here as well? I know we don't want to avoid deviating from your official docs but just throwing out a few ideas.

At minimum, maybe we could document the permissiveness in the readme?

@concaf concaf force-pushed the concaf/addons/get-ambassador branch from f530121 to 6412c5d Compare June 8, 2020 20:15
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jun 8, 2020
Copy link
Contributor Author

@concaf concaf left a comment

Choose a reason for hiding this comment

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

@mikesplain @johngmyers sorry to keep this PR hanging, I got busy with some other stuff.
As suggested (and as I've mentioned in other review comments), I've documented the permissions scope in the docs and moved the installation from default namespace to kube-system. Let me know if you want further tweaking on this 👍

@inercia
Copy link

inercia commented Jun 16, 2020

/assign @rdrgmnzs

@concaf
Copy link
Contributor Author

concaf commented Jun 23, 2020

Hey @rdrgmnzs @johngmyers @olemarkus @mikesplain, gentle nudge ;) Anything I can do to take this forward?

@olemarkus
Copy link
Member

I am a bit sceptical to installing this to kube-system. default seems to be the better place even though it is not ideal either.

@concaf
Copy link
Contributor Author

concaf commented Jun 23, 2020

@olemarkus I changed the namespace to kube-system per suggestions by @mikesplain, see - #9115 (comment)

Maybe moving it to kube-system or another namespace we know exists would reduce some risk here as well?

Would you rather have it in default, or should I create another namespace called ambassador and install it there?

@olemarkus
Copy link
Member

/assign @mikesplain
I think Mike is better able to answer this than me.

@mikesplain
Copy link
Contributor

First of all, thanks for sticking with us on this one @concaf.

@olemarkus brings up a good point. Historically pretty much everything Kops managed has lived in kube-system but that doesn't meant it's a good practice. That said, it looks like at least ingress-nginx utilizes it's own namespace so we should probably do that instead. I apologize for the advice, I wasn't sure what the right answer was at the time and was trying to pose it as suggestion.

Can we move it to an ambassador namespace? Either ambassador or ambassador-operator? I assume the first makes the most sense but I leave that up to you. Baring that, consider this LGTMed and ready for approval on my end. Feel free to ping me when that change is done and I'll approve asap!

@concaf concaf force-pushed the concaf/addons/get-ambassador branch from 6412c5d to 3dda633 Compare June 26, 2020 03:23
@concaf
Copy link
Contributor Author

concaf commented Jun 26, 2020

@mikesplain yeah, makes sense. Default installation instructions for Ambassador deploy it to the ambassador namespace as well.
I've pushed a commit that make this change. PTAL, thanks! :)

@concaf
Copy link
Contributor Author

concaf commented Jun 30, 2020

@mikesplain gentle nudge ;)

@mikesplain
Copy link
Contributor

Ahh yes thanks @concaf! This looks good, do you mind squashing into a single commit? I'll approve ASAP once that's done. Thank you so much!

This commit adds Ambassador (https://getambassador.io/) addon to
Kops.

Ambassador is installed via Ambassador Operator which is the
recommended way of installed Ambassador - it makes sure users
always have the latest version of Ambassador installed and takes
care of the update schedule as well.

Signed-off-by: Shubham <shubham@linux.com>
@concaf concaf force-pushed the concaf/addons/get-ambassador branch from 3dda633 to 4ea73a4 Compare June 30, 2020 15:07
@concaf
Copy link
Contributor Author

concaf commented Jun 30, 2020

@mikesplain sure thing. I've rebased against master and folded everything in one commit. PTAL :) Thanks for sticking and helping with this.

@mikesplain
Copy link
Contributor

Thanks @concaf for the contribution!

/lgtm
/approve

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: concaf, mikesplain

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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 30, 2020
@k8s-ci-robot k8s-ci-robot merged commit ebdeb44 into kubernetes:master Jun 30, 2020
@k8s-ci-robot k8s-ci-robot added this to the v1.19 milestone Jun 30, 2020
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. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants