Skip to content

Commit becfcb5

Browse files
authored
feat(resources): add external-secrets-operator kustomize (#41)
Add resources/external-secrets-operator with a community default subscription (community-operators) and a redhat overlay that includes Namespace, OperatorGroup, and a JSON6902 patch from the shared subscription manifest to the Red Hat catalog. README covers apply paths and not mixing both operators on one cluster. AI-Assist: Cursor; model=Composer-2; mode=commit-helper; origin=cursor
1 parent 61cd3ac commit becfcb5

8 files changed

Lines changed: 98 additions & 0 deletions

File tree

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# External Secrets Operator
2+
3+
Subscribe to External Secrets Operator on OpenShift via Operator Lifecycle Manager (OLM).
4+
5+
## Layout
6+
7+
- **`community/`** — default install: a single `Subscription` in `openshift-operators` from the **community-operators** catalog (`spec.channel: stable`). This is split into a `community` kustomization so the **`redhat/`** overlay can include it without tripping kustomize path or cycle restrictions (you cannot reference a parent directory that contains the overlay, or files outside the overlay path, from `redhat/`).
8+
- **`redhat/`** — overlay that includes `community`, adds Namespace `external-secrets-operator` and an `OperatorGroup`, and applies a **JSON6902** patch to the community `Subscription` so it targets the Red Hat catalog (`openshift-external-secrets-operator`, `redhat-operators`, `stable-v1`), including `metadata.name` / `metadata.namespace` and stripping `metadata.labels`. Strategic merge does not reliably change Subscription identity fields; use RFC6902 for those edits.
9+
10+
## Choose one catalog
11+
12+
Do **not** install both the community OperatorHub package and the Red Hat External Secrets Operator on the same cluster. If you switch from one to the other, uninstall the existing operator first (see [Red Hat documentation](https://docs.redhat.com/en/documentation/openshift_container_platform/4.20/html/security_and_compliance/external-secrets-operator-for-red-hat-openshift)).
13+
14+
## Apply
15+
16+
**Community (default):**
17+
18+
```shell
19+
oc apply -k resources/external-secrets-operator
20+
```
21+
22+
**Red Hat** (requires OpenShift 4.20+ and the `redhat-operators` catalog):
23+
24+
```shell
25+
oc apply -k resources/external-secrets-operator/redhat
26+
```
27+
28+
## Argo CD
29+
30+
Point `spec.source.path` at:
31+
32+
- `resources/external-secrets-operator` for the default (community) manifest, or
33+
- `resources/external-secrets-operator/redhat` for the Red Hat operator.
34+
35+
You can mirror [applications/vault-secrets-operator.yaml](https://github.com/openstack-k8s-operators/gitops/blob/main/applications/vault-secrets-operator.yaml) (sync-wave, repo URL, kustomize components) and set `path` accordingly.
36+
37+
## Links
38+
39+
- [External Secrets Operator for Red Hat OpenShift](https://docs.redhat.com/en/documentation/openshift_container_platform/4.20/html/security_and_compliance/external-secrets-operator-for-red-hat-openshift) (Red Hat)
40+
- [external-secrets.io](https://external-secrets.io/) (upstream)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
apiVersion: kustomize.config.k8s.io/v1beta1
3+
kind: Kustomization
4+
resources:
5+
- subscription.yaml
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
apiVersion: operators.coreos.com/v1alpha1
3+
kind: Subscription
4+
metadata:
5+
labels:
6+
operators.coreos.com/external-secrets-operator.openshift-operators: ""
7+
name: external-secrets-operator
8+
namespace: openshift-operators
9+
spec:
10+
channel: stable
11+
installPlanApproval: Automatic
12+
name: external-secrets-operator
13+
source: community-operators
14+
sourceNamespace: openshift-marketplace
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
apiVersion: kustomize.config.k8s.io/v1beta1
3+
kind: Kustomization
4+
resources:
5+
- community
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
apiVersion: kustomize.config.k8s.io/v1beta1
3+
kind: Kustomization
4+
resources:
5+
- ../community
6+
- namespace.yaml
7+
- operatorgroup.yaml
8+
patches:
9+
- path: patch-subscription-redhat.json
10+
target:
11+
kind: Subscription
12+
name: external-secrets-operator
13+
namespace: openshift-operators
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
apiVersion: v1
3+
kind: Namespace
4+
metadata:
5+
name: external-secrets-operator
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
apiVersion: operators.coreos.com/v1
3+
kind: OperatorGroup
4+
metadata:
5+
name: openshift-external-secrets-operator
6+
namespace: external-secrets-operator
7+
spec:
8+
targetNamespaces: []
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
[
2+
{"op": "replace", "path": "/metadata/name", "value": "openshift-external-secrets-operator"},
3+
{"op": "replace", "path": "/metadata/namespace", "value": "external-secrets-operator"},
4+
{"op": "remove", "path": "/metadata/labels"},
5+
{"op": "replace", "path": "/spec/channel", "value": "stable-v1"},
6+
{"op": "replace", "path": "/spec/name", "value": "openshift-external-secrets-operator"},
7+
{"op": "replace", "path": "/spec/source", "value": "redhat-operators"}
8+
]

0 commit comments

Comments
 (0)