You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+57-46Lines changed: 57 additions & 46 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,10 +2,13 @@
2
2
3
3
## Overview
4
4
5
-
The Policy Generator constructs Open Cluster Management policies from Kubernetes YAML files provided through a PolicyGenerator Custom Resource. The Policy Generator is a binary compiled for use as a [kustomize](https://kustomize.io/) exec plugin.
5
+
The Policy Generator constructs Open Cluster Management policies from Kubernetes YAML files provided
6
+
through a PolicyGenerator Custom Resource. The Policy Generator is a binary compiled for use as a
7
+
[kustomize](https://kustomize.io/) exec plugin.
6
8
7
9
For more about Open Cluster Management and its Policy Framework:
1. Build the plugin binary (only needed once or to update the plugin):
49
-
```bash
50
-
make build
51
-
```
52
-
**NOTE:** This will default to placing the binary in`${HOME}/.config/kustomize/plugin/`. You can change this by exporting `KUSTOMIZE_PLUGIN_HOME` to a different path.
52
+
```bash
53
+
make build
54
+
```
55
+
**NOTE:** This will default to placing the binary in`${HOME}/.config/kustomize/plugin/`. You can
56
+
change this by exporting `KUSTOMIZE_PLUGIN_HOME` to a different path.
53
57
54
58
#### Configuration
55
59
56
-
1. Create a `kustomization.yaml` file that points to `PolicyGenerator` manifest(s), with any additional desired patches or customizations (see [`examples/policyGenerator.yaml`](./examples/policyGenerator.yaml) for an example):
57
-
```yaml
58
-
generators:
59
-
- path/to/generator/file.yaml
60
-
...
61
-
```
62
-
- To read more about the `PolicyGenerator` YAML, see [About the PolicyGenerator plugin](./docs/policygenerator.md)
60
+
1. Create a `kustomization.yaml` file that points to `PolicyGenerator` manifest(s), with any
61
+
additional desired patches or customizations (see
62
+
[`examples/policyGenerator.yaml`](./examples/policyGenerator.yaml) for an example):
63
+
64
+
```yaml
65
+
generators:
66
+
- path/to/generator/file.yaml
67
+
```
68
+
69
+
- To read more about the `PolicyGenerator` YAML, see
70
+
[About the PolicyGenerator plugin](./docs/policygenerator.md)
63
71
64
72
2. To use the plugin to generate policies, do one of:
65
-
- Utilize the `examples/` directory in this repository (the directory can be modified by exporting a new path to `SOURCE_DIR`):
66
-
```bash
67
-
make generate
68
-
```
69
-
- From any directory with a `kustomization.yaml` file pointing to `PolicyGenerator` manifests:
70
-
```bash
71
-
kustomize build --enable-alpha-plugins
72
-
```
73
+
- Utilize the `examples/` directory in this repository (the directory can be modified by
74
+
exporting a new path to `SOURCE_DIR`):
75
+
```bash
76
+
make generate
77
+
```
78
+
- From any directory with a `kustomization.yaml` file pointing to `PolicyGenerator` manifests:
79
+
```bash
80
+
kustomize build --enable-alpha-plugins
81
+
```
73
82
74
83
### As a standalone binary
75
84
76
85
In order to bypass Kustomize and run the generator binary directly:
77
86
78
87
1. Build the binary:
79
-
```bash
80
-
make build-binary
81
-
```
88
+
89
+
```bash
90
+
make build-binary
91
+
```
82
92
83
93
2. Run the binary from the location of the PolicyGenerator manifest(s):
0 commit comments