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

Setup heptio authenticator #5197

Merged
merged 3 commits into from
Jun 1, 2018

Conversation

rdrgmnzs
Copy link
Contributor

This automates most of the process of setting up heptio authenticator using Kops.

https://github.com/heptio/authenticator

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels May 24, 2018
@rdrgmnzs
Copy link
Contributor Author

rdrgmnzs commented May 24, 2018

/assign @justinsb @chrislovecnm @rifelpet

@rifelpet adding you since you created the kops docs in the heptio authenticator repo.
kubernetes-sigs/aws-iam-authenticator#45

Copy link
Contributor

@gambol99 gambol99 left a comment

Choose a reason for hiding this comment

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

Left just the two comments .. the rest looks fine to me

@@ -157,6 +157,103 @@ func (b *KubeAPIServerBuilder) writeAuthenticationConfig(c *fi.ModelBuilderConte
return nil
}

if b.Cluster.Spec.Authentication.Heptio != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps left to another PR, but should consider merging the kopeio and this together given both is essentially just a web hook with a url diff ..

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will create another PR to merge / cleanup.


c.AddTask(&nodetasks.File{
Path: "/srv/kubernetes/heptio-authenticator-aws/key.pem",
Contents: fi.NewBytesResource(keyData),
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 add file perms to 0600 please Mode: fi.String("600") .. as the default is world readable

Copy link
Member

Choose a reason for hiding this comment

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

These are the perms that I think are still missing @rdrgmnzs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@justinsb yeah I actually added them on diff f047677 and github says they have been pulled in to this PR but for some reason they are not showing up in the "files changed"

Copy link
Member

Choose a reason for hiding this comment

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

I don't think you added it to this task (key.pem( - I do see it for the other two file tasks though.


```
---
apiVersion: v1
Copy link
Contributor

@gambol99 gambol99 May 29, 2018

Choose a reason for hiding this comment

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

What happen's if the config isn't there? .. does it's just crashloop the pods? ... Just wondering in case it effects rollouts .. i'm pretty sure the validate cluster code looks for pod restarts in kube-system ..

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 pod will sit in a creating status. I have not tired doing a rollout while it's in this state, but will do so.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ar yes! .. it would be stuck in pending .. Still if you can quickly verify / confirm it handles on a pre-built cluster and can rollout, that would be cool

Copy link
Contributor Author

@rdrgmnzs rdrgmnzs Jun 1, 2018

Choose a reason for hiding this comment

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

The pod stays in state:
kube-system heptio-authenticator-aws-4fkzp 0/1 ContainerCreating 0 10m

with the error:
Unable to mount volumes for pod "heptio-authenticator-aws-4fkzp_kube-system(93f46fcb-654e-11e8-a014-0e21d0512306)": timeout expired waiting for volumes to attach or mount for pod "kube-system"/"heptio-authenticator-aws-4fkzp". list of unmounted volumes=[config]. list of unattached volumes=[config output state default-token-6rtmz]

However I'm still able to perform a full cluster rolling update while the cluster is in this state so we should be ok.

Copy link
Contributor

Choose a reason for hiding this comment

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

much appreciated 👍

@gambol99
Copy link
Contributor

hi @rdrgmnzs .. were you able to check a rollout on a existing cluster? ... also, can we add the filemode on the key ... other than those its LGTM

@rdrgmnzs
Copy link
Contributor Author

Hey @gambol99 I won’t be able to test and make changes until Monday unfortunately. I’m out on vacation and don’t have my laptop with me.

@rdrgmnzs
Copy link
Contributor Author

rdrgmnzs commented Jun 1, 2018

@gambol99 updated the perms and tested. (Jet lagged and borrowed a PC )

@justinsb
Copy link
Member

justinsb commented Jun 1, 2018

Generally LGTM. The file perms that @gambol99 pointed out seems to be the only thing missing.

Because it's additive and opt-in, I'm happy to merge even if it's still in flux..

@rdrgmnzs
Copy link
Contributor Author

rdrgmnzs commented Jun 1, 2018

I added the file perms on diff f047677 and github says they have been pulled in to this PR but for some reason they are not showing up in the "files changed".

@gambol99
Copy link
Contributor

gambol99 commented Jun 1, 2018

hi @rdrgmnzs ...sorry, i meant file perms the private here as f047677 only appears to add on the manifest and cert

@gambol99
Copy link
Contributor

gambol99 commented Jun 1, 2018

/approve
/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gambol99, rdrgmnzs

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 1, 2018
@rifelpet
Copy link
Member

rifelpet commented Jun 1, 2018

fwiw this LGTM too. Thanks for adding this! We'll be able to simplify the instructions on the Authenticator readme and even the AWS blog post if that's allowed. cc @christopherhein

@k8s-ci-robot k8s-ci-robot merged commit 775b877 into kubernetes:master Jun 1, 2018
@christopherhein
Copy link
Member

Nice work @rdrgmnzs ! thanks for invalidating the blog post 👍Happy to have this merged in.

@rifelpet
Copy link
Member

@rdrgmnzs FYI It appears they're renaming the authenticator as they bring it into the kubernetes-sigs org. Given that this hasnt been in a stable release yet do you think we should update this to match?

@rdrgmnzs rdrgmnzs deleted the heptio_authenticator branch August 9, 2019 21:56
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. 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.

7 participants