Skip to content

Instantly share code, notes, and snippets.

@haircommander
Last active December 27, 2020 06:19
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haircommander/2c07cc23887fa7c7f083dc61c7ef5791 to your computer and use it in GitHub Desktop.
Save haircommander/2c07cc23887fa7c7f083dc61c7ef5791 to your computer and use it in GitHub Desktop.
An /etc/default/kubelet file to quickly configure kubelet variables to use CRI-O with kubeadm
KUBELET_EXTRA_ARGS=--feature-gates="AllAlpha=false,RunAsGroup=true" --container-runtime=remote --cgroup-driver=systemd --container-runtime-endpoint='unix:///var/run/crio/crio.sock' --runtime-request-timeout=5m
@Kali-lightsaber
Copy link

Kali-lightsaber commented Dec 3, 2020

May be usefull:
Kubelet from scratch config using by systemd /etc/systemd/system/kubelet.service.d/10-kubeadm.conf

[Service]
Environment="KUBELET_KUBECONFIG_ARGS=--bootstrap-kubeconfig=/etc/kubernetes/bootstrap-kubelet.conf
--kubeconfig=/etc/kubernetes/kubelet.conf"
Environment="KUBELET_CONFIG_ARGS=--config=/var/lib/kubelet/config.yaml"

This is a file that "kubeadm init" and "kubeadm join" generate at runtime, populating

the KUBELET_KUBEADM_ARGS variable dynamically
EnvironmentFile=-/var/lib/kubelet/kubeadm-flags.env

This is a file that the user can use for overrides of the kubelet args as a last resort. Preferably,
the user should use the .NodeRegistration.KubeletExtraArgs object in the configuration files instead.
KUBELET_EXTRA_ARGS should be sourced from this file.

EnvironmentFile=-/etc/default/kubelet
ExecStart=
ExecStart=/usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS


from - https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/kubelet-integration/

@haircommander
Copy link
Author

thanks for your comment @Kali-lightsaber, i think I'm going to update the documentation to use the script i created here cri-o/cri-o#4393 (comment) with native kubeadm config print..., instead of putting files in different places

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment