[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["わかりにくい","hardToUnderstand","thumb-down"],["情報またはサンプルコードが不正確","incorrectInformationOrSampleCode","thumb-down"],["必要な情報 / サンプルがない","missingTheInformationSamplesINeed","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-09-01 UTC。"],[],[],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](/kubernetes-engine/enterprise/knative-serving/docs/managing/revisions) by\ndeploying a container image to it for the first time. See\n[Deploying a new service](/kubernetes-engine/enterprise/knative-serving/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 in the Google Cloud console:\n\n [Go to Knative serving](https://console.cloud.google.com/kubernetes/run)\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](/kubernetes-engine/enterprise/knative-serving/docs/configuring/labels#label-listing).\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 in the Google Cloud console:\n\n [Go to Knative serving](https://console.cloud.google.com/kubernetes/run)\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 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](/kubernetes-engine/enterprise/knative-serving/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 run services replace service.yaml\n ```\n\n Use the [`--region`](/sdk/gcloud/reference/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 in the Google Cloud console:\n\n [Go to Knative serving](https://console.cloud.google.com/kubernetes/run)\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](/kubernetes-engine/enterprise/knative-serving/docs/logging),\n and the details tab shows the current\n [authentication](/kubernetes-engine/enterprise/knative-serving/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\nFor details about the revisions of a service, see\n[Managing Revisions](/kubernetes-engine/enterprise/knative-serving/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 services in your cluster.\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 in the Google Cloud console:\n\n [Go to Knative serving](https://console.cloud.google.com/kubernetes/run)\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 in the Google Cloud console:\n\n [Go to Knative serving](https://console.cloud.google.com/kubernetes/run)\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."]]