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

Unattended Flux installation by automated deploy key management #2273

Closed
mumoshu opened this issue May 30, 2020 · 1 comment · Fixed by #2274
Closed

Unattended Flux installation by automated deploy key management #2273

mumoshu opened this issue May 30, 2020 · 1 comment · Fixed by #2274
Labels
kind/feature New feature or request

Comments

@mumoshu
Copy link
Contributor

mumoshu commented May 30, 2020

Why do you want this feature?

As of today, eksctl create cluster and eksctl enable repo can setup a GitOps config repo and install Flux manifests into the cluster automatically. But you still need to manually register a deploy key emitted by eksctl to e.g. GitHub to allow the installed Flux to successfully pull manifests from the config repo. This manual step prevents me from fully automating cluster creation.

What feature/behavior/change do you want?

Given that GitHub has a dedicated API for creating and deleting deploy keys, there can be two options.

  1. Enhance eksctl to allow exporting the public key generated by Flux on eksctl create cluster and eksctl enable repo, so that we can possibly use external tool(s) to create a deploy key from the exported flux ssh public key.

  2. Enhance eksctl to create the deploy key on your behalf.

I believe the latter is nicer for U/X.

@mumoshu mumoshu added the kind/feature New feature or request label May 30, 2020
@mumoshu mumoshu changed the title Automated deploy key management Unattended flux installation by automated deploy key management May 30, 2020
@mumoshu mumoshu changed the title Unattended flux installation by automated deploy key management Unattended Flux installation by automated deploy key management May 30, 2020
mumoshu added a commit to mumoshu/eksctl that referenced this issue May 30, 2020
You don't need to manually add GitHub deploy keys anymore.

This feature enables you to install Flux via eksctl in an unattended way, by automatically creating GitHub deply key on cluster creation and on `eksctl enable repo`, and by automatically deleting the deploy key on cluster deletion.

All you need to use this feature is providing `GITHUB_TOKEN` that has access to your repository's deploy keys, and a standard cluster.yaml that contains a `git` configuration for installing Flux.

Usage:

```
$ eksctl create cluster -f cluster.yaml

eksctl automatically creates a deploy key named  `eksctl-REGION-NAME` from the public ssh key generated by Flux
```

```
$ eksctl delete cluster -f cluster.yaml

eksctl automatically deletes the deploy key named `eksctl-REGION-NAME` by calling GitHub API
```

```
$ eksctl enable repo -f cluster.yaml

eksctl automatically creates a deploy key named  `eksctl-REGION-NAME` from the public ssh key generated by Flux
```

Resolves eksctl-io#2273
mumoshu added a commit to mumoshu/eksctl that referenced this issue May 30, 2020
You don't need to manually add GitHub deploy keys anymore.

This feature enables you to install Flux via eksctl in an unattended way, by automatically creating GitHub deply key on cluster creation and on `eksctl enable repo`, and by automatically deleting the deploy key on cluster deletion.

All you need to use this feature is providing `GITHUB_TOKEN` that has access to your repository's deploy keys, and a standard cluster.yaml that contains a `git` configuration for installing Flux.

Usage:

```
$ eksctl create cluster -f cluster.yaml

eksctl automatically creates a deploy key named  `eksctl-REGION-NAME` from the public ssh key generated by Flux
```

```
$ eksctl delete cluster -f cluster.yaml

eksctl automatically deletes the deploy key named `eksctl-REGION-NAME` by calling GitHub API
```

```
$ eksctl enable repo -f cluster.yaml

eksctl automatically creates a deploy key named  `eksctl-REGION-NAME` from the public ssh key generated by Flux
```

Please also note that this feature has an extra ability to make the deploy key "read-only". With the read-only deploy key, If you prefer that, you can effectively block Flux from ever pushing commits to the repository.

This can be enabled by setting `git.readOnly` to `true` or passing `--readonly` to `eksctl enable repo`.

Resolves eksctl-io#2273
mumoshu added a commit to mumoshu/eksctl that referenced this issue May 30, 2020
You don't need to manually add GitHub deploy keys anymore.

This feature enables you to install Flux via eksctl in an unattended way, by automatically creating GitHub deply key on cluster creation and on `eksctl enable repo`, and by automatically deleting the deploy key on cluster deletion.

All you need to use this feature is providing `GITHUB_TOKEN` that has access to your repository's deploy keys, and a standard cluster.yaml that contains a `git` configuration for installing Flux.

Usage:

```
$ eksctl create cluster -f cluster.yaml

eksctl automatically creates a deploy key named  `eksctl-REGION-NAME` from the public ssh key generated by Flux
```

```
$ eksctl delete cluster -f cluster.yaml

eksctl automatically deletes the deploy key named `eksctl-REGION-NAME` by calling GitHub API
```

```
$ eksctl enable repo -f cluster.yaml

eksctl automatically creates a deploy key named  `eksctl-REGION-NAME` from the public ssh key generated by Flux
```

Please also note that this feature has an extra ability to make the deploy key "read-only". With the read-only deploy key, If you prefer that, you can effectively block Flux from ever pushing commits to the repository.

This can be enabled by setting `git.readOnly` to `true` or passing `--readonly` to `eksctl enable repo`.

Resolves eksctl-io#2273
@mumoshu
Copy link
Contributor Author

mumoshu commented May 30, 2020

I'm considering this in the context of #462 and #19. There shouldn't be any manual steps required after cluster creation. Otherwise, the ideal eksctl apply experience can't be achieved.

mumoshu added a commit to mumoshu/eksctl that referenced this issue May 30, 2020
You don't need to manually add GitHub deploy keys anymore.

This feature enables you to install Flux via eksctl in an unattended way, by automatically creating GitHub deply key on cluster creation and on `eksctl enable repo`, and by automatically deleting the deploy key on cluster deletion.

All you need to use this feature is providing `GITHUB_TOKEN` that has access to your repository's deploy keys, and a standard cluster.yaml that contains a `git` configuration for installing Flux.

Usage:

```
$ eksctl create cluster -f cluster.yaml

eksctl automatically creates a deploy key named  `eksctl-REGION-NAME` from the public ssh key generated by Flux
```

```
$ eksctl delete cluster -f cluster.yaml

eksctl automatically deletes the deploy key named `eksctl-REGION-NAME` by calling GitHub API
```

```
$ eksctl enable repo -f cluster.yaml

eksctl automatically creates a deploy key named  `eksctl-REGION-NAME` from the public ssh key generated by Flux
```

Please also note that this feature has an extra ability to make the deploy key "read-only". With the read-only deploy key, If you prefer that, you can effectively block Flux from ever pushing commits to the repository.

This can be enabled by setting `git.readOnly` to `true` or passing `--readonly` to `eksctl enable repo`.

Resolves eksctl-io#2273
mumoshu added a commit to mumoshu/eksctl that referenced this issue Jun 4, 2020
You don't need to manually add GitHub deploy keys anymore.

This feature enables you to install Flux via eksctl in an unattended way, by automatically creating GitHub deply key on cluster creation and on `eksctl enable repo`, and by automatically deleting the deploy key on cluster deletion.

All you need to use this feature is providing `GITHUB_TOKEN` that has access to your repository's deploy keys, and a standard cluster.yaml that contains a `git` configuration for installing Flux.

Usage:

```
$ eksctl create cluster -f cluster.yaml

eksctl automatically creates a deploy key named  `eksctl-REGION-NAME` from the public ssh key generated by Flux
```

```
$ eksctl delete cluster -f cluster.yaml

eksctl automatically deletes the deploy key named `eksctl-REGION-NAME` by calling GitHub API
```

```
$ eksctl enable repo -f cluster.yaml

eksctl automatically creates a deploy key named  `eksctl-REGION-NAME` from the public ssh key generated by Flux
```

Please also note that this feature has an extra ability to make the deploy key "read-only". With the read-only deploy key, If you prefer that, you can effectively block Flux from ever pushing commits to the repository.

This can be enabled by setting `git.readOnly` to `true` or passing `--readonly` to `eksctl enable repo`.

Resolves eksctl-io#2273
martina-if pushed a commit that referenced this issue Jun 4, 2020
…deploy key) (#2274)

Unattended Flux installation (automatic addition of deploy key)

You don't need to manually add GitHub deploy keys anymore.

This feature enables you to install Flux via eksctl in an unattended way, by automatically creating GitHub deply key on cluster creation and on `eksctl enable repo`, and by automatically deleting the deploy key on cluster deletion.

All you need to use this feature is providing `GITHUB_TOKEN` that has access to your repository's deploy keys, and a standard cluster.yaml that contains a `git` configuration for installing Flux.

Usage:

```
$ eksctl create cluster -f cluster.yaml

eksctl automatically creates a deploy key named  `eksctl-REGION-NAME` from the public ssh key generated by Flux
```

```
$ eksctl delete cluster -f cluster.yaml

eksctl automatically deletes the deploy key named `eksctl-REGION-NAME` by calling GitHub API
```

```
$ eksctl enable repo -f cluster.yaml

eksctl automatically creates a deploy key named  `eksctl-REGION-NAME` from the public ssh key generated by Flux
```

Please also note that this feature has an extra ability to make the deploy key "read-only". With the read-only deploy key, If you prefer that, you can effectively block Flux from ever pushing commits to the repository.

This can be enabled by setting `git.readOnly` to `true` or passing `--readonly` to `eksctl enable repo`.

Resolves #2273
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant