Closed rbjorklin closed 1 month ago
After looking at the section on templating and also the kustomize specific section I tried disabling templating by patching all of my configmaps with this addition to my kustomization.yaml
:
patches:
- target:
version: v1
kind: ConfigMap
patch: |-
apiVersion: v1
kind: Configmap
metadata:
name: ignored # required but not used
annotations:
projectsveltos.io/template: "false"
Unfortunately it doesn't seem to have helped.
Thank you @rbjorklin
This is a use case I have not considered. Looking at the kustomize output, I see for instance
data:
alertmanager-overview.json: |-
... legendFormat":"{{instance}}","refId":"A"}],...
that needs no instantiation.
I believe in your case you want to express path as a template
path: "manifests/overlays/{{ .Cluster.metadata.name }}/prometheus"
but then what is found inside that path requires no instantiation. So I will change Sveltos logic.
Do not assume the content of a Kustomize output is a template unless there are
// Values is a map[string]string type that allows to define a set of key-value pairs.
// These key-value pairs can optionally leverage Go templates for further processing.
// With Sveltos, you can define key-value pairs where the values can be Go templates.
// These templates have access to management cluster information during deployment. This allows
// to do more than just replace placeholders. Variables can be used to dynamically
// construct values based on other resources or variables within the Kustomize output.
// For example, imagine you have a Region key with a template value like:
// '{{ index .Cluster.metadata.labels "region" }}'.
// This template retrieves the region label from the cluster instance metadata.
// Finally, Sveltos uses these processed values to fill placeholders in the Kustomize output.
// The output itself can also contain templates, like:
// region: '{{ default "west" .Region }}'.
// This way, the final output from Kustomize will have the region set dynamically based on
// the actual region retrieved earlier.
// +optional
Values map[string]string `json:"values,omitempty"`
// ValuesFrom can reference ConfigMap/Secret instances. Within the ConfigMap or Secret data,
// it is possible to define key-value pairs. These key-value pairs can optionally leverage
// Go templates for further processing.
// With Sveltos, you can define key-value pairs where the values can be Go templates.
// These templates have access to management cluster information during deployment. This allows
// to do more than just replace placeholders. Variables can be used to dynamically
// construct values based on other resources or variables within the Kustomize output.
// For example, imagine you have a Region key with a template value like:
// '{{ index .Cluster.metadata.labels "region" }}'.
// This template retrieves the region label from the cluster instance metadata.
// Finally, Sveltos uses these processed values to fill placeholders in the Kustomize output.
// The output itself can also contain templates, like:
// region: '{{ default "west" .Region }}'.
// This way, the final output from Kustomize will have the region set dynamically based on
// the actual region retrieved earlier.
// +optional
ValuesFrom []ValueFrom `json:"valuesFrom,omitempty"`
Resolved. Fix will be in v0.31.0
Problem Description
I'm trying to provision Prometheus but unfortunately I'm met with:
My Cluster Profile looks like this:
My Kustomization file looks like this:
And the contents of the folder referenced via the
kustomization.yaml
file was generated by executing:System Information
CLUSTERAPI VERSION:
v1.7.2
SVELTOS VERSION:0.30.0
KUBERNETES VERSION:v1.30.1
Logs