kf push를 통해 앱을 Kf로 푸시하는 경우 Kf가 소스 코드를 가져온 후 이를 이용한 트래픽 처리를 허용하는 데 사용되는 3가지의 수명 주기가 있습니다.
소스 코드 업로드
빌드
실행
소스 코드 업로드
kf push가 발생하면 Kf CLI(kf)는 가장 먼저 디렉터리(현재 또는 --path/-p)를 컨테이너로 패키징하여 Space에 구성된 컨테이너 레지스트리에 게시합니다. 이를 소스 컨테이너라고 합니다. 그런 다음 Kf CLI는 앱 매니페스트와 푸시 플래그의 소스 이미지 및 구성을 둘 다 포함하는 Kubernetes에 App 유형을 만듭니다.
푸시 중 파일 무시
대부분의 경우 kf push 중에 특정 파일을 업로드하지 않는 것이 좋습니다(예 : 이를 '무시'함).
이 경우에 .kfignore 또는 .cfignore 파일을 사용할 수 있습니다.
.gitignore 파일과 마찬가지로 이 파일은 소스 코드 컨테이너에 포함하지 않을 파일을 Kf CLI에 지시합니다.
.kfignore 파일을 만들려면 앱의 기본 디렉터리(매니페스트 파일을 저장할 위치와 유사함)에 .kfignore라는 텍스트 파일을 만듭니다. 그런 다음 줄바꿈으로 구분된, 게시하고 싶지 않은 파일 및 디렉토리의 목록으로 채웁니다. 예를 들면 다음과 같습니다.
bin.idea
이렇게 하면 Kf CLI에서는 bin 또는 .idea 디렉터리에 아무것도 포함하지 않습니다.
kf는 앱 푸시 중에 CLI가 타임아웃 하도록 지시하는 환경 변수 설정을 지원합니다. 이 변수를 설정하면 KF_STARTUP_TIMEOUT 또는 CF_STARTUP_TIMEOUT 변수가 Golang 스타일 기간(예를 들면 15m, 1h)으로 파싱됩니다. 값이 설정되지 않은 경우 푸시 시간 제한은 기본적으로 15분입니다.
[[["이해하기 쉬움","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)"],[],[],null,["# Deploy an application\n\nWhen pushing an app (via `kf push`) to Kf, there are\nthree lifecycles that Kf uses to take your source code\nand 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### Ignore 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 that 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.11/how-to/build-runtime).\n\nRun\n---\n\nThe Run lifecycle is responsible for taking a container image and creating a\n[Kubernetes Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/).\n\nIt also creates:\n\n- [Istio Virtual Services](https://istio.io/docs/reference/config/networking/virtual-service/)\n- [Kubernetes Secrets](https://kubernetes.io/docs/concepts/configuration/secret/)\n\nMore information can be found at [Build runtime](/migrate/kf/docs/2.11/how-to/build-runtime).\n\nPush timeouts\n-------------\n\nKf supports setting an environment variable to instruct the CLI to time out\nwhile pushing apps. If set, the variables `KF_STARTUP_TIMEOUT` or\n`CF_STARTUP_TIMEOUT` are parsed as a golang style duration (for example `15m`,\n`1h`). If a value is not set, the push timeout defaults to 15 minutes."]]