-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
📦 NEW: Add Containerd config template support #248
Conversation
I commented here #264 (comment) but it applies to this PR too. |
With this PR applied I can run k3s on my laptop without internet connection. The config is below. Note that the private docker registry is unsecure ("http" instead of "https") which simplifies a lot in the setup.
The local registry must be pre-loaded with all images that
List the contents of the local registry with;
|
/subscribe 👍 (I'd like to see this and it would help k3d) |
@@ -49,6 +49,12 @@ func Run(ctx context.Context, cfg *config.Node) error { | |||
} | |||
|
|||
template := configToml | |||
|
|||
if cfg.ConfigTemplate != "" { | |||
fileBytes, _ := ioutil.ReadFile(cfg.ConfigTemplate) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you catch the error here please and return err if it can't read the template
Name: "containerd-config-template", | ||
Usage: "Use Custom Containerd config file", | ||
Destination: &AgentConfig.ContainerdConfig, | ||
Value: "", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need for Value item if its nil
Also can you rebase |
closed in favor of #381 |
this can use --containerd-config-template to offer a containerd template.
the template file like:
and if use cni, the cni config will append to the end.