To run or debug an application on a remote Kubernetes cluster, you'll need to
define the container image repository for your project. You can use any image
repository provider, including [Artifact Registry](https://docs.cloud.google.com/artifact-registry/docs).

## Specify where container images are stored

If you're logged into Google Cloud in your IDE and you have a
default project defined, Cloud Code automatically uses your
default container image repository
**gcr.io/<var class="readonly" translate="no">PROJECT_ID</var>** , where
<var class="readonly" translate="no">PROJECT_ID</var> references your default project.

> [!NOTE]
> **Note:** If you are running on a local cluster like minikube or Docker Desktop, you do not need to specify these configurations.

If you'd like to update the image repository where the project
images are pushed, follow these instructions:

1. Open the Command Palette (press `Ctrl`/`Cmd`+`Shift`+`P`) and then run the **Cloud Code: Run on Kubernetes** command.
2. Confirm whether to use the current [Kubernetes context](https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/#context) to run the app in (or switch to a preferred one).
3. You are prompted to select an image registry.
4. Enter the image repository you want to store your images in.

   If your project has [Artifact Registry API enabled](https://docs.cloud.google.com/artifact-registry/docs/enable-service)
   and at least one [Artifact Registry repository](https://docs.cloud.google.com/artifact-registry/docs/manage-repos),
   you can browse to and select an existing Artifact Registry repository.

See the [common image repository formats](https://docs.cloud.google.com/code/docs/vscode/store-container-images#image_formats) section for examples
of how to specify where container images are stored for some common registries.

### Image name creation

Cloud Code concatenates the image registry with the image name
specified in the Kubernetes manifests to generate the final image repository
name.

For more information, see the
[image registry handling guide](https://skaffold.dev/docs/environment/image-registries).

This choice is stored in your `cloudcode.kubernetes` launch configuration
(found in .vscode/launch.json).


Cloud Code builds your containers, pushes them to the registry,
applies Kubernetes configurations to the cluster, and waits for the rollout.

### Common image repository formats

Here are examples of how to specify where container images are stored for some
common registries:

<br />

|---|---|
| Docker Hub | **docker.io/<var class="readonly" translate="no">ACCOUNT</var>** |
| Artifact Registry | **<var class="readonly" translate="no">REGION</var>-docker.pkg.dev/<var class="readonly" translate="no">PROJECT_ID</var>/<var class="readonly" translate="no">REPO_PATH</var>** |
| AWS Elastic Container Registry (ECR) | **<var class="readonly" translate="no">AWS_ACCOUNT_ID</var>.dkr.ecr.<var class="readonly" translate="no">REGION</var>.amazonaws.com/<var class="readonly" translate="no">MY_APP</var>** |
| Azure Container Registry (ACR) | **<var class="readonly" translate="no">MY_ACR_NAME</var>.azurecr.io/<var class="readonly" translate="no">MY_APP</var>** |

<br />

## What's next

- [Create and configure a GKE cluster](https://docs.cloud.google.com/code/docs/vscode/create-configure-gke-cluster).
- Learn more about [Artifact Registry](https://docs.cloud.google.com/artifact-registry/docs/overview).

## Get Support

To send feedback, ask a question on [Stack Overflow](https://stackoverflow.com/questions/ask?tags=cloud-code-vscode). If you are a Google Cloud customer, you can file tickets through [standard Google Cloud
support channels](https://cloud.google.com/support?e=48754805).