We don't call klog.InitFlags yet, because that will cause a flag
redefinition error until we get everyone to stop using glog. That
will happen when we update to k8s 1.13.
- removed all the systemd unit creation and use the volume mount code from kubele (SafeFormatAndMount)
- added some documentation to highlight the feature and show how it might be used in both ebs and ephemeral storage
- updated the api specs and machinery
- adding the dependecies on the services when the volume mounts are enable (should probably false this if they don't effect the docker filesystem)
Previously the hook system would only allow extensions of ".service"
and ".timer". Any other name would have ".service" appended.
Now the hook system allows any suffix listed at
https://www.freedesktop.org/software/systemd/man/systemd.unit.html.
If no suffix is found, ".service" is still added to preserve backwards-
compatibility.
Note that backwards-compatibility may still break for users relying on
the previous behavior in odd ways. For example, a hook with name
"my-hook.slice" would previously have been installed as
"my-hook.slice.service", but it will now be installed as "my-hook.slice",
since ".slice" is a valid systemd unit file extension.
When "useRawManifest" is set to true in the hook spec, the contents of
the "manifest" field are used unmodified as a systemd unit. The
"before" and "requires" fields are ignored, kops will not construct
the "[Unit]" section of the systemd unit file, and kops will not add a
"[Service]" header.
This gives operators access to the full suite of options available in
the "[Unit]" section, and also allows creation of unit files which
don't contain a "[Service]" section (for example, .swap units; see
https://www.freedesktop.org/software/systemd/man/systemd.swap.html).
Because this functionality is gated behind a new option, backwards
compatibility is preserved for hooks currently being created using the
old style.
Recent versions of systemd (version 229 at least) included in Ubuntu
16.04 and Debian 9 require the systemd unit files to have a .service
extension.
Signed-off-by: Ali Rizwan <ari@hellofresh.com>
- switched to using an array of roles rather than boolean flags for node selection
- fixed up the README to reflect the changes
- added the docker.service as a Requires to all docker exec hooks
- extending the hooks to permit adding hooks per instancegroup as well
- @note, instanceGroup are permitted to override the cluster wide one for ease of testing
- updated the documentation to reflect the changes
- on the journey tried to fix an go idioms such as import ordering, comments for global export etc
- @question: v1alpha1 doesn't appear to have Subnet fields, are these different version being used anywhere?
The present implementation of hooks only perform for docker exec, which isn't that flexible. This PR permits the user to greater customize systemd units on the instances
- cleaned up the manifest code, added tests and permit setting a section raw
- added the ability to filter hooks via master and node roles
- updated the documentation to reflect the changes
- cleaned up some of the vetting issues
The current implementation does not permit the user to order the hooks. This PR adds optional Requires, Before and Documentation to the HookSpec which is added the systemd unit if specified.