sigs.k8s.io/cluster-api@v1.7.1/cmd/clusterctl/client/cluster/assets/topology-test/new-clusterclass-and-cluster.yaml (about)

     1  apiVersion: v1
     2  kind: Namespace
     3  metadata:
     4    name: default
     5  spec: {}
     6  ---
     7  apiVersion: cluster.x-k8s.io/v1beta1
     8  kind: ClusterClass
     9  metadata:
    10    name: my-cluster-class
    11    namespace: default
    12  spec:
    13    variables:
    14      - name: imageRepository
    15        required: true
    16        schema:
    17          openAPIV3Schema:
    18            type: string
    19            default: "registry.k8s.io"
    20            example: "registry.k8s.io"
    21    controlPlane:
    22      ref:
    23        apiVersion: controlplane.cluster.x-k8s.io/v1beta1
    24        kind: KubeadmControlPlaneTemplate
    25        name: control-plane
    26        namespace: default
    27      machineInfrastructure:
    28        ref:
    29          kind: DockerMachineTemplate
    30          apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
    31          name: "control-plane"
    32          namespace: default
    33    infrastructure:
    34      ref:
    35        apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
    36        kind: DockerClusterTemplate
    37        name: my-cluster
    38        namespace: default
    39    workers:
    40      machineDeployments:
    41      - class: "default-worker"
    42        template:
    43          bootstrap:
    44            ref:
    45              apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
    46              kind: KubeadmConfigTemplate
    47              name: docker-worker-bootstraptemplate
    48          infrastructure:
    49            ref:
    50              apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
    51              kind: DockerMachineTemplate
    52              name: docker-worker-machinetemplate
    53      - class: "default-worker-2"
    54        template:
    55          bootstrap:
    56            ref:
    57              apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
    58              kind: KubeadmConfigTemplate
    59              name: docker-worker-bootstraptemplate
    60          infrastructure:
    61            ref:
    62              apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
    63              kind: DockerMachineTemplate
    64              name: docker-worker-machinetemplate
    65  ---
    66  apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
    67  kind: DockerClusterTemplate
    68  metadata:
    69    name: my-cluster
    70    namespace: default
    71  spec:
    72    template:
    73      spec: {}
    74  ---
    75  kind: KubeadmControlPlaneTemplate
    76  apiVersion: controlplane.cluster.x-k8s.io/v1beta1
    77  metadata:
    78    name: "control-plane"
    79    namespace: default
    80  spec:
    81    template:
    82      spec:
    83        replicas: 1
    84        machineTemplate:
    85          nodeDrainTimeout: 1s
    86          infrastructureRef:
    87            kind: DockerMachineTemplate
    88            apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
    89            name: "control-plane"
    90            namespace: default
    91        kubeadmConfigSpec:
    92          clusterConfiguration:
    93            apiServer:
    94              certSANs: [ localhost, 127.0.0.1 ]
    95          initConfiguration:
    96            nodeRegistration: {} # node registration parameters are automatically injected by CAPD according to the kindest/node image in use.
    97          joinConfiguration:
    98            nodeRegistration: {} # node registration parameters are automatically injected by CAPD according to the kindest/node image in use.
    99        version: v1.21.2
   100  ---
   101  apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
   102  kind: DockerMachineTemplate
   103  metadata:
   104    name: "control-plane"
   105    namespace: default
   106  spec:
   107    template:
   108      spec:
   109        preLoadImages: 
   110        - gcr.io/kakaraparthy-devel/kindest/kindnetd:0.5.4
   111        extraMounts:
   112        - containerPath: "/var/run/docker.sock"
   113          hostPath: "/var/run/docker.sock"
   114  ---
   115  apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
   116  kind: DockerMachineTemplate
   117  metadata:
   118    name: "docker-worker-machinetemplate"
   119    namespace: default
   120  spec:
   121    template:
   122      spec:
   123        preLoadImages: 
   124        - gcr.io/kakaraparthy-devel/kindest/kindnetd:0.5.4
   125  ---
   126  apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
   127  kind: KubeadmConfigTemplate
   128  metadata:
   129    name: "docker-worker-bootstraptemplate"
   130    namespace: default
   131  spec:
   132    template:
   133      spec:
   134        joinConfiguration:
   135          nodeRegistration: {} # node registration parameters are automatically injected by CAPD according to the kindest/node image in use.
   136  
   137  ---
   138  apiVersion: cluster.x-k8s.io/v1beta1
   139  kind: Cluster
   140  metadata:
   141    name: "my-cluster"
   142    namespace: default
   143    labels:
   144      cni: kindnet
   145  spec:
   146    clusterNetwork:
   147      services:
   148        cidrBlocks: ["10.128.0.0/12"]
   149      pods:
   150        cidrBlocks: ["192.168.0.0/16"]
   151      serviceDomain: "cluster.local"
   152    topology:
   153      class: my-cluster-class
   154      version: v1.21.2
   155      controlPlane:
   156        metadata: {}
   157        replicas: 1
   158      workers:
   159        machineDeployments:
   160        - class: "default-worker"
   161          name: "md-0"
   162          replicas: 1
   163        - class: "default-worker"
   164          name: "md-1"
   165          replicas: 1