@RequestMapping("/greeting")@ResponseBodypublicStringgreeting(@RequestParam(value="name",defaultValue="World")Stringname){returnString.format("Hello from Kubernetes with IntelliJ, %s!",name);}
[[["わかりやすい","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-04 UTC。"],[[["\u003cp\u003eSkaffold enhances local development with file syncing for static files and hot reloading for source code, allowing changes to be reflected in seconds without rebuilding or restarting pods.\u003c/p\u003e\n"],["\u003cp\u003eAutomatic file syncing and hot reloading are enabled by default with Buildpacks, while other builders like Docker require a \u003ccode\u003esync\u003c/code\u003e section in the \u003ccode\u003eskaffold.yaml\u003c/code\u003e file for configuration.\u003c/p\u003e\n"],["\u003cp\u003eChanges to the application are deployed to the Kubernetes cluster without manual intervention when the development cycle is running.\u003c/p\u003e\n"],["\u003cp\u003eSkaffold modules allow for independent development and debugging of microservice sections by splitting an application into different modules, defining configuration dependencies, and selecting specific modules to build and deploy.\u003c/p\u003e\n"],["\u003cp\u003eThe "Develop on Kubernetes" run target starts the development cycle, allowing for automatic redeployment on file save and enabling the use of Skaffold modules to fine-tune the development process.\u003c/p\u003e\n"]]],[],null,["# Speed up development in Cloud Code for IntelliJ\n\nTo speed up your local development in Cloud Code for IntelliJ, take advantage of file\nsync and hot reloading, automatic deployment on save, and use Skaffold modules\nto develop portions of an application separately.\n\nEnable Skaffold file sync and hot reloading\n-------------------------------------------\n\nTo improve the efficiency of your local development workflow and avoid\nhaving to rebuild, redeploy, and restart your pods, [Skaffold](/skaffold) supports\ncopying changed files to a deployed container. This means that when you're making changes to static\nand source code files, you can see your changes take effect in seconds, making for an accelerated\nfeedback loop.\n\nFor static files (like HTML and CSS files), this file copying behavior is called\n**file syncing**.\n\nFor source code files, this behavior is called as **hot reloading** and supports\nthe following file types:\n\n- Go: \\*.go\n- Java: \\*.java, \\*.kt, \\*.scala, \\*.groovy, \\*.clj\n- NodeJS: \\*.js, \\*.mjs, \\*.coffee, \\*.litcoffee, \\*.json\n\nWith hot reloading configured, Skaffold detects changes to supported files and syncs these\nchanges to the running container on your cluster. Changes to file types that don't support hot\nreloading trigger an image rebuild and pod restart.\n\nAutomatic file-syncing and hot reloading are enabled by default when you're\nworking with Buildpacks as your preferred builder. For other builders like\nDocker, you can specify a `sync` section in your `skaffold.yaml` file for the\nartifact you're customizing.\n\nYour sync setting can be one of (in order of preference):\n\n- `auto`: Skaffold automatically configures the sync. (only for Jib and Buildpacks artifacts.) This is the default for Buildpacks.\n- `infer`: The destinations for each changed file are inferred from the builder.\n- `manual`: You must specify the files in your local workspace and their destination in the running container.\n\nThe following sample `sync` section in a `skaffold.yaml` file specifies a\n`manual` sync to synchronize all `/static-html` HTML files to the `static`\nfolder in a container: \n\n```yaml\nbuild:\n artifacts:\n - image: gcr.io/k8s-skaffold/node-example\n context: node\n sync:\n manual:\n - src: 'static-html/*.html'\n dest: static\n```\n\nFor a detailed look at file syncing and specifying sync rules, see the\n[Skaffold guide on file sync](https://skaffold.dev/docs/filesync/).\n\nAdd new features when developing on Kubernetes\n----------------------------------------------\n\nAfter setting up file sync and hot reloading, start an iteration cycle and add\nmore features to your project. Your changes are deployed to your Kubernetes\ncluster without stopping and removing the deployment, manually building and\ntagging the image, or updating the cluster.\n\nA standard iteration cycle resembles the following:\n\n1. Make a change in your project. For example, if using the\n Cloud Code Java Guestbook app, add a new endpoint to the\n `FrontendController` class as follows:\n\n 1. Open the `FrontendController.java` file from\n `src/main/java/cloudcode/guestbook/frontend` and add the following:\n\n @RequestMapping(\"/greeting\")\n @ResponseBody\n public String greeting(@RequestParam(value=\"name\", defaultValue=\"World\") String name) {\n return String.format(\"Hello from Kubernetes with IntelliJ, %s!\", name);\n }\n\n 2. Add the necessary imports for the new annotations, `RequestMapping` and\n `ResponseBody`.\n\n2. Save your changes (`Ctrl`/`Cmd+S`) or build the project.\n\n You can watch the progress and deployment logs in the console window.\n After the changes are deployed, confirm the updates.\n3. To end the continuous development session, click the **Stop** icon.\n\n Cloud Code deletes all Kubernetes resources used for the development session.\n\nDevelop microservices applications using Skaffold configurations\n----------------------------------------------------------------\n\nWhen developing microservice applications, it can be useful to work on separate\nsections independently to simplify debugging and deployment.\n\nYou can develop and debug parts of your application independently by splitting\nyour application into [Skaffold modules](/code/docs/intellij/skaffold-modules). For example, the\n[Bank of Anthos](https://github.com/GoogleCloudPlatform/bank-of-anthos) sample\nis an application containing ten microservices. The sample's\n[`skaffold.yaml`](https://github.com/GoogleCloudPlatform/bank-of-anthos/blob/main/skaffold.yaml)\nfile groups these services into five skaffold modules named `setup`, `db`,\n`frontend`, `backend`, and `loadgenerator`.\n\n### Define Skaffold modules and configuration dependencies\n\nTo define Skaffold modules and configuration dependencies:\n\n1. Open the project where you want to define the modules.\n\n2. Open the `skaffold.yaml` file.\n\n3. If your `skaffold.yaml` file has multiple configurations, to make a\n configuration a Skaffold module, specify the following line:\n\n metadata:\n name: MODULE_NAME_1\n\n For example, in the Bank of Anthos `skaffold.yaml`, the `db` module defines\n database deployments: \n\n apiVersion: skaffold/v3\n kind: Config\n metadata:\n name: db # module defining database deployments\n requires:\n - configs:\n - setup\n build:\n artifacts:\n - image: accounts-db\n context: src/accounts-db\n - image: ledger-db\n context: src/ledger-db\n manifests:\n rawYaml:\n - dev-kubernetes-manifests/accounts-db.yaml\n - dev-kubernetes-manifests/ledger-db.yaml\n deploy:\n kubectl: {}\n\n4. For configurations that rely on another configuration being deployed before\n the current configuration can be deployed, you must add the config to your\n dependencies. To specify a config dependency, add a `configs` list to the\n `requires` section of your `skaffold.yaml` file.\n\n For example, the Bank of Anthos `skaffold.yaml` file includes the\n configuration dependency `setup`.\n\n To define a dependency, add the following to your `skaffold.yaml` file where\n \u003cvar translate=\"no\"\u003eDEPENDENCY_NAME\u003c/var\u003e is the name of your dependency. \n\n requires:\n - configs: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-n\"\u003eDEPENDENCY_NAME\u003c/span\u003e\u003c/var\u003e\n\n Configurations listed this way can reference dependencies defined in the\n same file or other `skaffold.yaml` files in the current project.\n5. Test your configuration dependencies by building each of the Skaffold\n modules separately to make sure that they're deployed with their\n dependencies by following the steps in\n [Build specific Skaffold modules and their dependencies](#build_skaffold_modules).\n\n### Build specific Skaffold modules and their dependencies\n\nAfter you've defined your modules and their dependencies, you can specify which modules you want to run in the **Build / Deploy** tab when you select **Run** \\\u003e **Edit configurations** .\n\n\u003cbr /\u003e\n\n| **Note:** If a Skaffold project has no modules, including older Skaffold configurations, no additional configuration is required and only the **Build and\n| deploy with all dependencies** option is available.\n\n1. Install the latest [Insiders builds](/code/docs/intellij/insiders#get).\n\n2. Go to **Run** \\\u003e **Edit configurations** and open the **Build / Deploy** tab.\n\n3. For **Skaffold configuration**, select skaffold.yaml.\n\n Choose one of the following:\n - **Build and deploy with all modules and dependencies**\n - **Build and deploy with** (if modules are available) and select the modules you want to build and deploy.\n\nYour selection persists for subsequent deployments. If you select a subset of\nmodules, Cloud Code displays a warning about deploying a subset\nof modules and not the whole system.\n\nContinuous development on Kubernetes\n------------------------------------\n\nOnce you have configured your run target with the options you want, you can\neither opt for a regular run of your application or start a development\niteration cycle on your IDE to propagate any changes made to your source and\ndependencies to your live application.\n\nThe **Develop on Kubernetes** run target starts the development cycle on your\nKubernetes cluster. After you start the development cycle,\nCloud Code, using [Skaffold](/skaffold), builds an image for the\nproject, and then tags it, pushes it to the configured repository, and uses\nkubectl to deploy the project Kubernetes manifests.\n\n1. Click the **Develop on Kubernetes** icon and then click **Edit Configurations** to open the **Run/Debug Configurations** dialog.\n2. Customize your deployment using the [available configuration options](/code/docs/intellij/k8s-overview#customize_your_launch_configuration).\n3. If you want Cloud Code to redeploy your application automatically after your changes are saved, under **Watch mode - rebuild and\n redeploy** , select **On file save** . New Kubernetes applications have **On demand** selected by default. For more information about watch modes, see [Watch modes](/code/docs/intellij/watch-modes).\n4. If your application is configured to use [Skaffold modules](/code/docs/intellij/skaffold-modules), you can [select to only build or deploy specific modules](#build_skaffold_modules).\n5. After you're satisfied with your configuration, click **OK** and then click the **Run** icon.\n\nWhat's next\n-----------\n\n- Use Cloud Code's built in [minikube cluster](/code/docs/intellij/minikube-local-development) for local development.\n- [Debug your application in Cloud Code](/code/docs/intellij/debug)\n- Read the details on [Skaffold's file sync feature](https://skaffold.dev/docs/filesync/)\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)."]]