Update docker base template (CAPD)

- update cluster, controlplane and workers
  template
- update includes removing machine
  health check crd
- update pod and service cidr
- remove cni application as post kubeadm command

Relates-To: #452
Change-Id: I04f0a3ed0966cdb6a58d618e50381b45b80f1f10
This commit is contained in:
Rishabh Kumar Jain 2021-01-25 11:13:34 -08:00
parent 63a5d1146c
commit ffe763b96a
3 changed files with 27 additions and 54 deletions

View File

@ -1,26 +1,29 @@
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
kind: DockerCluster
metadata:
name: "target-cluster"
---
apiVersion: cluster.x-k8s.io/v1alpha3
kind: Cluster
metadata:
name: "target-cluster"
namespace: default
spec:
clusterNetwork:
pods:
cidrBlocks:
- 172.17.0.0/16
serviceDomain: cluster.local
services:
cidrBlocks:
- 10.0.0.0/24
cidrBlocks: ["10.128.0.0/12"]
pods:
cidrBlocks: ["192.168.0.0/16"]
serviceDomain: "cluster.local"
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
kind: DockerCluster
name: "target-cluster"
namespace: default
controlPlaneRef:
kind: KubeadmControlPlane
apiVersion: controlplane.cluster.x-k8s.io/v1alpha3
name: "target-cluster-control-plane"
namespace: default
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
kind: DockerCluster
metadata:
name: "target-cluster"
namespace: default

View File

@ -3,6 +3,7 @@ apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
kind: DockerMachineTemplate
metadata:
name: "target-cluster-control-plane"
namespace: default
spec:
template:
spec:
@ -14,53 +15,26 @@ kind: KubeadmControlPlane
apiVersion: controlplane.cluster.x-k8s.io/v1alpha3
metadata:
name: "target-cluster-control-plane"
namespace: default
spec:
replicas: ${ CONTROL_PLANE_MACHINE_COUNT }
infrastructureTemplate:
kind: DockerMachineTemplate
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
name: "target-cluster-control-plane"
namespace: default
kubeadmConfigSpec:
clusterConfiguration:
apiServer:
certSANs:
- localhost
- 127.0.0.1
controllerManager:
extraArgs:
enable-hostpath-provisioner: "true"
files:
- path: /calico.sh
owner: root:root
permissions: "0755"
content: |
#!/bin/sh -x
su - root -c "sleep 10; kubectl --kubeconfig /etc/kubernetes/admin.conf apply -f https://docs.projectcalico.org/v3.12/manifests/calico.yaml"
extraArgs: {enable-hostpath-provisioner: 'true'}
apiServer:
certSANs: [localhost, 127.0.0.1]
initConfiguration:
nodeRegistration:
criSocket: /var/run/containerd/containerd.sock
kubeletExtraArgs:
eviction-hard: nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%
kubeletExtraArgs: {eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%'}
joinConfiguration:
nodeRegistration:
criSocket: /var/run/containerd/containerd.sock
kubeletExtraArgs:
eviction-hard: nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%
postKubeadmCommands:
- sh /calico.sh
kubeletExtraArgs: {eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%'}
version: "v1.18.6"
---
apiVersion: cluster.x-k8s.io/v1alpha3
kind: MachineHealthCheck
metadata:
name: "target-cluster-mhc-0"
spec:
clusterName: "target-cluster"
maxUnhealthy: 100%
selector:
matchLabels:
nodepool: "pool1"
unhealthyConditions:
- type: E2ENodeUnhealthy
status: "True"
timeout: 30s

View File

@ -1,25 +1,22 @@
---
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
kind: DockerMachineTemplate
metadata:
name: "target-cluster-md-0"
namespace: default
spec:
template:
spec:
extraMounts:
- containerPath: "/var/run/docker.sock"
hostPath: "/var/run/docker.sock"
spec: {}
---
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3
kind: KubeadmConfigTemplate
metadata:
name: "target-cluster-md-0"
namespace: default
spec:
template:
spec:
joinConfiguration:
nodeRegistration:
criSocket: /var/run/containerd/containerd.sock
kubeletExtraArgs: {eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%'}
---
apiVersion: cluster.x-k8s.io/v1alpha3
@ -32,18 +29,17 @@ spec:
selector:
matchLabels:
template:
metadata:
labels:
"nodepool": "pool1"
spec:
clusterName: "target-cluster"
version: "v1.18.6"
version: "v1.18.6"
bootstrap:
configRef:
name: "target-cluster-md-0"
namespace: default
apiVersion: bootstrap.cluster.x-k8s.io/v1alpha3
kind: KubeadmConfigTemplate
infrastructureRef:
name: "target-cluster-md-0"
namespace: default
apiVersion: infrastructure.cluster.x-k8s.io/v1alpha3
kind: DockerMachineTemplate