Setup a single node Kubernetes cluster for development using kubeadm: https://kubernetes.io/docs/setup/independent/install-kubeadm/
Create a CentOS 7 or Ubuntu Xenial (16.04) machine, and run kubeadm.sh
as root
.
You can pass this script as user-data to cloud-init so that it will be automatically run. For example, on openstack:
openstack server create NAME --flavor FLAVOR --key-name KEY --image 'Ubuntu Xenial' --network NET --security-group SECGROUP --user-data kubeadm.sh
openstack server add floating ip VM-NAME 1.2.3.4
Follow /var/log/cloud-init-output.log
to see the progress of the script
So I might be mistaken but if the script is run as root then:
install -o 1000 -d /home/$(id -nu 1000)/.kube
install -o 1000 /etc/kubernetes/admin.conf /home/$(id -nu 1000)/.kube/config
Would just be installed as root for users with sudo or root access?
Couldn't this be generalize for all users by adding the kubectl config file to the skel files to be setup for all users on the system?