-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add policy-generator component (#251)
- Loading branch information
1 parent
e137200
commit 3b3614b
Showing
4 changed files
with
73 additions
and
0 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
29 changes: 29 additions & 0 deletions
29
...-gitops-operator/instance/components/kustomize-build-policy-generator/README.md
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# kustomize-build-policy-generator | ||
|
||
## Purpose | ||
This component is designed to turn on the `--enable-helm` feature of `kustomize build` in ArgoCD to support helm charts inside of a kustomization.yaml file. | ||
|
||
To learn more about the `--enable-helm` feature, refer to the ArgoCD docs [here](https://argo-cd.readthedocs.io/en/stable/user-guide/kustomize/#kustomizing-helm-charts) or the kustomize [examples](https://github.com/kubernetes-sigs/kustomize/blob/master/examples/chart.md). | ||
|
||
## Usage | ||
|
||
This component can be added to a base by adding the `components` section to your overlay `kustomization.yaml` file: | ||
|
||
``` | ||
apiVersion: kustomize.config.k8s.io/v1beta1 | ||
kind: Kustomization | ||
resources: | ||
- ../../base | ||
components: | ||
- ../../components/kustomize-build-policy-generator | ||
``` | ||
|
||
## Known Incompatibilities | ||
|
||
### kustomize-build-enable-helm | ||
|
||
This component is not compatible with the [kustomize-build-enable-helm](openshift-gitops-operator/instance/components/kustomize-build-enable-helm) component. | ||
|
||
Both components are attempting to patch the `spec.kustomizeBuildOptions` field. |
7 changes: 7 additions & 0 deletions
7
...t-gitops-operator/instance/components/kustomize-build-policy-generator/kustomization.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
apiVersion: kustomize.config.k8s.io/v1alpha1 | ||
kind: Component | ||
|
||
patches: | ||
- path: patch-enable-policy-generator.yaml | ||
target: | ||
kind: ArgoCD |
29 changes: 29 additions & 0 deletions
29
...r/instance/components/kustomize-build-policy-generator/patch-enable-policy-generator.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: ArgoCD | ||
metadata: | ||
name: openshift-gitops | ||
namespace: openshift-gitops | ||
spec: | ||
repo: | ||
env: | ||
- name: KUSTOMIZE_PLUGIN_HOME | ||
value: /etc/kustomize/plugin | ||
initContainers: | ||
- args: | ||
- -c | ||
- cp /etc/kustomize/plugin/policy.open-cluster-management.io/v1/policygenerator/PolicyGenerator | ||
/policy-generator/PolicyGenerator | ||
command: | ||
- /bin/bash | ||
image: registry.redhat.io/rhacm2/multicluster-operators-subscription-rhel8:v2.8 | ||
name: policy-generator-install | ||
volumeMounts: | ||
- mountPath: /policy-generator | ||
name: policy-generator | ||
volumeMounts: | ||
- mountPath: /etc/kustomize/plugin/policy.open-cluster-management.io/v1/policygenerator | ||
name: policy-generator | ||
volumes: | ||
- emptyDir: {} | ||
name: policy-generator | ||
kustomizeBuildOptions: --enable-alpha-plugins |