## Overview

The pre-trained APIs are a collection of AI services that include
Optical Character Recognition (OCR), Speech-to-Text, and Translation. The
services are enabled and disabled using the Kubernetes Resource Model (KRM) API.
The KRM API is a management API that is optionally used by the Vertex AI Platform Admin.

The purpose of this page is to provide information only.

## aiplatform.private.gdc.goog/v1

Package v1 contains API Schema definitions for the aiplatform.private.gdc.goog v1 API group

### Alerting

Alerting contains the names of the ConfigMaps that are to be processed and transformed into Observability Platform alerting CRs: MonitoringRule and LoggingRule.

*Appears in:*
- [Observability](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#observability)

| Field | Description |
|---|---|
| `monitoringAlertsConfigMap` *string* | Configmap with embedded MonitoringRule CR to fetch from Remote K8s Cluster and process by transforming into an Observability Platform MonitoringRule CR and deploy to Admin Cluster. |
| `loggingAlertsConfigMap` *string* | ConfigMap with embedded LoggingRule CR to fetch from Remote K8s Cluster and process by transforming into an Observability Platform LoggingRule CR and deploy to Admin Cluster. |

### AppConfig

AppConfig is the Schema for the AppConfig API. Should have one per namespace

*Appears in:*
- [AppConfigList](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#appconfiglist)

| Field | Description |
|---|---|
| `apiVersion` *string* | `aiplatform.private.gdc.goog/v1` |
| `kind` *string* | `AppConfig` |
| `metadata` *[ObjectMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#objectmeta-v1-meta)* | Refer to Kubernetes API documentation for fields of `metadata`. |
| `spec` *[AppConfigSpec](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#appconfigspec)* |   |
| `status` *[AppConfigStatus](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#appconfigstatus)* |   |

### AppConfigList

AppConfigList contains a list of AppConfig

| Field | Description |
|---|---|
| `apiVersion` *string* | `aiplatform.private.gdc.goog/v1` |
| `kind` *string* | `AppConfigList` |
| `metadata` *[ListMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#listmeta-v1-meta)* | Refer to Kubernetes API documentation for fields of `metadata`. |
| `items` *[AppConfig](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#appconfig) array* |   |

### AppConfigSpec

*Appears in:*
- [AppConfig](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#appconfig)

| Field | Description |
|---|---|
| `sql` *[Database](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#database)* |   |

### AppConfigStatus

AppConfigStatus defines the observed state of AppConfig.

*Appears in:*
- [AppConfig](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#appconfig)

| Field | Description |
|---|---|
| `ready` *boolean* | Ready indicates whether the resource is in a ready state. |
| `primaryCondition` *[ResourceCondition](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#resourcecondition)* | PrimaryCondition represents the primary condition of a resource. If the resource is ready, then the condition will indicate the resource is ready. Otherwise, the condition will be the primary reason why the resource is not ready. |
| `resourceConditions` *[ResourceCondition](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#resourcecondition) array* | ResourceConditions is a collection of conditions for a resource and its subresources. It can be used to determine the overall health of a resource and its subresources. |
| `conditions` *[Condition](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#condition-v1-meta) array* | Conditions represents raw resource conditions populated from Kubernetes resources for debugging purpose. |
| `database` *[DatabaseInfo](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#databaseinfo)* | Presents the Database subresource information. |

### Dashboards

Dashboards contains a list of the names of Observability Platform-dashboard-compatible configmaps to be processed.

*Appears in:*
- [Observability](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#observability)

| Field | Description |
|---|---|
| `configMaps` *string array* | ConfigMaps (with embedded Grafana dashboard json definition) to be processed; these are expected to exist in the user cluster and namespace that the AI workloads are deployed to. There should be a 1:1 mapping between the number of desired dashboards and dashboard configmaps. We assume there will be a single key in the configmap: 'data', which will house the dashboard definition json string. |

### Database

Database configures the relational db requirements for the target Microservice.

*Appears in:*
- [AppConfigSpec](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#appconfigspec)

| Field | Description |
|---|---|
| `postgres` *[PostgresConfig](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#postgresconfig)* |   |

### DatabaseInfo

DatabaseInfo defines the observed state of Database Information.

*Appears in:*
- [AppConfigStatus](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#appconfigstatus)

| Field | Description |
|---|---|
| `endpoint` *string* |   |
| `port` *string* |   |

### HPAStatus

HPAStatus describes the status conditions of the HorizontalPodAutoscaler.

*Appears in:*
- [MicroserviceStatus](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#microservicestatus)

| Field | Description |
|---|---|
| `statusConditions` *[HorizontalPodAutoscalerCondition](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.22/#horizontalpodautoscalercondition-v2-autoscaling) array* | Status conditions |
| `currentReplicas` *integer* | Number of current replicas managed by the HPA |
| `desiredReplicas` *integer* | Number of desired replicas managed by the HPA |

### Logging

Logging configures the log collection functionality for the Observability Platform on GDC air-gapped (do not enable if testing on GKE - this functionality does not apply there).

*Appears in:*
- [Observability](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#observability)

| Field | Description |
|---|---|
| `enableLogCollection` *boolean* | EnableLogCollection indicates whether or not to enable log collection via the Observability Platform. |
| `staticLabels` *object (keys:string, values:string)* | Maps to the 'additionalLabels' property of the OP LoggingTargetCR. Static labels to add to all captured log entries. Label names must not contain dashes ("-"); label values can contain dashes. |

### Metrics

Metrics configures how metrics of a pod will be collected.

*Appears in:*
- [Observability](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#observability)

| Field | Description |
|---|---|
| `prometheus` *[PrometheusMetrics](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#prometheusmetrics)* |   |

### Microservice

Microservice is the Schema for the services API

*Appears in:*
- [MicroserviceList](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#microservicelist)

| Field | Description |
|---|---|
| `apiVersion` *string* | `aiplatform.private.gdc.goog/v1` |
| `kind` *string* | `Microservice` |
| `metadata` *[ObjectMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#objectmeta-v1-meta)* | Refer to Kubernetes API documentation for fields of `metadata`. |
| `spec` *[MicroserviceSpec](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#microservicespec)* |   |
| `status` *[MicroserviceStatus](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#microservicestatus)* |   |

### MicroserviceList

MicroserviceList contains a list of Microservice

| Field | Description |
|---|---|
| `apiVersion` *string* | `aiplatform.private.gdc.goog/v1` |
| `kind` *string* | `MicroserviceList` |
| `metadata` *[ListMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#listmeta-v1-meta)* | Refer to Kubernetes API documentation for fields of `metadata`. |
| `items` *[Microservice](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#microservice) array* |   |

### MicroserviceSpec

MicroserviceSpec defines the desired state of Microservice.

*Appears in:*
- [Microservice](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#microservice)

| Field | Description |
|---|---|
| `public` *boolean* | Whether this Microservice is public. If true, it will have an expose DNS record as well as a public endpoint. TLS will be setup on the gateway as well automatically according to the DNS name. The DNS prefix will be the name of the Microservice in metadata. |
| `enableBucketAccess` *boolean* | Whether to provision the storage bucket related configurations to the container |
| `dnsname` *string* | DNS host name. This will be used to construct DNS host name for the Microservice in GDC environment when Microservice is public |
| `autoscaling` | Autoscaling configurations. |
| `observability` *[Observability](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#observability)* | Observability (logging, metrics, monitoring and dashboards) configuration (some of which are applicable only to GDC air-gapped configurations). |
| `prerequisites` *[Prerequisites](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#prerequisites)* | Prerequisites configuration. |
| `template` *[PodTemplateSpec](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#podtemplatespec)* | Template to create pods in the Microservice. The Microservice will contain stateless deployments for these pods. |

### PodSpec

PodSpec is a minimalist version of the core PodSpec.

*Appears in:*
- [PodTemplateSpec](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#podtemplatespec)

| Field | Description |
|---|---|
| `containers` *[Container](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#container-v1-core) array* | Specifies containers. Not all attributes are supported. Ports specified from all containers will be exposed. First container (containers\[0\]) is considered the primary container and will be the one to be tagged with resource requests for node auto-provisioning. The rest of the containers are considered as auxiliary (e.g.,sidecars). |
| `nodeSelector` *object (keys:string, values:string)* | NodeSelector is a selector which must be true for the pod to fit on a node. Selector which must match a node's labels for the pod to be scheduled on that node. |
| `volumes` *[Volume](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#volume-v1-core) array* | List of volumes that will be mounted to the pods |
| `initContainers` *[Container](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#container-v1-core) array* | List of initialization containers belonging to the pod. Init containers are executed in order prior to containers being started. If any init container fails, the pod is considered to have failed and is handled according to its restartPolicy. The name for an init container or normal container must be unique among all containers. Cannot be updated. More info: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ |
| `tolerations` *[Toleration](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#toleration-v1-core) array* | If specified, the pod's tolerations. |
| `serviceAccount` *string* | The pre-created Kubernetes service account that will be used by pod. |

### PodTemplateSpec

PodTemplateSpec is a container object for PodSpec and potentially metadata spec.

*Appears in:*
- [Microservice](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#microservice)

| Field | Description |
|---|---|
| `metadata` *[ObjectMeta](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#objectmeta-v1-meta)* | Refer to Kubernetes API documentation for fields of `metadata`. |
| `spec` *[PodSpec](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#podspec)* |   |

### MicroserviceStatus

MicroserviceStatus defines the observed state of Microservice.

*Appears in:*
- [Microservice](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#microservice)

| Field | Description |
|---|---|
| `observedGeneration` *integer* | The generation observed by the deployment controller. |
| `endpoint` *string* | The endpoint that this Microservice is accessible from. Only populated for public services. |
| `deploymentStatus` *[DeploymentStatus](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#deploymentstatus)* | The deployment status of this Microservice. |
| `hpaStatus` *[HPAStatus](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#hpastatus)* | The status of the HorizontalPodAutoscaler. |
| `ready` *boolean* | Overall Microservice's readiness status |
| `conditions` *[Condition](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.25/#condition-v1-meta) array* | Represents the latest available observations of a Microservice's current state. |

### Observability

Observability configures the various components and parameters required by the Observability Platform (on GDC air-gapped), or Metrics exposure (on GKE).

*Appears in:*
- [MicroserviceSpec](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#microservicespec)

| Field | Description |
|---|---|
| `metrics` *[Metrics](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#metrics)* | Metrics configuration. On GKE these are only collected on the first container. On GDC air-gapped this is used in conjunction with the Observability section to configure the behavior of the Observability Platform. |
| `logging` *[Logging](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#logging)* |   |
| `alerting` *[Alerting](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#alerting)* |   |
| `dashboards` *[Dashboards](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#dashboards)* |   |

### PostgresConfig

PostgresConfig defines the relevant target configuration settings for a Postgres DB.

*Appears in:*
- [Database](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#database)

| Field | Description |
|---|---|
| `version` *string* |   |

### Prerequisites

Prerequisites configures any prerequisites for the Microservice.

*Appears in:*
- [MicroserviceSpec](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#microservicespec)

| Field | Description |
|---|---|
| `sql` *boolean* | SQL configuration, if required by the target workload |

### PrometheusMetrics

PrometheusMetrics configures the Prometheus metrics exposed by a pod.

*Appears in:*
- [Metrics](https://docs.cloud.google.com/distributed-cloud/hosted/docs/latest/gdcag/apis/pretrained-krm-api.md.txt#metrics)

| Field | Description |
|---|---|
| `path` *string* | The metrics URI path to scrape metrics from. Defaults to /metrics. |
| `port` *integer* | The port to scrape metrics from. Defaults to 80. |