-
Notifications
You must be signed in to change notification settings - Fork 74
CNF-22724: Add External Secrets Operator reference configuration #808
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| --- | ||
| apiVersion: external-secrets.io/v1 | ||
| kind: ClusterSecretStore | ||
| metadata: | ||
| name: ztp-secret-provider | ||
| spec: | ||
| conditions: | ||
| - namespaceSelector: | ||
| matchExpressions: | ||
| - key: cluster.open-cluster-management.io/managedCluster | ||
| operator: Exists | ||
| provider: | ||
| vault: | ||
| server: {{ .spec.provider.vault.server | quote }} | ||
| path: {{ .spec.provider.vault.path | quote }} | ||
| version: {{ .spec.provider.vault.version | quote }} | ||
| auth: | ||
| tokenSecretRef: | ||
| name: {{ .spec.provider.vault.auth.tokenSecretRef.name }} | ||
| key: {{ .spec.provider.vault.auth.tokenSecretRef.key }} | ||
| namespace: {{ .spec.provider.vault.auth.tokenSecretRef.namespace }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| apiVersion: operator.openshift.io/v1alpha1 | ||
| kind: ExternalSecretsConfig | ||
| metadata: | ||
| name: cluster | ||
| spec: {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Namespace | ||
| metadata: | ||
| annotations: | ||
| workload.openshift.io/allowed: management | ||
|
Comment on lines
+5
to
+6
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you confirm if the pods in ESO are annotated for workload partitioning? As part of the platform they should be but this is a new operator for Telco use case and likely they have not been added yet. The annotation is:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @imiller0 they are not annotated. Shall I open a request on Jira to the upstream owners? |
||
| name: external-secrets-operator | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| --- | ||
| apiVersion: networking.k8s.io/v1 | ||
| kind: NetworkPolicy | ||
| metadata: | ||
| name: allow-secret-store-egress | ||
| namespace: external-secrets | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this supposed to be external-secrets-operator? Here and other instances of esoNetworkPolicy |
||
| spec: | ||
| podSelector: | ||
| matchLabels: | ||
| app.kubernetes.io/name: external-secrets | ||
| policyTypes: | ||
| - Egress | ||
| egress: | ||
| - to: | ||
| - namespaceSelector: | ||
| matchLabels: | ||
| kubernetes.io/metadata.name: vault | ||
| ports: | ||
| - port: 8200 | ||
| protocol: TCP | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| --- | ||
| apiVersion: operators.coreos.com/v1 | ||
| kind: OperatorGroup | ||
| metadata: | ||
| annotations: | ||
| operatorframework.io/bundle-unpack-timeout: "10m" | ||
| operatorframework.io/bundle-unpack-min-retry-interval: 10m | ||
| name: openshift-external-secrets-operator | ||
| namespace: external-secrets-operator | ||
| spec: | ||
| upgradeStrategy: Default |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| --- | ||
| apiVersion: operators.coreos.com/v1alpha1 | ||
| kind: Subscription | ||
| metadata: | ||
| name: openshift-external-secrets-operator | ||
| namespace: external-secrets-operator | ||
| spec: | ||
| channel: stable-v1 | ||
| name: openshift-external-secrets-operator | ||
| source: redhat-operators-disconnected | ||
| sourceNamespace: openshift-marketplace | ||
| installPlanApproval: Manual | ||
| status: | ||
| state: AtLatestKnown |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| --- | ||
| apiVersion: external-secrets.io/v1 | ||
| kind: ClusterSecretStore | ||
| metadata: | ||
| name: ztp-secret-provider | ||
| spec: | ||
| # Restrict store usage to RHACM managed-cluster namespaces only | ||
| conditions: | ||
| - namespaceSelector: | ||
| matchExpressions: | ||
| - key: cluster.open-cluster-management.io/managedCluster | ||
| operator: Exists | ||
| provider: | ||
| vault: | ||
| server: "https://vault.example.com:8200" | ||
| path: "secret" | ||
| version: "v2" | ||
| auth: | ||
| tokenSecretRef: | ||
| name: vault-token | ||
| key: token | ||
| namespace: external-secrets-operator | ||
|
rdiscala marked this conversation as resolved.
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| apiVersion: operator.openshift.io/v1alpha1 | ||
| kind: ExternalSecretsConfig | ||
| metadata: | ||
| name: cluster | ||
| spec: {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Namespace | ||
| metadata: | ||
| annotations: | ||
| workload.openshift.io/allowed: management | ||
| name: external-secrets-operator |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| --- | ||
| apiVersion: networking.k8s.io/v1 | ||
| kind: NetworkPolicy | ||
| metadata: | ||
| name: allow-secret-store-egress | ||
| namespace: external-secrets | ||
| spec: | ||
| podSelector: | ||
| matchLabels: | ||
| app.kubernetes.io/name: external-secrets | ||
| policyTypes: | ||
| - Egress | ||
| egress: | ||
| - to: | ||
| - namespaceSelector: | ||
| matchLabels: | ||
| kubernetes.io/metadata.name: vault | ||
| ports: | ||
| - port: 8200 | ||
| protocol: TCP |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| --- | ||
| apiVersion: operators.coreos.com/v1 | ||
| kind: OperatorGroup | ||
| metadata: | ||
| annotations: | ||
| operatorframework.io/bundle-unpack-min-retry-interval: 10m | ||
| name: openshift-external-secrets-operator | ||
| namespace: external-secrets-operator | ||
| spec: | ||
| upgradeStrategy: Default |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| --- | ||
| apiVersion: operators.coreos.com/v1alpha1 | ||
| kind: Subscription | ||
| metadata: | ||
| name: openshift-external-secrets-operator | ||
| namespace: external-secrets-operator | ||
| spec: | ||
| channel: stable-v1 | ||
| name: openshift-external-secrets-operator | ||
| source: redhat-operators-disconnected | ||
| sourceNamespace: openshift-marketplace | ||
| installPlanApproval: Manual | ||
| status: | ||
| state: AtLatestKnown |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # Patch the ClusterSecretStore with your secret store server address. | ||
| # Update the server URL and path to match your environment. | ||
| - op: replace | ||
| path: /spec/provider/vault/server | ||
| value: "https://vault.example.com:8200" | ||
|
|
||
| - op: replace | ||
| path: /spec/provider/vault/path | ||
| value: "secret" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| --- | ||
| apiVersion: kustomize.config.k8s.io/v1beta1 | ||
| kind: Kustomization | ||
|
|
||
| resources: | ||
| - ../../reference-crs/optional/external-secrets/ | ||
|
|
||
| patches: | ||
| # Customize ClusterSecretStore for your secret store backend | ||
| - target: | ||
| group: external-secrets.io | ||
| version: v1 | ||
| kind: ClusterSecretStore | ||
| name: ztp-secret-provider | ||
| path: cluster-secret-store-patch.yaml | ||
|
|
||
| # Customize NetworkPolicy target for your secret store namespace/port | ||
| - target: | ||
| group: networking.k8s.io | ||
| version: v1 | ||
| kind: NetworkPolicy | ||
| name: allow-secret-store-egress | ||
| path: network-policy-patch.yaml |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # Patch the NetworkPolicy to target your secret store namespace and port. | ||
| # Update the namespace label and port to match your environment. | ||
| - op: replace | ||
| path: /spec/egress/0/to/0/namespaceSelector/matchLabels/kubernetes.io~1metadata.name | ||
| value: "vault" | ||
|
|
||
| - op: replace | ||
| path: /spec/egress/0/ports/0/port | ||
| value: 8200 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| --- | ||
| apiVersion: external-secrets.io/v1 | ||
| kind: ClusterSecretStore | ||
| metadata: | ||
| annotations: | ||
| argocd.argoproj.io/sync-wave: "-30" | ||
| name: ztp-secret-provider | ||
| spec: | ||
| conditions: | ||
| - namespaceSelector: | ||
| matchExpressions: | ||
| - key: cluster.open-cluster-management.io/managedCluster | ||
| operator: Exists | ||
| provider: | ||
| vault: | ||
| server: {{ .spec.provider.vault.server | quote }} | ||
| path: {{ .spec.provider.vault.path | quote }} | ||
| version: {{ .spec.provider.vault.version | quote }} | ||
|
Comment on lines
+16
to
+18
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better use of templating :) |
||
| auth: | ||
| tokenSecretRef: | ||
| name: {{ .spec.provider.vault.auth.tokenSecretRef.name }} | ||
| key: {{ .spec.provider.vault.auth.tokenSecretRef.key }} | ||
| namespace: {{ .spec.provider.vault.auth.tokenSecretRef.namespace }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| apiVersion: v1 | ||
| kind: ConfigMap | ||
| metadata: | ||
| name: eso-cluster-templates-v1 | ||
| namespace: open-cluster-management | ||
| annotations: | ||
| argocd.argoproj.io/sync-wave: "-30" | ||
| data: | ||
| PullSecretExternalSecret: |- | ||
| apiVersion: external-secrets.io/v1 | ||
| kind: ExternalSecret | ||
| metadata: | ||
| name: "{{ "{{ .Spec.PullSecretRef.Name }}" }}" | ||
| namespace: "{{ "{{ .Spec.ClusterName }}" }}" | ||
| annotations: | ||
| siteconfig.open-cluster-management.io/sync-wave: "1" | ||
| spec: | ||
| refreshPolicy: OnChange | ||
| secretStoreRef: | ||
| name: ztp-secret-provider | ||
| kind: ClusterSecretStore | ||
| target: | ||
| name: "{{ "{{ .Spec.PullSecretRef.Name }}" }}" | ||
| creationPolicy: Owner | ||
| template: | ||
| type: kubernetes.io/dockerconfigjson | ||
| data: | ||
| - secretKey: .dockerconfigjson | ||
| remoteRef: | ||
| key: clusters/{{ "{{ .Spec.ClusterName }}" }}/pull-secret | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is essentially a "contract" that we are creating which the vault needs to conform to. This needs to be clearly noted in the RDS documentation (thank you for noting clearly in the readme here!)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK. I've clarified this further in the documentation. I've also added a section for it in the changes to the |
||
| property: .dockerconfigjson | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| apiVersion: operator.openshift.io/v1alpha1 | ||
| kind: ExternalSecretsConfig | ||
| metadata: | ||
| annotations: | ||
| argocd.argoproj.io/sync-wave: "-30" | ||
| name: cluster | ||
| spec: {} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Namespace | ||
| metadata: | ||
| annotations: | ||
| argocd.argoproj.io/sync-wave: "-45" | ||
| workload.openshift.io/allowed: management | ||
| name: external-secrets-operator |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| --- | ||
| apiVersion: networking.k8s.io/v1 | ||
| kind: NetworkPolicy | ||
| metadata: | ||
| name: allow-secret-store-egress | ||
| namespace: external-secrets | ||
| annotations: | ||
| argocd.argoproj.io/sync-wave: "-25" | ||
| spec: | ||
| podSelector: | ||
| matchLabels: | ||
| app.kubernetes.io/name: external-secrets | ||
| policyTypes: | ||
| - Egress | ||
| egress: | ||
| - to: | ||
| - namespaceSelector: | ||
| matchLabels: | ||
| kubernetes.io/metadata.name: vault | ||
| ports: | ||
| - port: 8200 | ||
| protocol: TCP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although other operators do the same thing, Manual is the value set in the reference-cr. No need for this