{
  "$id": "https://bloxcd.dev/schemas/bloxcd.dev/bloxcluster_v1alpha1.json",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "additionalProperties": false,
  "description": "A BloxCluster registers a member cluster with a blox hub. Blox targets select clusters by their labels.",
  "properties": {
    "apiVersion": {
      "const": "bloxcd.dev/v1alpha1",
      "description": "API version of this object."
    },
    "kind": {
      "const": "BloxCluster",
      "description": "Kind of this object."
    },
    "metadata": {
      "description": "Standard Kubernetes object metadata.",
      "type": "object"
    },
    "spec": {
      "additionalProperties": false,
      "description": "Desired state of a `BloxCluster`: how the hub reaches the member cluster.",
      "properties": {
        "connection": {
          "additionalProperties": false,
          "description": "How the hub reaches this cluster. Exactly one of `agent` or `kubeconfigSecretRef`.",
          "properties": {
            "agent": {
              "description": "The cluster runs `bloxd --mode=agent`, which connects to the hub (recommended).",
              "type": [
                "object",
                "null"
              ]
            },
            "kubeconfigSecretRef": {
              "additionalProperties": false,
              "description": "The hub applies to the cluster directly with this kubeconfig (push mode).",
              "properties": {
                "key": {
                  "description": "Key holding the kubeconfig. Defaults to `value`, as Cluster API writes it.",
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "name": {
                  "type": "string"
                },
                "namespace": {
                  "type": "string"
                }
              },
              "required": [
                "name",
                "namespace"
              ],
              "type": [
                "object",
                "null"
              ]
            }
          },
          "type": "object"
        }
      },
      "required": [
        "connection"
      ],
      "type": "object"
    },
    "status": {
      "additionalProperties": false,
      "properties": {
        "agentVersion": {
          "description": "Version of `bloxd` running as this cluster's agent.",
          "type": [
            "string",
            "null"
          ]
        },
        "conditions": {
          "items": {
            "additionalProperties": false,
            "description": "Condition contains details for one aspect of the current state of this API Resource.",
            "properties": {
              "lastTransitionTime": {
                "description": "lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed.  If that is not known, then using the time when the API field changed is acceptable.",
                "format": "date-time",
                "type": "string"
              },
              "message": {
                "description": "message is a human readable message indicating details about the transition. This may be an empty string.",
                "type": "string"
              },
              "observedGeneration": {
                "description": "observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.",
                "format": "int64",
                "type": "integer"
              },
              "reason": {
                "description": "reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.",
                "type": "string"
              },
              "status": {
                "description": "status of the condition, one of True, False, Unknown.",
                "type": "string"
              },
              "type": {
                "description": "type of condition in CamelCase or in foo.example.com/CamelCase.",
                "type": "string"
              }
            },
            "required": [
              "lastTransitionTime",
              "message",
              "reason",
              "status",
              "type"
            ],
            "type": "object"
          },
          "type": "array"
        },
        "kubernetesVersion": {
          "description": "Kubernetes version of the member cluster, e.g. `v1.34.1`.",
          "type": [
            "string",
            "null"
          ]
        },
        "lastHeartbeat": {
          "description": "When the hub last heard from the cluster.",
          "format": "date-time",
          "type": [
            "string",
            "null"
          ]
        }
      },
      "type": [
        "object",
        "null"
      ]
    }
  },
  "required": [
    "apiVersion",
    "kind",
    "spec"
  ],
  "title": "BloxCluster (bloxcd.dev/v1alpha1)",
  "type": "object"
}
