import { IObjectMeta } from "@kubernetes-models/apimachinery/apis/meta/v1/ObjectMeta";
import { Model, ModelData } from "@kubernetes-models/base";
/**
 * Cluster defines a TiDB cluster
 */
export interface ICluster {
    /**
     * APIVersion defines the versioned schema of this representation of an object.
     * Servers should convert recognized schemas to the latest internal value, and
     * may reject unrecognized values.
     * More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources
     */
    "apiVersion": "core.pingcap.com/v1alpha1";
    /**
     * Kind is a string value representing the REST resource this object represents.
     * Servers may infer this from the endpoint the client submits requests to.
     * Cannot be updated.
     * In CamelCase.
     * More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds
     */
    "kind": "Cluster";
    "metadata"?: IObjectMeta;
    "spec"?: {
        /**
         * BootstrapSQL refers to a configmap which contains the bootstrap SQL file with the key `bootstrap-sql`,
         * which will only be executed when a TiDB cluster bootstrap on the first time.
         * Only v6.5.1+ supports this feature.
         */
        "bootstrapSQL"?: {
            /**
             * Name of the referent.
             * This field is effectively required, but due to backwards compatibility is
             * allowed to be empty. Instances of this type with an empty value here are
             * almost certainly wrong.
             * More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
             */
            "name"?: string;
        };
        "featureGates"?: Array<{
            /**
             * Feature defines a supported feature of a tidb cluster.
             * NOTE(liubo02): +enum is not supported now, we have to add all enum into comments
             * NOTE(liubo02): It's supported by https://github.com/kubernetes-sigs/controller-tools/pull/1179
             */
            "name": "FeatureModification" | "VolumeAttributesClass" | "DisablePDDefaultReadinessProbe" | "UsePDReadyAPI" | "SessionTokenSigning";
        }>;
        /**
         * Paused specifies whether to pause the reconciliation loop for all components of the cluster.
         */
        "paused"?: boolean;
        /**
         * RevisionHistoryLimit is the maximum number of revisions that will
         * be maintained in each Group's revision history.
         * The revision history consists of all revisions not represented by a currently applied version.
         * The default value is 10.
         */
        "revisionHistoryLimit"?: number;
        "security"?: {
            /**
             * SessionTokenSigningCertKeyPair is the name of the K8s secret, where stores certificates for signing the TiDB session token,
             * which is used by TiProxy for session migration.
             * You can generate certificates and create a secret by: kubectl create secret generic <secret-name> --namespace=<namespace> --from-file=tls.crt=<path/to/tls.crt> --from-file=tls.key=<path/to/tls.key>
             * Note: this field will only be used when the feature gate `SessionTokenSigning` is enabled.
             */
            "sessionTokenSigningCertKeyPair"?: {
                /**
                 * Name of the referent.
                 * This field is effectively required, but due to backwards compatibility is
                 * allowed to be empty. Instances of this type with an empty value here are
                 * almost certainly wrong.
                 * More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names
                 */
                "name"?: string;
            };
        };
        /**
         * SuspendAction defines the suspend actions for the cluster.
         */
        "suspendAction"?: {
            /**
             * SuspendCompute indicates delete the pods but keep the PVCs.
             */
            "suspendCompute"?: boolean;
        };
        /**
         * Whether enable the TLS connection between TiDB cluster components.
         */
        "tlsCluster"?: {
            /**
             * Enable mutual TLS connection between TiDB cluster components.
             * Once enabled, the mutual authentication applies to all components,
             * and it does not support applying to only part of the components.
             * The steps to enable this feature:
             *   1. Generate TiDB cluster components certificates and a client-side certifiacete for them.
             *      There are multiple ways to generate these certificates:
             *        - user-provided certificates: https://docs.pingcap.com/tidb/stable/generate-self-signed-certificates
             *        - use the K8s built-in certificate signing system signed certificates: https://kubernetes.io/docs/tasks/tls/managing-tls-in-a-cluster/
             *        - or use cert-manager signed certificates: https://cert-manager.io/
             *   2. Create one secret object for one component group which contains the certificates created above.
             *      The name of this Secret must be: <groupName>-<componentName>-cluster-secret.
             *        For PD: kubectl create secret generic <groupName>-pd-cluster-secret --namespace=<namespace> --from-file=tls.crt=<path/to/tls.crt> --from-file=tls.key=<path/to/tls.key> --from-file=ca.crt=<path/to/ca.crt>
             *        For TiKV: kubectl create secret generic <groupName>-tikv-cluster-secret --namespace=<namespace> --from-file=tls.crt=<path/to/tls.crt> --from-file=tls.key=<path/to/tls.key> --from-file=ca.crt=<path/to/ca.crt>
             *        For TiDB: kubectl create secret generic <groupName>-tidb-cluster-secret --namespace=<namespace> --from-file=tls.crt=<path/to/tls.crt> --from-file=tls.key=<path/to/tls.key> --from-file=ca.crt=<path/to/ca.crt>
             *        For TiBR: kubectl create secret generic <tibrName>-tibr-cluster-secret --namespace=<namespace> --from-file=tls.crt=<path/to/tls.crt> --from-file=tls.key=<path/to/tls.key> --from-file=ca.crt=<path/to/ca.crt>
             *        For Client: kubectl create secret generic <clusterName>-cluster-client-secret --namespace=<namespace> --from-file=tls.crt=<path/to/tls.crt> --from-file=tls.key=<path/to/tls.key> --from-file=ca.crt=<path/to/ca.crt>
             *        Same for other components.
             */
            "enabled"?: boolean;
        };
        /**
         * UpgradePolicy defines the upgrade policy for the cluster.
         */
        "upgradePolicy"?: string;
    };
    "status"?: {
        /**
         * Components is the status of each component in the cluster.
         */
        "components"?: Array<{
            /**
             * Kind is the kind of the component, e.g., PD, TiKV, TiDB, TiFlash.
             */
            "kind": "PD" | "TiKV" | "TiDB" | "TiFlash" | "TiCDC" | "TiProxy";
            /**
             * Replicas is the number of desired replicas of the component.
             */
            "replicas": number;
        }>;
        /**
         * Conditions contains the current status of the cluster.
         */
        "conditions"?: Array<{
            /**
             * 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.
             */
            "lastTransitionTime": string;
            /**
             * message is a human readable message indicating details about the transition.
             * This may be an empty string.
             */
            "message": string;
            /**
             * 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.
             */
            "observedGeneration"?: number;
            /**
             * 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.
             */
            "reason": string;
            /**
             * status of the condition, one of True, False, Unknown.
             */
            "status": "True" | "False" | "Unknown";
            /**
             * type of condition in CamelCase or in foo.example.com/CamelCase.
             */
            "type": string;
        }>;
        /**
         * FeatureGates of this cluster
         */
        "featureGates"?: Array<{
            /**
             * Feature defines a supported feature of a tidb cluster.
             * NOTE(liubo02): +enum is not supported now, we have to add all enum into comments
             * NOTE(liubo02): It's supported by https://github.com/kubernetes-sigs/controller-tools/pull/1179
             */
            "name": "FeatureModification" | "VolumeAttributesClass" | "DisablePDDefaultReadinessProbe" | "UsePDReadyAPI" | "SessionTokenSigning";
            "stage": string;
        }>;
        /**
         * ID is the cluster id.
         */
        "id": string;
        /**
         * observedGeneration is the most recent generation observed for this Cluster. It corresponds to the
         * Cluster's generation, which is updated on mutation by the API Server.
         */
        "observedGeneration"?: number;
        /**
         * PD means url of the pd service, it's prepared for internal use
         * e.g. https://pd:2379
         */
        "pd"?: string;
    };
}
/**
 * Cluster defines a TiDB cluster
 */
export declare class Cluster extends Model<ICluster> implements ICluster {
    "apiVersion": ICluster["apiVersion"];
    "kind": ICluster["kind"];
    "metadata"?: ICluster["metadata"];
    "spec"?: ICluster["spec"];
    "status"?: ICluster["status"];
    static apiVersion: ICluster["apiVersion"];
    static kind: ICluster["kind"];
    static is: import("@kubernetes-models/base").TypeMetaGuard<ICluster>;
    constructor(data?: ModelData<ICluster>);
}
