Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add flag to Kubernetes controller manager

I'm new to K8s. In process to config Openstack Cinder as K8s StorageClass, i have to add some flags to my kube controller manager, and I found that it's my big problem. I'm using K8s 1.11 in VMs, and my K8s cluster has a kube-controller-manager pod, but I don't know how to add these flags to my kube-controller-manager. After hours search, i found that there's a lot of task require add flag to kube-controller-manager, but no exactly document guide me how to do that. Please share me the way to go over it.

Thank you.

like image 378
Linh Nguyen Avatar asked Aug 07 '18 09:08

Linh Nguyen


People also ask

What is the Kubernetes controller manager?

The Kubernetes controller manager is a daemon that embeds the core control loops shipped with Kubernetes. In applications of robotics and automation, a control loop is a non-terminating loop that regulates the state of the system.

Can I create my own controller manager in Kubernetes?

Kubernetes lets you run a resilient control plane, so that if any of the built-in controllers were to fail, another part of the control plane will take over the work. You can find controllers that run outside the control plane, to extend Kubernetes. Or, if you want, you can write a new controller yourself.

How do I check my kube-controller-manager?

You can check the metrics available for your version in the Kubernetes repo (link for the 1.15. 3 version). Number of kube-controller-manager instances: This value will give an idea of the general health of the kubelet in the nodes. The expected value is the number of nodes in the cluster.

How do I enable feature Gates in Kubernetes?

Feature gates are a set of key=value pairs that describe Kubernetes features. You can turn these features on or off using the --feature-gates command line flag on each Kubernetes component.

How to use flags in Kubernetes cluster configuration?

For control plane components you can use flags in the ClusterConfiguration structure or patches per-node. For the kubelet and kube-proxy you can use KubeletConfiguration and KubeProxyConfiguration, accordingly. All of these options are possible via the kubeadm configuration API.

What is controller manager in Kubernetes?

Synopsis The Kubernetes controller manager is a daemon that embeds the core control loops shipped with Kubernetes. In applications of robotics and automation, a control loop is a non-terminating loop that regulates the state of the system.

How to override a flag for a control plane component in kubeadm?

These structures contain a common extraArgs field, that consists of key: value pairs. To override a flag for a control plane component: Add the appropriate extraArgs to your configuration. Add flags to the extraArgs field. Run kubeadm init with --config <YOUR CONFIG YAML>.

What is a control loop in Kubernetes?

In applications of robotics and automation, a control loop is a non-terminating loop that regulates the state of the system. In Kubernetes, a controller is a control loop that watches the shared state of the cluster through the apiserver and makes changes attempting to move the current state towards the desired state.


1 Answers

You can check /etc/kubernetes/manifests dir on your master nodes. This dir would contain yaml files for master components.

These are also known as static pods.

More Info : https://kubernetes.io/docs/tasks/administer-cluster/static-pod/

Update these files and you would be able to see your changes as kubelet should restart the pod on file change.

As a more long term solution, you will need to incorporate the flags to the tooling that you use to generate your k8s cluster.

like image 73
Harshal Shah Avatar answered Sep 28 '22 16:09

Harshal Shah