이 접근 방식을 사용하면 구성 커넥터를 사용하고 단일 적용 작업으로 하위 리소스가 포함된 Google Cloud 폴더를 만들 수 있습니다.
구성 커넥터 폴더 리소스가 폴더 범위 리소스와 동일한 Kubernetes 네임스페이스에 있는 경우 네임스페이스 필드는 선택사항입니다.
동일한 클러스터에서 Google Cloud 폴더가 Kubernetes 리소스로 관리되지 않는 경우 external 필드를 사용하여 폴더 ID를 직접 지정할 수 있습니다. 값의 정확한 형식은 리소스 유형에 따라 다를 수 있습니다. 가장 일반적인 두 가지 형식은 'FOLDER_ID'과 'folders/FOLDER_ID'입니다. 아래에서 'FOLDER_ID'의 예를 참고하세요.
...spec:folderRef:external:"FOLDER_ID"...
리소스 구성에 주석 달기
구성 커넥터 리소스가 폴더 범위이지만 folderRef 필드를 지원하지 않는 경우 folder-id 주석을 사용하여 폴더 ID를 리소스 구성에 설정할 수 있습니다.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2024-12-21(UTC)"],[[["\u003cp\u003eConfig Connector manages resources at the project, folder, or organization level, determining the resource's creation location through a scope-defining field or annotation.\u003c/p\u003e\n"],["\u003cp\u003eMost folder-scoped resources use the \u003ccode\u003efolderRef\u003c/code\u003e field in their CRD spec to specify the Google Cloud folder, either by referencing a Kubernetes-managed Folder resource or directly specifying the folder ID via the \u003ccode\u003eexternal\u003c/code\u003e field.\u003c/p\u003e\n"],["\u003cp\u003eFor folder-scoped resources without the \u003ccode\u003efolderRef\u003c/code\u003e field, you can use the \u003ccode\u003ecnrm.cloud.google.com/folder-id\u003c/code\u003e annotation within the resource's metadata to designate the folder ID.\u003c/p\u003e\n"],["\u003cp\u003eYou can apply a default folder ID to all newly created resources within a Kubernetes namespace by using the annotation \u003ccode\u003ecnrm.cloud.google.com/folder-id=FOLDER_ID\u003c/code\u003e at the namespace level, which can be overwritten by a resource-level annotation if needed.\u003c/p\u003e\n"]]],[],null,["# Folder-scoped resources\n=======================\n\n*** ** * ** ***\n\nConfig Connector can manage your resources at the project, folder, or\norganization level. In order for Config Connector to determine where to create\nyour resources, it first checks for a [scope-defining field](/config-connector/docs/how-to/organizing-resources/overview#scope-defining_field)\nin your resource spec, if not found, then checks for a [scope-defining annotation](/config-connector/docs/how-to/organizing-resources/overview#scope-defining_annotation).\n| **Note:** The scope concept does not apply to all Config Connector resources. See [Exceptions](/config-connector/docs/how-to/organizing-resources/overview#exceptions) for more details. You can check the [resource reference page](/config-connector/docs/reference/resources) to see if a resource supports the `spec.folderRef` field or `cnrm.cloud.google.com/folder-id` annotation.\n\nSpecify `folderRef` field\n-------------------------\n\nMost folder-scoped Config Connector resources support a field named `folderRef`\nin its CRD spec. Use this field to specify the Google Cloud folder you\nwant to create the resource in.\n\nIf the Google Cloud folder is also being managed in the same cluster via\nthe [Folder](/config-connector/docs/reference/resource-docs/resourcemanager/folder)\nCRD, you can specify the folder as a Kubernetes resource reference: \n\n ...\n spec:\n folderRef:\n name: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eFOLDER_RESOURCE_NAME\u003c/span\u003e\u003c/var\u003e\n namespace: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eFOLDER_RESOURCE_NAMESPACE\u003c/span\u003e\u003c/var\u003e\n ...\n\nThis approach makes it possible to use Config Connector and create a Google Cloud\nfolder with its child resources in one single apply operation.\nThe namespace field is optional if the Config Connector Folder resource is in\nthe same Kubernetes namespace as your folder-scoped resource.\n\nIf the Google Cloud folder is not being managed as a Kubernetes resource\nin the same cluster, you can use the `external` field to directly specify the\nfolder ID. The exact format of the value may be different depending on the\nresource type. Two most common formats are \"\u003cvar translate=\"no\"\u003eFOLDER_ID\u003c/var\u003e\" and\n\"folders/\u003cvar translate=\"no\"\u003eFOLDER_ID\u003c/var\u003e\". See an example of \"\u003cvar translate=\"no\"\u003eFOLDER_ID\u003c/var\u003e\" below: \n\n ...\n spec:\n folderRef:\n external: \"\u003cvar translate=\"no\"\u003eFOLDER_ID\u003c/var\u003e\"\n ...\n\nAnnotate resource configuration\n-------------------------------\n\nIf the Config Connector resource is folder-scoped but does not support the\n`folderRef` field, you can set the folder ID to the resource configuration\nusing the `folder-id` annotation: \n\n ...\n metadata:\n annotations:\n cnrm.cloud.google.com/folder-id: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eFOLDER_ID\u003c/span\u003e\u003c/var\u003e\n ...\n\nHere is an example of what a resource's YAML will look like with this annotation\nin it: \n\n apiVersion: foo.cnrm.cloud.google.com/v1beta1\n kind: FooBar\n metadata:\n annotations:\n cnrm.cloud.google.com/folder-id: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eFOLDER_ID\u003c/span\u003e\u003c/var\u003e\n name: foobarname\n\nAnnotate namespace configuration\n--------------------------------\n\nYou can set a default folder ID for newly-created resources by\nannotating your Kubernetes namespace. If any of the resources in the namespace\nhave this annotation explicitly set in its own configuration, the resource-level\nannotation overwrites the namespace-level annotation.\n\nTo annotate the namespace using command line, run the following command: \n\n```\nkubectl annotate namespace NAMESPACE_NAME cnrm.cloud.google.com/folder-id=FOLDER_ID\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eNAMESPACE_NAME\u003c/var\u003e: your namespace name\n- \u003cvar translate=\"no\"\u003eFOLDER_ID\u003c/var\u003e: your Google Cloud folder ID\n\nAlternatively, you can apply a YAML manifest containing the annotation.\nCopy the YAML below into a file: \n\n apiVersion: v1\n kind: Namespace\n metadata:\n annotations:\n cnrm.cloud.google.com/folder-id: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eFOLDER_ID\u003c/span\u003e\u003c/var\u003e\n name: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eNAMESPACE_NAME\u003c/span\u003e\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eFOLDER_ID\u003c/var\u003e: your Google Cloud folder ID\n- \u003cvar translate=\"no\"\u003eNAMESPACE_NAME\u003c/var\u003e: your namespace name\n\nAfter you have created the file, apply it to your cluster.\n| **Note:** You must create the namespace and annotation before applying any resources into the namespace."]]