[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-04。"],[[["\u003cp\u003eCloud Code offers editing support for Google Cloud and Kubernetes configuration files, including schema validation, diagnostics, and quick documentation.\u003c/p\u003e\n"],["\u003cp\u003eIt provides out-of-the-box support for multiple YAML configuration file types, including Anthos Config Management, Cloud Build, Config Connector, Knative, Kubernetes, Kustomize, Migrate to Containers, and Skaffold.\u003c/p\u003e\n"],["\u003cp\u003eCloud Code allows users to use custom CRD schemas by pointing to local files or URLs, and it can automatically pull schemas from clusters running Kubernetes v1.16+.\u003c/p\u003e\n"],["\u003cp\u003eSkaffold is integrated as the underlying engine, and Cloud Code includes support for Skaffold configuration files, including detecting and prompting for schema upgrades.\u003c/p\u003e\n"],["\u003cp\u003eUsers can use snippets for common YAML schemas, validate YAML files, perform dry-runs, and compare differences between deployed and source-controlled YAML files, using the actions in the IDE gutter.\u003c/p\u003e\n"]]],[],null,["# Work with Google Cloud and Kubernetes YAML files in Cloud Code for IntelliJ\n\nCloud Code is designed to help with editing Google Cloud and\nKubernetes-related configuration files, including schema based validation,\ndiagnostics, and quick documentation.\n| **Note:** For compatibility reasons, Kubernetes editing features are automatically disabled if the JetBrains Kubernetes plugin is detected. Manually override this in the Cloud Code settings menu by navigating to **Cloud Code** \\\u003e **Kubernetes** \\\u003e **Kubernetes editing features** and toggling the **Enable Kubernetes YAML\n| configuration editing features** setting. These compatibility measures only affect Kubernetes YAML files. Support for other types of YAML configuration file types such as [Skaffold](/skaffold) are not affected.\n| **Note:** Cloud Build YAML editing support is only available for files named `cloudbuild.yaml`\n\nSupported YAML configuration files\n----------------------------------\n\n- [Anthos Config Management](/anthos-config-management/docs/how-to/configs)\n- [Cloud Build](/build/docs/build-config)\n- [Config Connector](/config-connector/docs/overview)\n- [Knative](https://knative.dev/docs/)\n- [Kubernetes](https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/)\n- [Kustomize](https://github.com/kubernetes-sigs/kustomize)\n- [Migrate to Containers](/migrate/containers/docs/getting-started)\n- [Skaffold](https://skaffold.dev/docs/references/yaml/)\n\nCloud Code also supports popular Kubernetes CRDs, like\n[Kubeflow](https://www.kubeflow.org/docs/about/kubeflow/), out-of-the-box.\n| **Note:** To use the most up-to-date resource aggregation, you'll need the latest version of Cloud Code.\n\n### Enable or disable YAML support\n\nTo enable or disable YAML support, navigate to **File** \\\u003e\n**Settings** \\\u003e **Tools** \\\u003e **Gemini + Google Cloud Code**\n\\\u003e **Kubernetes** (for Windows and Linux) or **IntelliJ IDEA**\n\\\u003e **Settings** \\\u003e **Tools** \\\u003e **Gemini + Google\nCloud Code** \\\u003e **Kubernetes** (for macOS) and select or clear the\n**Enable YAML support** checkbox to enable or disable the feature.\n\n### Use custom schema\n\nWith Cloud Code, you can provide your own CRD schema with IntelliJ\nsettings by navigating to **File** \\\u003e **Settings** \\\u003e\n**Tools** \\\u003e **Gemini + Google Cloud Code** \\\u003e\n**Kubernetes** (For Windows and Linux) or **IntelliJ IDEA** \\\u003e\n**Settings** \\\u003e **Tools** \\\u003e **Gemini + Google Cloud Code**\n\\\u003e **Kubernetes** (for macOS) and then refer to the **CRD schema\nlocations** section.\n\nYou can point to either a local file or a URL. URLs pointing to `github.com` are\nautomatically converted to `raw.githubusercontent.com`.\n\n### Pull schema from a cluster\n\nWhen you switch to a cluster running Kubernetes `v1.16+` in the\n[Kubernetes Explorer](/code/docs/intellij/use-kubernetes-explorer#clusters),\nCloud Code automatically pulls the schema of all installed CRDs.\n\n### Additional Skaffold support\n\n[Skaffold](/skaffold) is the underlying engine that powers\nCloud Code, helping you build, push, and deploy your application\nas well as providing support for creating CI/CD pipelines.\n\nCloud Code comes with additional support for managing Skaffold\nconfiguration files. When you open a project, Cloud Code detects\nSkaffold schemas that aren't up-to-date and prompts you (through the Event Log)\nwhen a Skaffold schema version upgrade is available for your existing Skaffold\nYAML configuration files.\n\nAlternatively, you can navigate to **Tools** \\\u003e **Gemini + Cloud\nCode** \\\u003e **Kubernetes** \\\u003e **Check for Skaffold Schemas\nUpgrades** to check for available schema upgrades.\n\nConfigure with snippets\n-----------------------\n\nOut-of-the-box snippets for common YAML schema (using \u003ckbd\u003eCtrl+Space\u003c/kbd\u003e to\nview options) allow you to start a new YAML file or add to an existing one\nwithout errors, while still following best practices. Additionally, it's easier\nto work with repetitive fields; fill in one and Cloud Code fills\nout the remaining instances.\n\nCloud Code offers the following snippets:\n\n- `Cloud Build - Cloud Run deployment`\n- `Cloud Build - Docker container build`\n- `Cloud Build - GKE deployment`\n- `Cloud Build - GKE Skaffold deployment`\n- `Cloud Build - Go build`\n- `Cloud Build - Terraform plan + apply`\n- `Config Connector - BigQueryDataset`\n- `Config Connector - BigQueryTable`\n- `Config Connector - BigtableCluster`\n- `Config Connector - BigtableInstance`\n- `Config Connector - PubSubSubscription`\n- `Config Connector - PubSubTopic`\n- `Config Connector - RedisInstance`\n- `Config Connector - SpannerInstance`\n- `Kubernetes - ConfigMap`\n- `Kubernetes - Deployment`\n- `Kubernetes - Ingress`\n- `Kubernetes - Pod`\n- `Kubernetes - Service`\n- `Migrate to Containers - Export`\n- `Migrate to Containers - PersistentVolumeClaim`\n- `Migrate to Containers - StatefulSet`\n- `Skaffold - Bazel`\n- `Skaffold - Getting-started`\n- `Skaffold - Helm deployment`\n- `Skaffold - Kaniko`\n\nComplete with context\n---------------------\n\nBased on the current schema, Cloud Code provides contextual\ncompletions to help you choose the right option.\n\nValidate YAML schema\n--------------------\n\nCloud Code offers schema validation support by flagging invalid\ntags and values in your YAML files and suggesting fixes when possible.\n\nValidate Skaffold YAML files\n----------------------------\n\nCloud Code provides additional Skaffold configuration file editing\nsupport and smart templates which allow you to validate your `skaffold.yaml`\nfiles. Refer to this [guide on using an existing app with Cloud Code](/code/docs/intellij/use-k8s-existing-app).\n\nComplete Skaffold configuration files with context\n--------------------------------------------------\n\nBased on the current schema, Cloud Code provides contextual\ncompletions and relevant documentation to help you choose the right option.\n\nDiscover definitions using quick documentation\n----------------------------------------------\n\nCloud Code surfaces relevant documentation for a resource when you\nhighlight a line in your configuration file and navigate to **View**\n\\\u003e **Quick Documentation**.\n\nLint YAML for structural and validity issues\n--------------------------------------------\n\nCloud Code provides linting support around common schema issues\nand provides descriptive errors.\n\nApply a YAML file\n-----------------\n\nTo run `kubectl apply -f` to apply a configuration change using the current\nfile, you can use the kubectl actions icon\n,\navailable in the gutter of your IDE, and select **Apply** . This brings up a diff\nview for you to review changes before clicking **Apply**.\n\nDiff between YAML files\n-----------------------\n\nTo view the differences between a YAML file in source control and a deployed\nYAML file, you can use the kubectl actions icon\n\navailable in the gutter of your editor. Select the **Diff** option to see a diff\nview for you to compare and contrast two schema files.\n\nPerform a dry-run of a YAML file\n--------------------------------\n\nTo perform a dry run of your file and check its validity, you can use the\nkubectl actions icon\n,\navailable in the gutter of your IDE, to select **Dry-run on Server**\nor **Dry-run on Client** . This runs `kubectl apply -f dry-run=server`\n(or `kubectl apply -f dry-run=client`, for the Client option) and notifies you\nif your file can successfully be created in your Terminal window.\n\nWhat's next\n-----------\n\n- Create a [Cloud Code Kubernetes run configuration](/code/docs/intellij/use-k8s-existing-app#set_up_kubernetes_run_configuration) `skaffold.yaml` file.\n- Manually create a [Skaffold configuration](/code/docs/intellij/use-k8s-existing-app#manually_create_a_skaffold_configuration) for your application.\n- View the [`Skaffold.yaml` reference docs](https://skaffold.dev/docs/references/yaml/).\n\nGet support\n-----------\n\nTo submit feedback or report an issue in your IntelliJ IDE, go to **Tools** \\\u003e **Cloud Code** \\\u003e **Help / About** \\\u003e **Submit\nfeedback or report an issue** to report an issue on [GitHub](https://github.com/GoogleCloudPlatform/cloud-code-intellij/issues)."]]