github.com/vmware/go-vcloud-director/v2@v2.24.0/govcd/cse/4.2/capiyaml_cluster.tmpl (about)

     1  apiVersion: cluster.x-k8s.io/v1beta1
     2  kind: Cluster
     3  metadata:
     4    name: "{{.ClusterName}}"
     5    namespace: "{{.TargetNamespace}}"
     6    labels:
     7      cluster-role.tkg.tanzu.vmware.com/management: ""
     8      tanzuKubernetesRelease: "{{.TkrVersion}}"
     9      tkg.tanzu.vmware.com/cluster-name: "{{.ClusterName}}"
    10    annotations:
    11      osInfo: "ubuntu,20.04,amd64"
    12      TKGVERSION: "{{.TkgVersion}}"
    13  spec:
    14    clusterNetwork:
    15      pods:
    16        cidrBlocks:
    17          - "{{.PodCidr}}"
    18      serviceDomain: cluster.local
    19      services:
    20        cidrBlocks:
    21          - "{{.ServiceCidr}}"
    22    controlPlaneRef:
    23      apiVersion: controlplane.cluster.x-k8s.io/v1beta1
    24      kind: KubeadmControlPlane
    25      name: "{{.ClusterName}}-control-plane-node-pool"
    26      namespace: "{{.TargetNamespace}}"
    27    infrastructureRef:
    28      apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
    29      kind: VCDCluster
    30      name: "{{.ClusterName}}"
    31      namespace: "{{.TargetNamespace}}"
    32  ---
    33  apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
    34  kind: VCDCluster
    35  metadata:
    36    name: "{{.ClusterName}}"
    37    namespace: "{{.TargetNamespace}}"
    38  spec:
    39    site: "{{.VcdSite}}"
    40    org: "{{.Org}}"
    41    ovdc: "{{.OrgVdc}}"
    42    ovdcNetwork: "{{.OrgVdcNetwork}}"
    43    {{- if .ControlPlaneEndpoint}}
    44    controlPlaneEndpoint:
    45      host: "{{.ControlPlaneEndpoint}}"
    46      port: 6443
    47    {{- end}}
    48    {{- if .VirtualIpSubnet}}
    49    loadBalancerConfigSpec:
    50      vipSubnet: "{{.VirtualIpSubnet}}"
    51    {{- end}}
    52    useAsManagementCluster: false
    53    userContext:
    54      secretRef:
    55        name: capi-user-credentials
    56        namespace: "{{.TargetNamespace}}"
    57  ---
    58  apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
    59  kind: VCDMachineTemplate
    60  metadata:
    61    name: "{{.ClusterName}}-control-plane-node-pool"
    62    namespace: "{{.TargetNamespace}}"
    63  spec:
    64    template:
    65      spec:
    66        catalog: "{{.Catalog}}"
    67        template: "{{.VAppTemplate}}"
    68        sizingPolicy: "{{.ControlPlaneSizingPolicy}}"
    69        placementPolicy: "{{.ControlPlanePlacementPolicy}}"
    70        storageProfile: "{{.ControlPlaneStorageProfile}}"
    71        diskSize: {{.ControlPlaneDiskSize}}
    72  ---
    73  apiVersion: controlplane.cluster.x-k8s.io/v1beta1
    74  kind: KubeadmControlPlane
    75  metadata:
    76    name: "{{.ClusterName}}-control-plane-node-pool"
    77    namespace: "{{.TargetNamespace}}"
    78  spec:
    79    kubeadmConfigSpec:
    80      preKubeadmCommands:
    81        - mv /etc/ssl/certs/custom_certificate_*.crt /usr/local/share/ca-certificates && update-ca-certificates
    82      {{- if .Base64Certificates}}
    83      files:
    84        {{- range $i, $cert := .Base64Certificates}}
    85        - encoding: base64
    86          content: {{$cert}}
    87          owner: root
    88          permissions: "0644"
    89          path: /etc/ssl/certs/custom_certificate_{{$i}}.crt
    90        {{- end}}
    91      {{- end}}
    92      clusterConfiguration:
    93        apiServer:
    94          certSANs:
    95            - localhost
    96            - 127.0.0.1
    97        controllerManager:
    98          extraArgs:
    99            enable-hostpath-provisioner: "true"
   100        dns:
   101          imageRepository: "{{.ContainerRegistryUrl}}"
   102          imageTag: "{{.DnsVersion}}"
   103        etcd:
   104          local:
   105            imageRepository: "{{.ContainerRegistryUrl}}"
   106            imageTag: "{{.EtcdVersion}}"
   107        imageRepository: "{{.ContainerRegistryUrl}}"
   108      users:
   109        - name: root
   110          sshAuthorizedKeys:
   111            - "{{.SshPublicKey}}"
   112      initConfiguration:
   113        nodeRegistration:
   114          criSocket: /run/containerd/containerd.sock
   115          kubeletExtraArgs:
   116            eviction-hard: nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%
   117            cloud-provider: external
   118      joinConfiguration:
   119        nodeRegistration:
   120          criSocket: /run/containerd/containerd.sock
   121          kubeletExtraArgs:
   122            eviction-hard: nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%
   123            cloud-provider: external
   124    machineTemplate:
   125      infrastructureRef:
   126        apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
   127        kind: VCDMachineTemplate
   128        name: "{{.ClusterName}}-control-plane-node-pool"
   129        namespace: "{{.TargetNamespace}}"
   130    replicas: {{.ControlPlaneMachineCount}}
   131    version: "{{.KubernetesVersion}}"
   132  ---
   133  apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
   134  kind: KubeadmConfigTemplate
   135  metadata:
   136    name: "{{.ClusterName}}-kct"
   137    namespace: "{{.TargetNamespace}}"
   138  spec:
   139    template:
   140      spec:
   141        users:
   142          - name: root
   143            sshAuthorizedKeys:
   144              - "{{.SshPublicKey}}"
   145        useExperimentalRetryJoin: true
   146        preKubeadmCommands:
   147          - mv /etc/ssl/certs/custom_certificate_*.crt /usr/local/share/ca-certificates && update-ca-certificates
   148        {{- if .Base64Certificates}}
   149        files:
   150          {{- range $i, $cert := .Base64Certificates}}
   151          - encoding: base64
   152            content: {{$cert}}
   153            owner: root
   154            permissions: "0644"
   155            path: /etc/ssl/certs/custom_certificate_{{$i}}.crt
   156          {{- end}}
   157        {{- end}}
   158        joinConfiguration:
   159          nodeRegistration:
   160            criSocket: /run/containerd/containerd.sock
   161            kubeletExtraArgs:
   162              eviction-hard: nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%
   163              cloud-provider: external