Skip to content

Add schema for KinD cluster config #4892

@kevindurb

Description

@kevindurb

Description of the JSON schema.

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "type": "object",
  "properties": {
    "kind": {
      "type": "string",
      "enum": ["Cluster"],
      "description": "The kind of configuration, must be 'Cluster'"
    },
    "apiVersion": {
      "type": "string",
      "enum": ["kind.x-k8s.io/v1alpha4"],
      "description": "API version for the kind cluster config"
    },
    "name": {
      "type": "string",
      "description": "Name of the cluster"
    },
    "nodes": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "role": {
            "type": "string",
            "enum": ["control-plane", "worker"],
            "description": "Role of the node"
          },
          "image": {
            "type": "string",
            "description": "Container image to use for the node"
          },
          "extraMounts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "hostPath": {
                  "type": "string",
                  "description": "Path on the host"
                },
                "containerPath": {
                  "type": "string",
                  "description": "Path in the container"
                },
                "readOnly": {
                  "type": "boolean",
                  "description": "Whether the mount is read-only"
                },
                "selinuxRelabel": {
                  "type": "boolean",
                  "description": "Whether to relabel for SELinux"
                },
                "propagation": {
                  "type": "string",
                  "enum": ["None", "HostToContainer", "Bidirectional"],
                  "description": "Mount propagation"
                }
              },
              "required": ["hostPath", "containerPath"]
            }
          },
          "extraPortMappings": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "containerPort": {
                  "type": "integer",
                  "description": "Port inside the container"
                },
                "hostPort": {
                  "type": "integer",
                  "description": "Port on the host"
                },
                "listenAddress": {
                  "type": "string",
                  "description": "Address to listen on"
                },
                "protocol": {
                  "type": "string",
                  "enum": ["TCP", "UDP"],
                  "description": "Protocol for the port mapping"
                }
              },
              "required": ["containerPort"]
            }
          },
          "kubeadmConfigPatches": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Kubeadm config patches in YAML format"
          },
          "kubeadmConfigPatchesJSON6902": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "group": {
                  "type": "string"
                },
                "version": {
                  "type": "string"
                },
                "kind": {
                  "type": "string"
                },
                "patch": {
                  "type": "string"
                }
              },
              "required": ["group", "version", "kind", "patch"]
            },
            "description": "JSON 6902 patches for kubeadm config"
          }
        },
        "required": ["role"]
      }
    },
    "networking": {
      "type": "object",
      "properties": {
        "ipFamily": {
          "type": "string",
          "enum": ["ipv4", "ipv6", "dual"],
          "description": "IP family for the cluster"
        },
        "apiServerAddress": {
          "type": "string",
          "description": "API server address"
        },
        "apiServerPort": {
          "type": "integer",
          "description": "API server port"
        },
        "podSubnet": {
          "type": "string",
          "description": "Pod subnet CIDR"
        },
        "serviceSubnet": {
          "type": "string",
          "description": "Service subnet CIDR"
        },
        "disableDefaultCNI": {
          "type": "boolean",
          "description": "Whether to disable the default CNI"
        },
        "kubeProxyMode": {
          "type": "string",
          "enum": ["iptables", "ipvs", "userspace"],
          "description": "Kube-proxy mode"
        }
      }
    },
    "kubeadmConfigPatches": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Global kubeadm config patches"
    },
    "kubeadmConfigPatchesJSON6902": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "group": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "patch": {
            "type": "string"
          }
        },
        "required": ["group", "version", "kind", "patch"]
      },
      "description": "Global JSON 6902 patches"
    },
    "runtimeConfig": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "Runtime configuration for the API server"
    },
    "featureGates": {
      "type": "object",
      "additionalProperties": {
        "type": "boolean"
      },
      "description": "Feature gates to enable/disable"
    }
  },
  "required": ["kind", "apiVersion"]
}

Supporting information.

https://kind.sigs.k8s.io/docs/user/configuration/

Are you making a PR for this?

No, someone else must create the PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    new-schema-requestRequest to add a new JSON schema. (auto-generated by issue forms)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions