Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

[stable/aws-pod-identity-webhook] Adding chart for AWS' new EKS Pod Identity Webhook #17099

Closed
wants to merge 6 commits into from
Closed

[stable/aws-pod-identity-webhook] Adding chart for AWS' new EKS Pod Identity Webhook #17099

wants to merge 6 commits into from

Conversation

max-rocket-internet
Copy link
Contributor

@max-rocket-internet max-rocket-internet commented Sep 12, 2019

What this PR does / why we need it:

This chart will install the Amazon EKS Pod Identity Webhook. This tool allows you to specify IAM Roles for Kubernetes Service Accounts. This allows a pod to assume a IAM role.

Further details can be found here: https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts-technical-overview.html

Related issues:

Checklist

[Place an '[x]' (no spaces) in all applicable fields. Please remove unrelated fields.]

  • DCO signed
  • Chart Version bumped
  • Variables are documented in the README.md
  • Title of the PR starts with chart name (e.g. [stable/chart])

Signed-off-by: Max Williams <max.williams@deliveryhero.com>
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: max-rocket-internet
To complete the pull request process, please assign jlegrone
You can assign the PR to them by writing /assign @jlegrone in a comment when ready.

The full list of commands accepted by this bot can be found 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

@helm-bot helm-bot added the Contribution Allowed If the contributor has signed the DCO or the CNCF CLA (prior to the move to a DCO). label Sep 12, 2019
@helm-bot helm-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 12, 2019
@k8s-ci-robot
Copy link
Contributor

Hi @max-rocket-internet. Thanks for your PR.

I'm waiting for a helm 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.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. do-not-merge/invalid-owners-file Indicates that a PR should not merge because it has an invalid OWNERS file in it. labels Sep 12, 2019
Signed-off-by: Max Williams <max.williams@deliveryhero.com>
Signed-off-by: Max Williams <max.williams@deliveryhero.com>
@micahhausler
Copy link
Contributor

I'll review this PR later today, but for the record I'm happy to be a maintainer/OWNER and join the helm GitHub org. Looks like membership isn't yet automated

@nckturner
Copy link
Collaborator

Also happy to be maintainer/member of the helm org.

@jqmichael
Copy link

Thanks for the PR!
Happy to be the maintainer/member of the helm org.

Copy link
Contributor

@micahhausler micahhausler left a comment

Choose a reason for hiding this comment

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

This is a great start! Thanks for the PR

{{- end }}
serviceAccountName: {{ include "aws-pod-identity-webhook.fullname" . }}
containers:
- name: {{ .Chart.Name }}
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the container name can probably be a stable name. Any objections?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This name is stable, it's the name of the chart, i.e. aws-pod-identity-webhook. But I agree with you, I would rather simply app or something else totally generic but this is the default name that comes from helm create. I've had objections in other PRs where things deviated from these defaults. Up to you, just say what you want it to be.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd lean toward something stable, that way you could compare apples to apples when looking at Prometheus metrics by container name

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK, I'll make it webhook. Cool?

- --in-cluster
- --namespace=default
- --service-name={{ include "aws-pod-identity-webhook.fullname" . }}
- --tls-secret=pod-identity-webhook
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you make this a configurable value that defaults to pod-identity-webhook?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Would it be better to use {{ include "aws-pod-identity-webhook.fullname" . }} though? Would this ever been installed multiple times in the same cluster?

command:
- /webhook
- --in-cluster
- --namespace=default
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be the release namespace

- --namespace=default
- --service-name={{ include "aws-pod-identity-webhook.fullname" . }}
- --tls-secret=pod-identity-webhook
- --annotation-prefix=eks.amazonaws.com
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be configurable in the values

- --service-name={{ include "aws-pod-identity-webhook.fullname" . }}
- --tls-secret=pod-identity-webhook
- --annotation-prefix=eks.amazonaws.com
- --token-audience=sts.amazonaws.com
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be configurable in the values

labels:
{{ include "aws-pod-identity-webhook.labels" . | indent 4 }}
spec:
replicas: 1
Copy link
Contributor

Choose a reason for hiding this comment

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

We should set the default replicas to 2 for HA and make this tunable in the values

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cool. I wasn't sure if it stored stateful information or not so wasn't sure if we could run more than 1 pod.

I've set it to 3 like CoreDNS. OK?

metadata:
labels:
app.kubernetes.io/name: {{ include "aws-pod-identity-webhook.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
Copy link
Contributor

Choose a reason for hiding this comment

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

The {{ include "aws-pod-identity-webhook.labels" . | indent 4 }} should also be added

Copy link
Contributor Author

Choose a reason for hiding this comment

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

helm create doesn't add this here. Are you sure?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm surprised this isn't the default. I'm take it or leave it on adding it here

- update
- patch
resourceNames:
- "{{ include "aws-pod-identity-webhook.fullname" . }}"
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be the same value as the --tls-secret flag on the webhook

$ helm install --name my-release stable/aws-pod-identity-webhook --set caBundle="${CA_BUNDLE}"
```

After installation you need to approve the certificate. Follow the chart notes after installation for this step.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you note that the webhook will request a new CSR prior to its expiry in 1 year, and it will need to be approved either by an operator or by some other automated process?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cool. I added a note.

Would be great to have something better here in the chart itself. Perhaps a cronjob. Or something in the webhook itself?

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd lean toward a cronjob that can only approve rather than something in the webhook. Its pretty scary to grant something the ability to create and approve certs

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'd lean toward a cronjob that can only approve

Makes sense. I'll leave this for a later PR though.


## Prerequisites

- Kubernetes 1.13+
Copy link
Contributor

Choose a reason for hiding this comment

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

Technically this works with 1.12+. It might also be worth saying that if you're not using EKS, you will need your cluster configured according to the SELF_HOSTED_SETUP.md

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nice. Added.

@helm-bot helm-bot removed the Contribution Allowed If the contributor has signed the DCO or the CNCF CLA (prior to the move to a DCO). label Sep 13, 2019
- fix namespace in command
- add options for annotation_prefix / token_audience
- updating doc and note about k8s version
- fix quote
- fix indentation
- fix resourcename in role
- add note about CSR expiry

Signed-off-by: Max Williams <max.williams@deliveryhero.com>
@helm-bot helm-bot added the Contribution Allowed If the contributor has signed the DCO or the CNCF CLA (prior to the move to a DCO). label Sep 13, 2019
@max-rocket-internet
Copy link
Contributor Author

@lachie83, @unguiculus, @cpanato or @maorfr: these cats from AWS (@jqmichael, @nckturner, @micahhausler) want to be owners/maintainers of this chart. What's the process here? Can you add them to the Helm github org?

@cpanato
Copy link
Member

cpanato commented Sep 13, 2019

@max-rocket-internet they need to follow this: https://github.com/helm/charts#trusted-collaborator

@max-rocket-internet
Copy link
Contributor Author

/verify-owners

@maorfr
Copy link
Member

maorfr commented Sep 15, 2019

/ok-to-test
/verify-owners

@k8s-ci-robot k8s-ci-robot added ok-to-test and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 15, 2019
home: https://github.com/aws/amazon-eks-pod-identity-webhook
sources:
- https://github.com/aws/amazon-eks-pod-identity-webhook
maintainers:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you add me as well here?

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 had you there in the beginning but read the message here: #17099 (comment)

So I think we just have @micahhausler there for now as they are already a member of the kubernetes org.

And then you guys can create a PR later to add yourself when you become a trusted-collaborator

Signed-off-by: Max Williams <max.williams@deliveryhero.com>
@max-rocket-internet
Copy link
Contributor Author

@micahhausler the pull-charts-e2e test is failing because of aws/amazon-eks-pod-identity-webhook#5

@max-rocket-internet
Copy link
Contributor Author

@cpanato

If we want to merge this sooner rather than later, and sort the org membership thing in the future, how do we remove this do-not-merge/invalid-owners-file label? Just delete OWNERS? Then who can be in Chart.yaml as maintainer? Anyone?

@yorinasub17
Copy link

yorinasub17 commented Sep 17, 2019

Thanks for getting this in place so fast! I certainly don't want to delay this chart from being added, but I do have a small feature request: would it be possible to make the RBAC resources optional and have the service account passed in? E.g the external-dns chart has an input value rbac.create which controls whether or not to create the RBAC roles and rbac.serviceAccountName to set the service account on the pod.

Use case: We are still using Helm 2 with Tiller and our Tiller does not have the permissions to create RBAC resources. We rely on a separate system to create the RBAC roles/service accounts which we then pass into the charts.

EDITED: I can also wait until this version is merged, and open the PR afterwards. Also happy to open a PR against your fork, assuming it might take more time before this PR is ready.

@max-rocket-internet
Copy link
Contributor Author

EDITED: I can also wait until this version is merged, and open the PR afterwards

I think we get this merged first, then make changes like you mention. The process for merging PRs after a chart has been added can be quite fast 🙂

@@ -0,0 +1,24 @@
tls_secret_name: pod-identity-webhook
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you document these added fields in the REAME?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yes, I forgot to add these.

Signed-off-by: Max Williams <max.williams@deliveryhero.com>
@k8s-ci-robot
Copy link
Contributor

The following users are mentioned in OWNERS file(s) but are not members of the helm org.

Once all users have been added as members of the org, you can trigger verification by writing /verify-owners in a comment.

  • micahhausler
    • stable/aws-pod-identity-webhook/OWNERS

@max-rocket-internet
Copy link
Contributor Author

@micahhausler still waiting on a docker image to be available 😄

@k8s-ci-robot
Copy link
Contributor

@max-rocket-internet: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-charts-e2e 233a1c0 link /test pull-charts-e2e

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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.

@stale
Copy link

stale bot commented Oct 25, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any further update will cause the issue/pull request to no longer be considered stale. Thank you for your contributions.

@stale stale bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 25, 2019
@max-rocket-internet
Copy link
Contributor Author

@micahhausler any update here?

Waiting on you or someone in your team to:

  1. Join the Helm org
  2. Make docker images public

@stale stale bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 25, 2019
@nckturner
Copy link
Collaborator

@max-rocket-internet I can take a look at the images. Also, I believe I was added to trusted collaborators in #17126, if you can add me to maintainer of this chart.

Join the Helm org

Can you explain a little more--do you mean someone needs to join the helm github organization? The one I see doesn't have very many people in it.

@max-rocket-internet
Copy link
Contributor Author

I can take a look at the images

Nice! The e2e job will fail until this is resolved.

Also, I believe I was added to trusted collaborators

🎉

Can you explain a little more--do you mean someone needs to join the helm

It's just in reference so this comment by k8s-ci-robot

@max-rocket-internet
Copy link
Contributor Author

Or we move this PR to https://github.com/aws/eks-charts ?

@nckturner
Copy link
Collaborator

nckturner commented Oct 29, 2019 via email

@max-rocket-internet
Copy link
Contributor Author

OK cool. Please review my new PR: aws/eks-charts#28

@max-rocket-internet max-rocket-internet deleted the aws-pod-identity-webhook branch October 30, 2019 17:14
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Contribution Allowed If the contributor has signed the DCO or the CNCF CLA (prior to the move to a DCO). do-not-merge/invalid-owners-file Indicates that a PR should not merge because it has an invalid OWNERS file in it. ok-to-test 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.

None yet

9 participants