Comment 3 for bug 1900367

Revision history for this message
George Kraft (cynerva) wrote :

Thanks Mike. That's weird, I would not expect the lack of a space there to be an issue, as the yaml parser should resolve that to the same data with or without the space. And indeed, I can't reproduce the issue with the command you provided. After running it on kubernetes-worker rev 704, the vm.nr_hugepages sysctl was successfully updated.

I -can- reproduce the issue with some other typo, like a missing closing brace:

juju config kubernetes-worker sysctl="{ net.ipv4.conf.all.forwarding : 1, net.ipv4.neigh.default.gc_thresh1 : 128, net.ipv4.neigh.default.gc_thresh2 : 28672, net.ipv4.neigh.default.gc_thresh3 : 32768, net.ipv6.neigh.default.gc_thresh1 : 128, net.ipv6.neigh.default.gc_thresh2 : 28672, net.ipv6.neigh.default.gc_thresh3 : 32768, fs.inotify.max_user_instances : 8192, fs.inotify.max_user_watches : 1048576, kernel.panic : 10, kernel.panic_on_oops: 1, vm.overcommit_memory : 1, vm.nr_hugepages: 1024"

With the above command, the charm gives no indication in its status that the sysctl config is invalid. It logs an error, but that's easy to miss.

The charm code passes the raw config string through[1] to charmhelpers.core.sysctl.create_sysctl, which squashes the YAMLError[2].

[1]: https://github.com/charmed-kubernetes/layer-kubernetes-master-worker-base/blob/809f06c6f6521be59e21859eaebeccd13f4d8c28/reactive/kubernetes_master_worker_base.py#L80
[2]: https://github.com/juju/charm-helpers/blob/21f9f239c4f977afb1720243a6f6de4ae876986c/charmhelpers/core/sysctl.py#L46-L52