mirror of https://github.com/k3s-io/k3s
Make systemd notify optional in generic api server
To properly notify systemd that the k3s server is ready we need to prevent the current k8s notification and add one to the k3s cli.k3s-v1.13.3
parent
e61796120f
commit
96a2a74e26
|
@ -44,6 +44,10 @@ import (
|
||||||
restclient "k8s.io/client-go/rest"
|
restclient "k8s.io/client-go/rest"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
NotifySystemD = true
|
||||||
|
)
|
||||||
|
|
||||||
// Info about an API group.
|
// Info about an API group.
|
||||||
type APIGroupInfo struct {
|
type APIGroupInfo struct {
|
||||||
PrioritizedVersions []schema.GroupVersion
|
PrioritizedVersions []schema.GroupVersion
|
||||||
|
@ -292,8 +296,10 @@ func (s preparedGenericAPIServer) NonBlockingRun(stopCh <-chan struct{}) error {
|
||||||
|
|
||||||
s.RunPostStartHooks(stopCh)
|
s.RunPostStartHooks(stopCh)
|
||||||
|
|
||||||
if _, err := systemd.SdNotify(true, "READY=1\n"); err != nil {
|
if NotifySystemD {
|
||||||
klog.Errorf("Unable to send systemd daemon successful start message: %v\n", err)
|
if _, err := systemd.SdNotify(true, "READY=1\n"); err != nil {
|
||||||
|
klog.Errorf("Unable to send systemd daemon successful start message: %v\n", err)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
@ -405,9 +411,9 @@ func (s *GenericAPIServer) newAPIGroupVersion(apiGroupInfo *APIGroupInfo, groupV
|
||||||
Typer: apiGroupInfo.Scheme,
|
Typer: apiGroupInfo.Scheme,
|
||||||
Linker: runtime.SelfLinker(meta.NewAccessor()),
|
Linker: runtime.SelfLinker(meta.NewAccessor()),
|
||||||
|
|
||||||
Admit: s.admissionControl,
|
Admit: s.admissionControl,
|
||||||
MinRequestTimeout: s.minRequestTimeout,
|
MinRequestTimeout: s.minRequestTimeout,
|
||||||
Authorizer: s.Authorizer,
|
Authorizer: s.Authorizer,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue