-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Each KustomizationRef can have substitute values: . Values is a map[string]string . ValuesFrom references ConfigMap/Secret instances whose Data sections contain values. These key-value pairs can optionally leverage Go templates for further processing. During deployment, Sveltos iterates through the key-value pairs. If a key-value pair's value is a template, Sveltos evaluates the template using data available in the context (e.g., cluster information). This allows to dynamically construct values based on other resources or variables. Finally, Sveltos uses the processed key-value pairs to replace placeholder values (identified using {{ .VariableName}} ) within the output generated by the Kustomize SDK. Let's take an example. Values: `Region`: `{{ index .Cluster.metadata.labels "region" }}`, `Version`: `v1.2.0`, And then the output of Kustomize SDK can have a deployment ``` apiVersion: apps/v1 kind: Deployment metadata: name: myapp-deployment namespace: test labels: region: {{ default "west" .Region }} spec: ... image: nginx:{{ .Version }} ``` What Sveltos will do in this case: 1. instantiate Values. So Sveltos will take the Cluster instance representing the cluster where Sveltos is about to deploy the Kustomize resources, it will take the Cluster's labels. if Cluster has labels: ```region: east``` then instantiated Values will be: `Region`: `east`, `Version`: `v1.2.0`, 2. Sveltos will take the Kustomize resources and will use the substitute Values, so: ``` apiVersion: apps/v1 kind: Deployment metadata: name: myapp-deployment namespace: test labels: region: east spec: ... image: nginx:v1.2.0 ``` 3. Sveltos will deploy resources in the managed cluster
- Loading branch information
mgianluc
committed
May 1, 2024
1 parent
8ff617a
commit cf94bad
Showing
20 changed files
with
1,127 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.