Stay organized with collections
Save and categorize content based on your preferences.
This page describes creating a service and viewing information about a service.
Services are the main resources of Knative serving.
Creating a service
You create a new service and its revision by
deploying a container image to it for the first time. See
Deploying a new service to learn more about
creating services.
Viewing the list of services in your project
You can view a list of the available services in your project using
Google Cloud console or the Google Cloud CLI:
You can make a copy of an existing service using Google Cloud console or YAML.
You can change anything you want in the copy, including name and region.
Select the service to copy from the displayed list of services for your
project:
Click Copy.
In the service copy page, set or change any values you want to change,
such as region, etc. If you are keeping the same region, you must provide a
new name for the service.
Click Create to make a copy and deploy it using the new service
name.
YAML
You can download the configuration of an existing service into a
YAML file with the gcloud run services describe command by using the
--format=export flag.
You can then modify that YAML file and deploy
those changes with the gcloud beta run services replace command.
You must ensure that you modify only the specified attributes.
Download the configuration of your service into a file named
service.yaml on local workspace:
If you are deploying the copy to the same Kubernetes cluster, replace
SERVICE with the name you want to use for the copy. If you are
deploying the copy to a different Kubernetes cluster, you can use the
same name.
Make sure the value for REVISION-NAME starts with the service
name (SERVICE). For example, if the new service name is
mynewfoo, then the revision name must be in the format mynewfoo-whatever.
Optionally delete the value altogether and a new revision name is created
automatically.
Copy the service using the following command:
gcloudbetarunservicesreplaceservice.yaml
Use the --region
flag to deploy the copy to a different region.
Click on the desired service in the displayed list of services for your
project to open the service details view:
Note the REVISIONS, LOGS and DETAILS tabs. The revisions tab
shows the list of revisions, the logs tab shows the service logs,
and the details tab shows the current
authentication or
connectivity settings.
Command line
To view details about a service:
gcloudrunservicesdescribeSERVICE
Replace SERVICE with the name of the service.
You can use the --format flag to format
the output. For example as YAML:
gcloudrunservicesdescribeSERVICE--formatyaml
You can use --format export to export as YAML without automatically
generated labels or status:
gcloudrunservicesdescribeSERVICE--formatexport
You can also use the --format flag to get
the URL of the service:
Click on the desired service in the displayed list of services for your
project to open the service details view.
Click the Triggers tab.
Select the desired setting and click Save.
Command line
To change service connectivity settings, update the service with the desired
connectivity setting:
gcloud run services update [SERVICE] --connectivity=[OPTION]
Replace [SERVICE] with the name of the service you are updating.
You can omit this parameter entirely, but you will be prompted for the
service name if you omit it.
Replace [OPTION] with internal or external.
Deleting existing services
Deleting a service deletes all resources related to this service, including all
revisions of this service whether they are serving traffic or not.
When deleting a service, the container images used by the deleted revisions are not
deleted automatically from Container Registry. To delete container images from
Container Registry see Deleting images.
Note that deleting a service is permanent: there is no undo or restore.
However, if after deleting a service, you deploy a new service with the same
name in the same cluster, it will have the same endpoint URL.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-25 UTC."],[[["\u003cp\u003eServices are created by deploying a container image, which also creates a new revision.\u003c/p\u003e\n"],["\u003cp\u003eYou can view a list of services in your project using the Google Cloud console, the Google Cloud CLI, or Cloud Code, and can filter the list by service properties.\u003c/p\u003e\n"],["\u003cp\u003eExisting services can be copied via the Google Cloud console or using YAML, allowing modifications to the copy's attributes such as name and region.\u003c/p\u003e\n"],["\u003cp\u003eService details, including revisions, logs, authentication, and connectivity settings, can be viewed through the console or the \u003ccode\u003egcloud run services describe\u003c/code\u003e command.\u003c/p\u003e\n"],["\u003cp\u003eService connectivity can be changed to either internal or external through the console or the \u003ccode\u003egcloud run services update\u003c/code\u003e command, and deleting a service removes all of its revisions permanently.\u003c/p\u003e\n"]]],[],null,["# Managing services\n\nThis page describes creating a service and viewing information about a service.\nServices are the main resources of Knative serving.\n\nCreating a service\n------------------\n\nYou create a new service and its [revision](/anthos/run/archive/docs/managing/revisions) by\ndeploying a container image to it for the first time. See\n[Deploying a new service](/anthos/run/archive/docs/deploying#service) to learn more about\ncreating services.\n\nViewing the list of services in your project\n--------------------------------------------\n\nYou can view a list of the available services in your project using\nGoogle Cloud console or the Google Cloud CLI: \n\n### Console\n\nTo view the services list:\n\n1. [Go to Knative serving](https://console.cloud.google.com/kubernetes/run)\n\n2. Examine the displayed list of services for your project:\n\n### Command line\n\nTo list the services in your project: \n\n gcloud run services list\n\nYou can filter this list by properties of the service definition, such as an\n[assigned label](/anthos/run/archive/docs/configuring/labels#label-listing).\n\n### Cloud Code\n\nTo view the services list with [Cloud Code](/code/docs),\nread the Cloud Run Explorer guides for [IntelliJ](/code/docs/intellij/cloud-run-explorer)\nand [Visual Studio Code](/code/docs/vscode/cloud-run-explorer).\n\nCopying a service\n-----------------\n\nYou can make a copy of an existing service using Google Cloud console or YAML.\nYou can change anything you want in the copy, including name and region. \n\n### Console\n\nTo copy a service:\n\n1. [Go to Knative serving](https://console.cloud.google.com/kubernetes/run)\n\n2. Select the service to copy from the displayed list of services for your\n project:\n\n 1. Click **Copy**.\n\n 2. In the service copy page, set or change any values you want to change,\n such as region, etc. If you are keeping the same region, you must provide a\n new name for the service.\n\n 3. Click **Create** to make a copy and deploy it using the new service\n name.\n\n### YAML\n\n| **Caution:** Deploying configuration changes using YAML files replaces the configuration of your existing services. Since a YAML file completely overwrites all configurations, you should avoid using multiple methods to modify your services. For example, do not use YAML files in conjunction with the Google Cloud console or `gcloud` commands.\n\nYou can download the configuration of an existing service into a\nYAML file with the `gcloud run services describe` command by using the\n[`--format=export`](/sdk/gcloud/reference/run/services/describe) flag.\nYou can then modify that YAML file and deploy\nthose changes with the `gcloud beta run services replace` command.\nYou must ensure that you modify only the specified attributes.\n\n1. Download the configuration of your service into a file named\n `service.yaml` on local workspace:\n\n ```bash\n gcloud run services describe SERVICE --format export \u003e service.yaml\n ```\n\n Replace \u003cvar translate=\"no\"\u003eSERVICE\u003c/var\u003e with the name of your\n Knative serving service.\n2. Make any desired configuration changes to the service as described in the\n various [configuration pages](/anthos/run/archive/docs/how-to#configure).\n\n apiVersion: serving.knative.dev/v1\n kind: Service\n metadata:\n annotations:\n ...\n name: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eSERVICE\u003c/span\u003e\u003c/var\u003e\n ...\n spec:\n template:\n metadata:\n annotations:\n ...\n name: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eREVISION-NAME\u003c/span\u003e\u003c/var\u003e\n\n - If you are deploying the copy to the same Kubernetes cluster, replace\n \u003cvar translate=\"no\"\u003eSERVICE\u003c/var\u003e with the name you want to use for the copy. If you are\n deploying the copy to a different Kubernetes cluster, you can use the\n same name.\n\n - Make sure the value for \u003cvar translate=\"no\"\u003eREVISION-NAME\u003c/var\u003e starts with the service\n name (\u003cvar translate=\"no\"\u003eSERVICE\u003c/var\u003e). For example, if the new service name is\n `mynewfoo`, then the revision name must be in the format `mynewfoo-whatever`.\n Optionally delete the value altogether and a new revision name is created\n automatically.\n\n3. Copy the service using the following command:\n\n ```bash\n gcloud beta run services replace service.yaml\n ```\n\n Use the [`--region`](/sdk/gcloud/reference/beta/run/services/replace#--region)\n flag to deploy the copy to a different region.\n\nViewing more details about a service\n------------------------------------\n\nTo see more details about a service, \n\n### Console\n\nTo view a service's details:\n\n1. [Go to Knative serving](https://console.cloud.google.com/kubernetes/run)\n\n2. Click on the desired service in the displayed list of services for your\n project to open the service details view:\n\n3. Note the **REVISIONS** , **LOGS** and **DETAILS** tabs. The revisions tab\n shows the list of revisions, the logs tab shows the [service logs](/anthos/run/archive/docs/logging),\n and the details tab shows the current\n [authentication](/anthos/run/archive/docs/deploying#service) or\n [connectivity](#connectivity) settings.\n\n### Command line\n\nTo view details about a service: \n\n```bash\ngcloud run services describe SERVICE\n```\nReplace \u003cvar translate=\"no\"\u003eSERVICE\u003c/var\u003e with the name of the service.\n\n\u003cbr /\u003e\n\nYou can use the [`--format` flag](/sdk/gcloud/reference#--format) to format\nthe output. For example as YAML: \n\n```bash\ngcloud run services describe SERVICE --format yaml\n```\n\nYou can use `--format export` to export as YAML without automatically\ngenerated labels or status: \n\n```bash\ngcloud run services describe SERVICE --format export\n```\n\nYou can also use the [`--format` flag](/sdk/gcloud/reference#--format) to get\nthe URL of the service: \n\n```bash\ngcloud run services describe SERVICE --format='value(status.url)'\n```\n\n\u003cbr /\u003e\n\n### Cloud Code\n\nTo view a services details with [Cloud Code](/code/docs),\nread the Cloud Run Explorer guides for [IntelliJ](/code/docs/intellij/cloud-run-explorer)\nand [Visual Studio Code](/code/docs/vscode/cloud-run-explorer).\n\nFor details about the revisions of a service, see\n[Managing Revisions](/anthos/run/archive/docs/managing/revisions).\n\nChanging service connectivity settings\n--------------------------------------\n\nA Knative serving service can have either of two connection options:\n\n- *external*, which allows external access to your service\n\n- *internal* which restricts access only to other Knative serving\n services or services in your cluster that use Istio.\n\nYou can use the console or the Google Cloud CLI to change the settings. \n\n### Console\n\nTo change service connectivity settings:\n\n1. [Go to Knative serving](https://console.cloud.google.com/kubernetes/run)\n\n2. Click on the desired service in the displayed list of services for your\n project to open the service details view.\n\n3. Click the **Triggers** tab.\n\n4. Select the desired setting and click **Save**.\n\n### Command line\n\nTo change service connectivity settings, update the service with the desired\nconnectivity setting: \n\n gcloud run services update [SERVICE] --connectivity=[OPTION]\n\n- Replace `[SERVICE]` with the name of the service you are updating.\n You can omit this parameter entirely, but you will be prompted for the\n service name if you omit it.\n\n- Replace `[OPTION]` with `internal` or `external`.\n\nDeleting existing services\n--------------------------\n\nDeleting a service deletes all resources related to this service, including all\nrevisions of this service whether they are serving traffic or not.\n\nWhen deleting a service, the container images used by the deleted revisions are not\ndeleted automatically from Container Registry. To delete container images from\nContainer Registry see [Deleting images](/container-registry/docs/managing#deleting_images).\n\nNote that deleting a service is permanent: there is no undo or restore.\nHowever, if after deleting a service, you deploy a new service with the same\nname in the same cluster, it will have the same endpoint URL. \n\n### Console\n\nTo delete a service:\n\n1. [Go to Knative serving](https://console.cloud.google.com/kubernetes/run)\n\n2. Locate the service you want to delete in the services list, and click\n its checkbox to select it.\n\n3. Click **DELETE**. This deletes all revisions of the service.\n\n### Command line\n\nTo delete a service, use the command: \n\n gcloud run services delete [SERVICE]\n\nReplace `[SERVICE]` with the name of your service."]]