[[["易于理解","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。"],[],[],null,["# Deploying an Application\n\nWhen pushing an app (via `kf push`) to Kf, there are three lifecycles\nthat Kf uses to take your source code and allow it to handle traffic:\n\n1. Source code upload\n2. Build\n3. Run\n\nSource Code Upload\n------------------\n\nThe first thing that happens when you `kf push` is the Kf CLI (`kf`) packages\nup your directory (either current or `--path/-p`) into a container and\npublishes it to the container registry configured for the Space. This is\ncalled the source container. The Kf CLI then creates an `App` type in Kubernetes\nthat contains both the source image and configuration from the App manifest and\npush flags.\n\n### Ignoring files during push\n\nIn many cases, you will not want to upload certain files during `kf push` (i.e., \"ignore\" them).\nThis is where a `.kfignore` (or `.cfignore`) file can be used.\nSimilar to a `.gitignore` file, this file instructs the Kf CLI which\nfiles to not include in the source code container.\n\nTo create a `.kfignore` file, create a text file named `.kfignore` in the base\ndirectory of your app (similar to where you would store the manifest\nfile). Then populate it with a newline delimited list of files and directories\nyou don't want published. For example: \n\n bin\n .idea\n\nThis will tell the Kf CLI to not include anything in the `bin` or `.idea`\ndirectories.\n\nKf supports [gitignore](https://git-scm.com/docs/gitignore) style syntax.\n\nBuild\n-----\n\nThe Build lifecycle is handled by a Tekton\n[TaskRun](https://github.com/tektoncd/pipeline/blob/master/docs/taskruns.md).\nDepending on the flags you provide while pushing, it will choose a specific\nTekton [Task](https://github.com/tektoncd/pipeline/blob/master/docs/tasks.md).\nKf currently has the following Tekton Tasks:\n\n- buildpackv2\n- buildpackv3\n- kaniko\n\nKf tracks each TaskRun as a Build. If a Build succeeds, the resulting\ncontainer image is then deployed via the Run lifecycle (described below).\n\nMore information can be found at [Build Runtime](/migrate/kf/docs/2.2/how-to/build-runtime).\n\nRun\n---\n\nThe Run lifecycle is responsible for taking a container image and creating a\n[Kubernetes\nDeployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/).\n\nIt also creates:\n\n- [Istio Virtual\n Services](https://istio.io/docs/reference/config/networking/virtual-service/)\n- [Kubernetes\n Secrets](https://kubernetes.io/docs/concepts/configuration/secret/)\n\nMore information can be found at [Build Runtime](/migrate/kf/docs/2.2/how-to/build-runtime)."]]