-
Notifications
You must be signed in to change notification settings - Fork 81
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
Apply additional kube manifests from configs to cluster #817
Conversation
168eadb
to
1d181af
Compare
Signed-off-by: Kimmo Lehto <klehto@mirantis.com> --------- Signed-off-by: Kimmo Lehto <klehto@mirantis.com>
Signed-off-by: Kimmo Lehto <klehto@mirantis.com>
Signed-off-by: Kimmo Lehto <klehto@mirantis.com>
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.
One minor question only, otherwise LGTM
cfg.Metadata.Manifests = make(map[string][]byte) | ||
log.Debugf("found %d additional resources in the configuration", len(otherConfigs)) | ||
for _, otherConfig := range otherConfigs { | ||
log.Debugf("found resource: %s (%d bytes)", otherConfig.Filename(), len(otherConfig.Raw)) |
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.
Aren't we loading all otherConfigs
from a single yaml doc? In this case, what does otherConfig.Filename()
refer to?
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.
k0sctl accepts multiple --config
s or a dir --config configs/
(which gets converted to configs/**/*.{yml,yaml}
or a glob pattern --config "configs/k0s*.yaml"
, not only a single multidoc yaml.
The manifest reader tries to keep track of their origins for displaying messages, but if it came from stdin or it doesn't know the filename for some other reason, it either just calls it "manifest" (during preliminary reading/unmarshaling) or calls it fmt.Sprintf("%s-%s-%d.yaml", safeFn(rd.APIVersion), safeFn(rd.Kind), time.Now().UnixNano())
(once the header has been parsed).
Additional feature for #812
Any encountered configuration files that are in the "kubernetes resource" format (contains
apiVersion
andkind
fields) will be applied to the cluster usingkubectl apply
as the last step before disconnect during ak0sctl apply
action.Example YAML: