<p>I have setup a kubernete cluster with kubeadm in baremetal. </p>

<p>the cluster works well.</p>

<p>Next I connected some workers nodes. </p>

<p>But for some reason other IP addresses of Pods were assigned.</p>

<p>now when you deploy a service, if it is installed on one of these new nodes, errors appear.</p>

<p><strong>Error - "NetworkPlugin cni failed to set up pod"</strong></p>

<p>I don’t want to do init (kubeadm init --pod-network-cidr= )for obvious reasons, I'm afraid to break everything</p>

<p>Im using Calico as CNI plugin</p>

<p>/var/lib/kubelet/config.yaml:</p>

<pre><code>address: 0.0.0.0
apiVersion: kubelet.config.k8s.io/v1beta1
authentication:
anonymous:
enabled: false
webhook:
cacheTTL: 2m0s
enabled: true
x509:
clientCAFile: /etc/kubernetes/ssl/ca.crt
authorization:
mode: Webhook
webhook:
cacheAuthorizedTTL: 5m0s
cacheUnauthorizedTTL: 30s
cgroupDriver: cgroupfs
cgroupsPerQOS: true
clusterDNS:
- 10.233.0.10
clusterDomain: cluster.local
configMapAndSecretChangeDetectionStrategy: Watch
containerLogMaxFiles: 5
containerLogMaxSize: 10Mi
contentType: application/vnd.kubernetes.protobuf
cpuCFSQuota: true
cpuCFSQuotaPeriod: 100ms
cpuManagerPolicy: none
cpuManagerReconcilePeriod: 10s
enableControllerAttachDetach: true
enableDebuggingHandlers: true
enforceNodeAllocatable:- pods
eventBurst: 10
eventRecordQPS: 5
evictionHard:
imagefs.available: 15%
memory.available: 100Mi
nodefs.available: 10%
nodefs.inodesFree: 5%
evictionPressureTransitionPeriod: 5m0s
failSwapOn: true
fileCheckFrequency: 20s
hairpinMode: promiscuous-bridge
healthzBindAddress: 127.0.0.1
healthzPort: 10248
httpCheckFrequency: 20s
imageGCHighThresholdPercent: 85
imageGCLowThresholdPercent: 80
imageMinimumGCAge: 2m0s
iptablesDropBit: 15
iptablesMasqueradeBit: 14
kind: KubeletConfiguration
kubeAPIBurst: 10
kubeAPIQPS: 5
makeIPTablesUtilChains: true
maxOpenFiles: 1000000
maxPods: 110
nodeLeaseDurationSeconds: 40
nodeStatusReportFrequency: 1m0s
nodeStatusUpdateFrequency: 10s
oomScoreAdj: -999
podPidsLimit: -1
port: 10250
registryBurst: 10
registryPullQPS: 5
resolvConf: /etc/resolv.conf
rotateCertificates: true
runtimeRequestTimeout: 2m0s
serializeImagePulls: true
staticPodPath: /etc/kubernetes/manifests
streamingConnectionIdleTimeout: 4h0m0s
syncFrequency: 1m0s
volumeStatsAggPeriod: 1m0s
</code></pre>

<p>``</p>

cryptoparty
<p>Without doing kubeadm init you can change the pod cidr of a specific node via --pod-cidr parameter in kubelet config file in /var/lib/kubelet/config.yaml. And then you can restart kubelet via systemctl restart kubelet.service.</p>

<p>Official docs <a href="https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/kubelet-integration/" rel="nofollow noreferrer">here</a></p>
