How to change --node-cidr-mask-size= from 24 to 16 or 8

May 14, 2018 98 views
Kubernetes Ubuntu 16.04

I am using "kubeadm --pod-network-cidr 10.0.0.0/8 init" to start node but kubectl describe node shows PodCIDR: as x.x.x.x/24.

cat /etc/kubernetes/manifests/kube-controller-manager.yaml

apiVersion: v1 kind: Pod metadata: annotations: scheduler.alpha.kubernetes.io/critical-pod: "" creationTimestamp: null labels: component: kube-controller-manager tier: control-plane name: kube-controller-manager namespace: kube-system spec: containers:

command:
kube-controller-manager
--root-ca-file=/etc/kubernetes/pki/ca.crt
--cluster-signing-cert-file=/etc/kubernetes/pki/ca.crt
--address=127.0.0.1
--use-service-account-credentials=true
--controllers=*,bootstrapsigner,tokencleaner
--kubeconfig=/etc/kubernetes/controller-manager.conf
--service-account-private-key-file=/etc/kubernetes/pki/sa.key
--cluster-signing-key-file=/etc/kubernetes/pki/ca.key
--leader-elect=true
--allocate-node-cidrs=true
--cluster-cidr=10.0.0.0/8
--node-cidr-mask-size=24
Please let me know how to change PodCIDR or - --node-cidr-mask-size to /16 or /8

Thanks Anupam Thakur

Be the first one to answer this question.