The ConfigurationSlice
Custom Resource referecnes an existing ClusterConfigurationSource
to describe one or more subsets, or slices, of configuration to obtain from configuration repositories defined in the ClusterConfigurationSource
. The read configuration creates ConfigMaps
or Secrets
in the same namespace
KIND: ConfigurationSlice
VERSION: config.apps.tanzu.vmware.com/v1alpha3
RESOURCE: spec <Object>
DESCRIPTION:
A cluster configuration custom resource (CR) provides cluster-scoped access
to one or more git repositories that can be used by Cluster Configuration
Slices to obtain configuration properties.
FIELDS:
configurationSource <String>
The name of the ClusterConfigurationSource resource that defines the backends
this ConfigurationSlice will pull configuration from.
configMapName <String>
The name to give the ConfigMap created from this ConfigurationSlice. Defaults
to the same name as the ConfigurationSlice
secretName <String>
The name to give to the Secret created. Defaults to the same name as
the ConfigurationSlice.
configMapStrategy <String>
Can be a value of "tree" or "applicationProperties". If “tree”, then create
a ConfigMap and/or Secret with one property per property found in the
provider/slice combination. If “applicationProperties”, create a ConfigMap
and/or Secret with a single property named “application.properties” whose
value is a properties file structure. This is to enable applications that
do not support configuration tree volume mounts, such as applications built
with versions of Spring Boot prior to Spring Boot 2.4.
interval <Integer>
Defines the refresh interval for checking the underlying backend repositories
for changes. This value is in seconds.
immutable <Boolean>
If true, create an immutable ConfigMap and/or Secret, with a unique hash suffix on
the name. Otherwise, create a mutable ConfigMap and/or Secret with no suffix
attached to the name. The default value is true.
content <[]String>
A list of entries defining the subset of properties to pull from the backends in
the ClusterConfigurationSource. The default value is "application/default".
apiVersion: "config.apps.tanzu.vmware.com/v1alpha3"
kind: ConfigurationSlice
metadata:
name: cook-config-slice
spec:
configurationSource: cook-config-source
immutable: false
content:
- cook/production
- cook/default
In the given example, configuration will be pulled from one or more backends using the two paths listed under content. Content entries are made up of three components:
{APP NAME}/{PROFILE NAME}/{LABELS}
{APP NAME}
— The name of an application for which the configuration is being retrieved. If “application”, then this is considered the default application and includes configuration shared across multiple applications. Any other value specifies a specific application (in the example given, “cook” is the application name) and will include properties for both the specified application as well as shared properties for the default application.
{PROFILE NAME}
— The name of a profile for which properties may be retrieved. If “default” or “*”, then this includes properties that are shared across any all profiles. If any non-default value, then the slice will include properties for the specified profile as well as properties for the default profile.
{LABELS}
— An optional comma-separated list of labels from which to retrieve properties. If not specified, then the default is to pull properties from a branch named “master”. If specified, then properties will be retrieved from all listed labels, but not from the “master” branch (unless it is included in the list).