Creating an unstructured repo allows you to organize your repo arbitrarily, without following the default repo directory structure. Anthos Config Management syncs the same set of Kubernetes objects to your cluster as in the default, hierarchical, repo.
This allows you to sync your existing Kubernetes configuration to your
Anthos Config Management repo. For example, if you want to sync a
Helm chart to your cluster, you can run
helm template and
commit the rendered manifest to your repo.
Unstructured repos do not support all Anthos Config Management features. This section describes the primary differences between hierarchical and unstructured repos.
You cannot use the
HierarchyConfig Kubernetes Objects in an
Abstract namespaces are not supported in unstructured repos.
In an unstructured repo, all namespace-scoped objects
must declare either the
metadata.namespace or the
NamespaceSelector annotation. Declaring both annotations is invalid.
See Selectors below for NamespaceSelector semantics.
You can declare ClusterSelectors and NamespaceSelectors in an unstructured repo.
In an unstructured repo, ClusterSelectors function normally.
In an unstructured repo, Objects that declare the NamespaceSelector annotation are applied to all Namespaces that satisfy the NamespaceSelector's conditions. Before you create an unstructured repo with Objects that were previously used in a hierarchical repo, verify that your NamespaceSelectors do not apply to additional resources.
Configuring an unstructured repo
To configure an unstructured repo, set the value of
For example, the
config-management.yaml below sets up the example Continuous
# config-management.yaml apiVersion: configmanagement.gke.io/v1 kind: ConfigManagement metadata: name: config-management spec: # clusterName is required and must be unique among all managed clusters clusterName: my-cluster git: syncRepo: https://github.com/GoogleCloudPlatform/csp-config-management/ syncBranch: 1.0.0 secretType: ssh policyDir: ci-pipeline-unstructured sourceFormat: unstructured
See the example unstructured repo in the Continuous Integration pipeline.