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

[Feature] Registry for v4 & Restructure Cluster Creation #334

Merged
merged 79 commits into from
Dec 9, 2020

Conversation

iwilltry42
Copy link
Member

@iwilltry42 iwilltry42 commented Aug 13, 2020

Overview

First Level

Second Level

  • use an existing registry: k3d cluster create --registry-use REGISTRY_NAME
  • create a new registry for use with a new cluster: k3d cluster create --registry-create
    • all default settings: for detailed settings use k3d registry create REGISTRY_NAME and k3d cluster create --registry-use REGISTRY_NAME

Important Notes

  • we need to keep track of the clusters using a registry, so that we can update the respective registries.yaml files when creating/starting/stopping/deleting a registry

Status

  • draft of first level k3d registry command

Old PR: #283 (old syntax, closed in favor of this new PR)

FYI @inercia

Dependencies

Depends on #351 (rebased 03.12.2020)

❗ Additional Changes ❗

While working on this PR, some changes had to be made, which affect the overall architecture/structure/workflow:

  • BREAKING: Split ClusterCreate into decoupled steps, orchestrated by ClusterRun:
    • ClusterPrep: build supporting infrastructure (like the network and volumes)
    • ClusterCreate: create the node containers (but not start them yet)
    • ClusterConfigure: do some offline configuration (like writing the registries.yaml)
    • ClusterStart: actually start the node containers (and auxiliary containers)
  • BREAKING: rename pkg/cluster to pkg/client to improve consistent naming and reduce stuttering (like cluster.ClusterGet)
  • Golang 1.15
  • BREAKING: flag syntax noun-action
    • k3d cluster create --kubeconfig-switch-context --kubeconfig-update-default

@iwilltry42 iwilltry42 added the enhancement New feature or request label Aug 13, 2020
@iwilltry42 iwilltry42 added this to the 3.1.0 milestone Aug 13, 2020
@iwilltry42 iwilltry42 self-assigned this Aug 13, 2020
@iwilltry42 iwilltry42 marked this pull request as draft August 13, 2020 10:57
@dweomer
Copy link

dweomer commented Aug 18, 2020

@iwilltry42 k3s registry connect seems more like wishful thinking given our conversation with @erikwilson and the lack of containerd support (unless we are okay with a cluster reboot which is probably fine, actually).

I may have missed it but if you haven't already I suggest adding a string slice of registries to connect to by name when invoking k3d cluster create (kind of like associating volumes to containers a la docker create|run)

@iwilltry42
Copy link
Member Author

Thanks for the feedback @dweomer !

@iwilltry42 k3s registry connect seems more like wishful thinking given our conversation with @erikwilson and the lack of containerd support (unless we are okay with a cluster reboot which is probably fine, actually).

Fast and painless cluster reboots are on our list anyway to allow updating settings after creating the cluster. So I'll just postpone registry connect for now 👍

I may have missed it but if you haven't already I suggest adding a string slice of registries to connect to by name when invoking k3d cluster create (kind of like associating volumes to containers a la docker create|run)

Yep, I will definitely add this again. That's also how k3d 1.x handled registries (creation and connection).

@sgandon
Copy link

sgandon commented Sep 8, 2020

Will there be a way to create the registry automatically upon cluster creation, or will this have to be a second set of commands ?

ClusterRun bundles/orchestrates all the steps:
1. Preparation (Infrastructure)
2. Creation
3. Configuration
4. Start
@iwilltry42 iwilltry42 changed the title [Feature] Registry for v4 [Feature] Registry for v4 & Restructure Cluster Creation Dec 8, 2020
@iwilltry42 iwilltry42 force-pushed the feature/registry branch 2 times, most recently from 1a8dc12 to 6c59e0e Compare December 9, 2020 14:33
@iwilltry42 iwilltry42 marked this pull request as ready for review December 9, 2020 14:57
@iwilltry42 iwilltry42 changed the base branch from main to main-v4 December 9, 2020 14:57
@iwilltry42 iwilltry42 merged commit ecc025b into main-v4 Dec 9, 2020
@iwilltry42 iwilltry42 deleted the feature/registry branch December 9, 2020 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Standard way for K3d to communicate about a local registry
4 participants