[[["易于理解","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-02。"],[[["\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\u003eFor organization-scoped resources, the \u003ccode\u003eorganizationRef\u003c/code\u003e field can be used within the CRD spec to specify the Google Cloud organization.\u003c/p\u003e\n"],["\u003cp\u003eIf a resource does not support \u003ccode\u003eorganizationRef\u003c/code\u003e, the \u003ccode\u003eorganization-id\u003c/code\u003e annotation in the resource configuration can be used to specify the organization ID.\u003c/p\u003e\n"],["\u003cp\u003eYou can set a default organization ID for all new resources within a namespace by annotating the namespace itself, but individual resource annotations will override this.\u003c/p\u003e\n"],["\u003cp\u003eNot every resource is compatible with scope-defining fields and annotations, the resource reference page will confirm which ones are.\u003c/p\u003e\n"]]],[],null,["# Organization-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.organizationRef` field or `cnrm.cloud.google.com/organization-id` annotation.\n\nSpecify `organizationRef` field\n-------------------------------\n\nMost organization-scoped Config Connector resources support a field named `organizationRef`\nin its CRD spec. Use this field to specify the Google Cloud organization that you\nwant to create the resource in.\n\nYou can use the `external` field to specify the organization ID. The exact\nformat of the value may be different depending on the resource type. Two most\ncommon formats are \"\u003cvar translate=\"no\"\u003eORGANIZATION_ID\u003c/var\u003e\" and\n\"organizations/\u003cvar translate=\"no\"\u003eORGANIZATION_ID\u003c/var\u003e\".\nSee an example of \"\u003cvar translate=\"no\"\u003eORGANIZATION_ID\u003c/var\u003e\" below: \n\n ...\n spec:\n organizationRef:\n external: \"\u003cvar translate=\"no\"\u003eORGANIZATION_ID\u003c/var\u003e\"\n ...\n\nAnnotate resource configuration\n-------------------------------\n\nIf the Config Connector resource is organization-scoped but does not support\n`organizationRef` field, you can set the organization ID to the resource configuration\nusing the `organization-id` annotation: \n\n ...\n metadata:\n annotations:\n cnrm.cloud.google.com/organization-id: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eORGANIZATION_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/organization-id: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eORGANIZATION_ID\u003c/span\u003e\u003c/var\u003e\n name: foobarname\n\nAnnotate namespace configuration\n--------------------------------\n\nYou can set a default organization 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/organization-id=ORGANIZATION_ID\n```\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eNAMESPACE_NAME\u003c/var\u003e: your namespace name\n- \u003cvar translate=\"no\"\u003eORGANIZATION_ID\u003c/var\u003e: your Google Cloud organization 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/organization-id: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eORGANIZATION_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\"\u003eORGANIZATION_ID\u003c/var\u003e: your Google Cloud organization 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."]]