Skip to content

Commit

Permalink
README updates
Browse files Browse the repository at this point in the history
  • Loading branch information
wr0ngway committed Jun 22, 2021
1 parent 986b14c commit 5eccb20
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 11 deletions.
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,22 @@
0.5.0 (06/18/2021)
------------------

#### Notes on major changes

* \[breaking change] Kubetruth can now generate any kubernetes resource via the templates supplied `resource_templates` attribute in ProjectMappings. The default root ProjectMapping contains templates for ConfigMaps and Secrets
* \[breaking change] Removed these settings from ProjectMapping:
* `key_filter` - use `key_selector` instead
* `configmap_name_template` - use `context.resource_name` or supply your own `resource_templates`
* `secret_name_template` - use `context.resource_name` or supply your own `resource_templates`
* `namespace_template` - use `context.resource_namespace` or supply your own `resource_templates`
* `key_template` - supply your own `resource_templates`
* `skip_secrets` - supply your own `resource_templates`
* \[breaking change] Regular expression named matches are no longer used to supply template evaluation variables

#### Full changelog

* test ruby directly as running codecov within docker is messy [986b14c](../../commit/986b14c)
* cleanup repo structure [54096a1](../../commit/54096a1)
* remove conditional update as server-side apply takes care of it [7de290f](../../commit/7de290f)
* add a signal handler to wake up from polling sleep [c9c3873](../../commit/c9c3873)
* fix creating namespace [9db00b4](../../commit/9db00b4)
Expand Down
25 changes: 14 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ Parameterize the helm install with `--set appSettings.**` to control how kubetru
| projectMappings.root.key_selector | A regexp to limit the keys acted against (client-side). Supplies any named matches for template evaluation | string | "" | no |
| projectMappings.root.skip | Skips the generation of resources for the selected projects | flag | false | no |
| projectMappings.root.included_projects | Include the parameters from other projects into the selected ones. This can be recursive in a depth first fashion, so if A imports B and B imports C, then A will get B's and C's parameters. For key conflicts, if A includes B and B includes C, then the precendence is A overrides B overrides C. If A includes \[B, C], then the precendence is A overrides C overrides B. | list | [] | no |
| projectMappings.root.context | Additional variables made available to the resource templates. Can also be templates | string | [default](helm/kubetruth/values.yaml#L93-L129) | no |
| projectMappings.root.resource_templates | The templates to use in generating kubernetes resources (ConfigMap/Secrets/other) | string | [default](helm/kubetruth/values.yaml#L93-L129) | no |
| projectMappings.root.context | Additional variables made available to the resource templates. Can also be templates | map | [default](helm/kubetruth/values.yaml#L93-L129) | no |
| projectMappings.root.resource_templates | The templates to use in generating kubernetes resources (ConfigMap/Secrets/other) | map | [default](helm/kubetruth/values.yaml#L93-L129) | no |
| projectMappings.<override_name>.* | Define override mappings to override settings from the root selector for specific projects. When doing this on the command-line (e.g. for `helm install`), it may be more convenient to use `--values <file>` instead of `--set` for large data sets | map | {} | no |

With the default `resource_templates`, Kubetruth maps the parameters from
Expand Down Expand Up @@ -189,15 +189,18 @@ To create kubernetes Resources in namespaces named after each Project:
```
kubectl edit pm kubetruth-root
```
and add the metadata.namespace field to each template in `resource_templates` like so:
```yaml
spec:
resource_templates:
- |
apiVersion: v1
kind: ConfigMap
metadata:
namespace: {{ project | dns_safe }}
and set the `context.resource_namespace` field:

Or to do it with `kubectl patch`:

```
kubectl patch pm kubetruth-root --type json --patch '[{"op": "replace", "path": "/spec/context/resource_namespace", "value": "{{ project | dns_safe }}"}]'
```

Or to do it at install time, add the following to the `helm install` command:

```
--set projectMappings.root.context.resource_namespace="\{\{ project | dns_safe \}\}"
```

#### Share common data
Expand Down

0 comments on commit 5eccb20

Please sign in to comment.