Skip to content
This repository was archived by the owner on Dec 21, 2021. It is now read-only.

Adds bootstrapping of certificates and kubeconfig to agent #77

Merged
merged 2 commits into from
Feb 25, 2021

Conversation

soenkeliebau
Copy link
Member

If a bootstrap config is provided via the --bootstrap-file command line option and no valid config can be found in the usual places the agent will attempt to bootstrap a Kubeconfig via the configuration in the bootstrap file.

Additionally this code will check if the provided files from --server-cert-file and --server-key-file exist. If not, it will create a key pair and signing request, upload this to the api-server and wait for the certificate to be provided by a controller.

If a bootstrap config is provided via the --bootstrap-file command line option and no valid config can be found in the usual places the agent will attempt to bootstrap a Kubeconfig via the configuration in the bootstrap file.

Additionally this code will check if the provided files from --server-cert-file and --server-key-file exist. If not, it will create a key pair and signing request, upload this to the apiserver and wait for the certificate to be provided by a controller.
@soenkeliebau soenkeliebau requested a review from a team February 25, 2021 14:41
// Bootstrap a kubernetes config, if no valid config is found
// This also generates certificates for the webserver the krustlet
// runs
let kubeconfig = kubelet::bootstrap(
Copy link
Member

Choose a reason for hiding this comment

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

I looked at the krustlet docs (not code) for this and I can't see the "if no valid config is found" part. Are you sure this is the case?

Copy link
Member Author

Choose a reason for hiding this comment

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

My comment is based on this documentation and my take on what I saw in the code.

Copy link
Member

Choose a reason for hiding this comment

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

Alright, I see. I only looked at the docs

Co-authored-by: Lars Francke <[email protected]>
Copy link
Member

@lfrancke lfrancke left a comment

Choose a reason for hiding this comment

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

I've not tried running it but I assume you did :)

@soenkeliebau soenkeliebau merged commit 8de388e into main Feb 25, 2021
@soenkeliebau soenkeliebau deleted the bootstrap branch February 25, 2021 15:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants