구조화되지 않은 저장소를 사용하면 자신에게 가장 편리한 방법으로 저장소를 조직화할 수 있습니다. 이러한 유연성을 통해 기존 Kubernetes 구성을 구성 동기화 저장소에 동기화할 수 있습니다. 예를 들어 Helm 차트를 클러스터에 동기화하려면 helm template 명령어를 실행하고 렌더링된 매니페스트를 저장소에 커밋합니다. 자세한 내용은 Helm에 구성 동기화 사용 튜토리얼을 참조하세요.
대부분의 사용 사례에는 구조화되지 않은 저장소를 사용하는 것이 좋습니다. 하지만 구성을 고유 카테고리로 구분하기 위해 계층적 저장소를 만들 수도 있습니다.
nomos vet 명령어를 사용하는 경우 --source-format=unstructured 플래그를 추가하세요. 예를 들면 다음과 같습니다.
nomosvet--source-format=unstructured
네임스페이스 범위의 객체
구조화되지 않은 저장소에서 NamespaceSelectors를 선언할 수 있습니다. NamespaceSelector를 선언하려면 metadata.namespace 또는 NamespaceSelector 주석을 추가합니다. 두 주석을 모두 선언해서는 안 됩니다. 네임스페이스 범위의 리소스가 metadata.namespace 또는 NamespaceSelector 주석을 선언하지 않으면 구성 동기화는 클러스터의 '기본' 네임스페이스를 사용합니다.
자세한 내용은 구성 영향을 받는 네임스페이스 제한을 참조하세요.
클러스터 범위의 객체
구조화되지 않은 저장소에서 ClusterSelectors는 정상적으로 작동합니다.
구조화되지 않은 저장소 구성
구조화되지 않은 저장소를 구성하려면 RootSync 객체에서 spec.sourceFormat 값을 unstructured로 설정합니다.
이 예시에서 원시 구성은 raw-configs 디렉터리에 있습니다. 그런 다음 스크립트 또는 자동화된 파이프라인을 사용하여 원시 구성을 렌더링하고 manifests 디렉터리에 출력을 저장할 수 있습니다. 구성 동기화를 구성할 때는 manifests 디렉터리에서 동기화하도록 구성합니다.
[[["이해하기 쉬움","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-01(UTC)"],[],[],null,["# Use an unstructured repository\n\nUsing an *unstructured repository* lets you organize your repository in the way that is most\nconvenient to you. This flexibility lets you sync your existing Kubernetes\nconfiguration to your Config Sync repository. For example, if you want to sync a\n[Helm](https://helm.sh/) chart to your cluster, you can run the\n[`helm template`](https://helm.sh/docs/helm/helm_template/) command\nand commit the rendered manifest to your repository. For more information,\nsee the [Using Config Sync with Helm](/kubernetes-engine/enterprise/config-sync/docs/tutorials/config-sync-helm)\ntutorial.\n\nWe recommend unstructured repos for most use cases. However, you can also create\na [hierarchical repository](/kubernetes-engine/enterprise/config-sync/docs/concepts/hierarchical-repo) to\nseparate configs into distinct categories.\n\nLimitations\n-----------\n\nUnstructured repositories have the following limitations:\n\n- You cannot use the\n [`HierarchyConfig`](/kubernetes-engine/enterprise/config-sync/docs/how-to/namespace-scoped-objects#disabling_inheritance_for_an_object_type)\n Kubernetes object in an unstructured repository.\n\n- [Abstract namespaces](/kubernetes-engine/enterprise/config-sync/docs/concepts/hierarchical-repo#namespace-inheritance) are not\n supported in unstructured repositories.\n\n- If you are using the\n [`nomos vet` command](/kubernetes-engine/enterprise/config-sync/docs/how-to/nomos-command#vet), add\n the `--source-format=unstructured` flag. For example:\n\n nomos vet --source-format=unstructured\n\nNamespace-scoped objects\n------------------------\n\nYou can declare NamespaceSelectors in an unstructured repository. To declare a\nNamespaceSelector, add either the `metadata.namespace` or the `NamespaceSelector`\nannotation. Declaring both annotations is invalid. If namespace-scoped\nresources don't declare `metadata.namespace` or the `NamespaceSelector`\nannotation, then Config Sync uses the \"default\" namespace of the cluster.\nTo learn more, see [Limit which namespaces a config affects](/kubernetes-engine/enterprise/config-sync/docs/how-to/namespace-scoped-objects#namespaceselectors).\n\nCluster-scoped objects\n----------------------\n\nIn an unstructured repository, `ClusterSelectors` function normally.\n\nConfigure an unstructured repository\n------------------------------------\n\nTo configure an unstructured repository, set the value of `spec.sourceFormat` to\n`unstructured` in your RootSync object: \n\n # root-sync.yaml\n apiVersion: configsync.gke.io/v1beta1\n kind: RootSync\n metadata:\n name: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eROOT_SYNC_NAME\u003c/span\u003e\u003c/var\u003e\n namespace: config-management-system\n spec:\n sourceFormat: unstructured\n git:\n repo: https://github.com/GoogleCloudPlatform/anthos-config-management-samples\n branch: main\n dir: config-sync-quickstart/multirepo/root\n auth: ssh\n secretRef:\n name: \u003cvar translate=\"no\"\u003e\u003cspan class=\"devsite-syntax-l devsite-syntax-l-Scalar devsite-syntax-l-Scalar-Plain\"\u003eSECRET_NAME\u003c/span\u003e\u003c/var\u003e\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eROOT_SYNC_NAME\u003c/var\u003e: add the name of your RootSync object. The name should be unique in the cluster and have no more than 26 characters.\n- \u003cvar translate=\"no\"\u003eSECRET_NAME\u003c/var\u003e with the name of the Secret.\n\nConvert a hierarchical repository to an unstructured repository\n---------------------------------------------------------------\n\nIf you're using a [hierarchical repository](/kubernetes-engine/enterprise/config-sync/docs/concepts/hierarchical-repo)\nand want to convert it to an [unstructured repository](/kubernetes-engine/enterprise/config-sync/docs/how-to/unstructured-repo),\nin your repository, run: \n\n```\nnomos hydrate PATH\n```\n\nReplace \u003cvar translate=\"no\"\u003ePATH\u003c/var\u003e with the path to your directory.\n\nThis command creates a `compiled/` directory in the current working directory. Within\nthat directory, a subdirectory is created for each enrolled cluster, with the\nfully resolved configs, and each subdirectory can be used in an unstructured\nrepository.\n\nFor more details, see [`nomos` commands](/kubernetes-engine/enterprise/config-sync/docs/how-to/nomos-command#hydrate).\n\nIf you prefer converting your repository manually, complete the following\ninstructions:\n\n1. Remove `Repo` configs in the `system/` directory from your Git repository.\n The `Repo` resource is not needed for an unstructured repository.\n\n2. The [abstract namespace directory](/kubernetes-engine/enterprise/config-sync/docs/concepts/hierarchical-repo#namespace-inheritance)\n isn't supported in an unstructured repository. Therefore, you must declare the\n namespace of all resources originally included in the `namespaces/` directory and\n its subdirectories.\n\n3. [Namespace inheritance](/kubernetes-engine/enterprise/config-sync/docs/concepts/hierarchical-repo#namespace-inheritance)\n isn't supported in the unstructured repository. Therefore, you must declare all\n resources that are originally inherited in descendant namespaces, namely the\n ones originally under the `namespaces/` directory.\n\nExample format for an unstructured repository\n---------------------------------------------\n\nThe following example demonstrates how you might organize your configs\n(including Google Cloud resources) in an unstructured repository: \n\n ├── manifests\n │ ├── access-control\n │ │ ├── ...\n │ ├── change-control\n │ │ ├── ...\n │ ├── git-ops\n │ │ └── ...\n │ ├── logging-monitoring\n │ │ └── ...\n │ ├── networking\n │ │ └── ...\n │ ├── project-factory\n │ │ └── ...\n │ └── resource-hierarchy\n │ │ └── ...\n ├── raw-configs\n │ ├── access-control\n │ │ └── ...\n │ ├── change-control\n │ │ └── ...\n │ ├── git-ops\n │ │ └── ...\n │ ├── logging-monitoring\n │ │ └── ...\n │ ├── networking\n │ │ └── ...\n │ ├── project-factory\n │ │ └── ...\n │ └── resource-hierarchy\n │ │ └── ...\n └── scripts\n └── render.sh\n\nIn this example, the raw configs are in a `raw-configs` directory. You could\nthen use a script or an automated pipeline to render the raw configs and store\nthe output in the `manifests` directory. When you\n[configure Config Sync](/kubernetes-engine/enterprise/config-sync/docs/how-to/installing-config-sync#configuring-config-sync),\nyou'd configure it to sync from your `manifests` directory.\n\nWhat's next\n-----------\n\n- Create [cluster-scoped objects](/kubernetes-engine/enterprise/config-sync/docs/how-to/cluster-scoped-objects)\n- Create [namespace-scoped objects](/kubernetes-engine/enterprise/config-sync/docs/how-to/namespace-scoped-objects)\n- [Install Config Sync](/kubernetes-engine/enterprise/config-sync/docs/how-to/installing-config-sync)\n- [Configure syncing from multiple repositories](/kubernetes-engine/enterprise/config-sync/docs/how-to/multiple-repositories)"]]