Skip to content

Commit 59a41dd

Browse files
Merge pull request #149 from bharath-b-rh/eso-396
ESO-396: Mount user configured trustedCABundle on external-secrets core controller
2 parents 9b1cc80 + 7cb25b7 commit 59a41dd

43 files changed

Lines changed: 3261 additions & 968 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

api/v1alpha1/external_secrets_config_types.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,9 @@ type ControllerConfig struct {
162162

163163
// trustedCABundle references a ConfigMap containing PEM-encoded CA certificates for the external-secrets core controller to trust when making outbound TLS connections.
164164
// If specified, this bundle is used for all outbound TLS traffic, including connections to external secret management systems and configured proxies.
165-
// The ConfigMap must exist in the external-secrets operand namespace.
166-
// When omitted, external providers fall back to standard system certificates, while proxy connections use the OpenShift trusted CA bundle by default.
165+
// The ConfigMap must exist in the external-secrets operand namespace and must not carry the CNO inject-trusted-cabundle label when proxy is configured.
166+
// When omitted, external providers use standard system certificates. When proxy is configured, proxy TLS connections use the operator-managed
167+
// OpenShift trusted CA bundle injected by the Cluster Network Operator.
167168
// +optional
168169
TrustedCABundle *ConfigMapKeyReference `json:"trustedCABundle,omitempty"`
169170
}

api/v1alpha1/groupversion_info.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ var (
2828
// GroupVersion is group version used to register these objects.
2929
GroupVersion = schema.GroupVersion{Group: "operator.openshift.io", Version: "v1alpha1"}
3030

31+
// ExternalSecretsConfigGVR is the GroupVersionResource for ExternalSecretsConfig.
32+
ExternalSecretsConfigGVR = GroupVersion.WithResource("externalsecretsconfigs")
33+
3134
// SchemeBuilder is used to add go types to the GroupVersionKind scheme.
3235
SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}
3336

api/v1alpha1/meta.go

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,11 +112,9 @@ type ProxyConfig struct {
112112
// +optional
113113
NoProxy string `json:"noProxy,omitempty"`
114114

115-
// NetworkPolicyProvisioning defines the management strategy for the proxy egress rule.
116-
// When set to Managed, the operator automatically provisions and maintains
117-
// a NetworkPolicy allowing traffic to the configured proxy.
118-
// If no proxy is configured, no NetworkPolicy will be created
119-
// regardless of this setting.
115+
// networkPolicyProvisioning defines the management strategy for the proxy egress rule.
116+
// When set to Managed, the operator automatically provisions and maintains a NetworkPolicy allowing traffic to the configured proxy.
117+
// If no proxy is configured, no NetworkPolicy will be created regardless of this setting.
120118
// +kubebuilder:validation:Enum=Managed;Unmanaged
121119
// +kubebuilder:default=Managed
122120
// +optional

bindata/external-secrets/networkpolicy_allow-dns.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ spec:
3333
- protocol: UDP
3434
port: 53
3535
policyTypes:
36-
- Egress
36+
- Egress

bundle/manifests/operator.openshift.io_externalsecretsconfigs.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,11 +1037,9 @@ spec:
10371037
networkPolicyProvisioning:
10381038
default: Managed
10391039
description: |-
1040-
NetworkPolicyProvisioning defines the management strategy for the proxy egress rule.
1041-
When set to Managed, the operator automatically provisions and maintains
1042-
a NetworkPolicy allowing traffic to the configured proxy.
1043-
If no proxy is configured, no NetworkPolicy will be created
1044-
regardless of this setting.
1040+
networkPolicyProvisioning defines the management strategy for the proxy egress rule.
1041+
When set to Managed, the operator automatically provisions and maintains a NetworkPolicy allowing traffic to the configured proxy.
1042+
If no proxy is configured, no NetworkPolicy will be created regardless of this setting.
10451043
enum:
10461044
- Managed
10471045
- Unmanaged
@@ -1774,8 +1772,9 @@ spec:
17741772
description: |-
17751773
trustedCABundle references a ConfigMap containing PEM-encoded CA certificates for the external-secrets core controller to trust when making outbound TLS connections.
17761774
If specified, this bundle is used for all outbound TLS traffic, including connections to external secret management systems and configured proxies.
1777-
The ConfigMap must exist in the external-secrets operand namespace.
1778-
When omitted, external providers fall back to standard system certificates, while proxy connections use the OpenShift trusted CA bundle by default.
1775+
The ConfigMap must exist in the external-secrets operand namespace and must not carry the CNO inject-trusted-cabundle label when proxy is configured.
1776+
When omitted, external providers use standard system certificates. When proxy is configured, proxy TLS connections use the operator-managed
1777+
OpenShift trusted CA bundle injected by the Cluster Network Operator.
17791778
properties:
17801779
key:
17811780
default: ca-bundle.crt

bundle/manifests/operator.openshift.io_externalsecretsmanagers.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,11 +1072,9 @@ spec:
10721072
networkPolicyProvisioning:
10731073
default: Managed
10741074
description: |-
1075-
NetworkPolicyProvisioning defines the management strategy for the proxy egress rule.
1076-
When set to Managed, the operator automatically provisions and maintains
1077-
a NetworkPolicy allowing traffic to the configured proxy.
1078-
If no proxy is configured, no NetworkPolicy will be created
1079-
regardless of this setting.
1075+
networkPolicyProvisioning defines the management strategy for the proxy egress rule.
1076+
When set to Managed, the operator automatically provisions and maintains a NetworkPolicy allowing traffic to the configured proxy.
1077+
If no proxy is configured, no NetworkPolicy will be created regardless of this setting.
10801078
enum:
10811079
- Managed
10821080
- Unmanaged

config/crd/bases/operator.openshift.io_externalsecretsconfigs.yaml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,11 +1037,9 @@ spec:
10371037
networkPolicyProvisioning:
10381038
default: Managed
10391039
description: |-
1040-
NetworkPolicyProvisioning defines the management strategy for the proxy egress rule.
1041-
When set to Managed, the operator automatically provisions and maintains
1042-
a NetworkPolicy allowing traffic to the configured proxy.
1043-
If no proxy is configured, no NetworkPolicy will be created
1044-
regardless of this setting.
1040+
networkPolicyProvisioning defines the management strategy for the proxy egress rule.
1041+
When set to Managed, the operator automatically provisions and maintains a NetworkPolicy allowing traffic to the configured proxy.
1042+
If no proxy is configured, no NetworkPolicy will be created regardless of this setting.
10451043
enum:
10461044
- Managed
10471045
- Unmanaged
@@ -1774,8 +1772,9 @@ spec:
17741772
description: |-
17751773
trustedCABundle references a ConfigMap containing PEM-encoded CA certificates for the external-secrets core controller to trust when making outbound TLS connections.
17761774
If specified, this bundle is used for all outbound TLS traffic, including connections to external secret management systems and configured proxies.
1777-
The ConfigMap must exist in the external-secrets operand namespace.
1778-
When omitted, external providers fall back to standard system certificates, while proxy connections use the OpenShift trusted CA bundle by default.
1775+
The ConfigMap must exist in the external-secrets operand namespace and must not carry the CNO inject-trusted-cabundle label when proxy is configured.
1776+
When omitted, external providers use standard system certificates. When proxy is configured, proxy TLS connections use the operator-managed
1777+
OpenShift trusted CA bundle injected by the Cluster Network Operator.
17791778
properties:
17801779
key:
17811780
default: ca-bundle.crt

config/crd/bases/operator.openshift.io_externalsecretsmanagers.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,11 +1072,9 @@ spec:
10721072
networkPolicyProvisioning:
10731073
default: Managed
10741074
description: |-
1075-
NetworkPolicyProvisioning defines the management strategy for the proxy egress rule.
1076-
When set to Managed, the operator automatically provisions and maintains
1077-
a NetworkPolicy allowing traffic to the configured proxy.
1078-
If no proxy is configured, no NetworkPolicy will be created
1079-
regardless of this setting.
1075+
networkPolicyProvisioning defines the management strategy for the proxy egress rule.
1076+
When set to Managed, the operator automatically provisions and maintains a NetworkPolicy allowing traffic to the configured proxy.
1077+
If no proxy is configured, no NetworkPolicy will be created regardless of this setting.
10801078
enum:
10811079
- Managed
10821080
- Unmanaged

docs/api_reference.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ _Appears in:_
221221
| `annotations` _object (keys:string, values:string)_ | annotations are for adding custom annotations to all the resources created for external-secrets deployment.<br />The annotations are merged with any default annotations set by the operator. User-specified annotations take precedence over defaults in case of conflicts.<br />Annotation keys containing domains `kubernetes.io/`, `openshift.io/`, `cert-manager.io/` or `k8s.io/` (including subdomains like `*.kubernetes.io/`) are not allowed. | | MaxProperties: 20 <br />MinProperties: 0 <br /> |
222222
| `networkPolicies` _[NetworkPolicy](#networkpolicy) array_ | networkPolicies specifies the list of network policy configurations<br />to be applied to external-secrets pods.<br />Each entry allows specifying a name for the generated NetworkPolicy object,<br />along with its full Kubernetes NetworkPolicy definition.<br />The operator prepends "eso-user-" to the provided name when creating the Kubernetes object.<br />If this field is not provided, external-secrets components will be isolated<br />with deny-all network policies, which will prevent proper operation. | | MaxItems: 50 <br />MinItems: 0 <br /> |
223223
| `componentConfigs` _[ComponentConfig](#componentconfig) array_ | componentConfigs allows specifying deployment-level configuration overrides for individual external-secrets components. This field enables fine-grained control over deployment settings for each component independently.<br />Each component can only have one configuration entry. | | MaxItems: 4 <br />MinItems: 0 <br /> |
224-
| `trustedCABundle` _[ConfigMapKeyReference](#configmapkeyreference)_ | trustedCABundle references a ConfigMap containing PEM-encoded CA certificates for the external-secrets core controller to trust when making outbound TLS connections.<br />If specified, this bundle is used for all outbound TLS traffic, including connections to external secret management systems and configured proxies.<br />The ConfigMap must exist in the external-secrets operand namespace.<br />When omitted, external providers fall back to standard system certificates, while proxy connections use the OpenShift trusted CA bundle by default. | | |
224+
| `trustedCABundle` _[ConfigMapKeyReference](#configmapkeyreference)_ | trustedCABundle references a ConfigMap containing PEM-encoded CA certificates for the external-secrets core controller to trust when making outbound TLS connections.<br />If specified, this bundle is used for all outbound TLS traffic, including connections to external secret management systems and configured proxies.<br />The ConfigMap must exist in the external-secrets operand namespace and must not carry the CNO inject-trusted-cabundle label when proxy is configured.<br />When omitted, external providers use standard system certificates. When proxy is configured, proxy TLS connections use the operator-managed<br />OpenShift trusted CA bundle injected by the Cluster Network Operator. | | |
225225

226226

227227
#### ControllerStatus
@@ -568,7 +568,7 @@ _Appears in:_
568568
| `httpProxy` _string_ | httpProxy is the URL of the proxy for HTTP requests.<br />This field can have a maximum of 2048 characters. | | MaxLength: 2048 <br />MinLength: 0 <br /> |
569569
| `httpsProxy` _string_ | httpsProxy is the URL of the proxy for HTTPS requests.<br />This field can have a maximum of 2048 characters. | | MaxLength: 2048 <br />MinLength: 0 <br /> |
570570
| `noProxy` _string_ | noProxy is a comma-separated list of hostnames and/or CIDRs and/or IPs for which the proxy should not be used.<br />This field can have a maximum of 4096 characters. | | MaxLength: 4096 <br />MinLength: 0 <br /> |
571-
| `networkPolicyProvisioning` _[ManagementState](#managementstate)_ | NetworkPolicyProvisioning defines the management strategy for the proxy egress rule.<br />When set to Managed, the operator automatically provisions and maintains<br />a NetworkPolicy allowing traffic to the configured proxy.<br />If no proxy is configured, no NetworkPolicy will be created<br />regardless of this setting. | Managed | Enum: [Managed Unmanaged] <br /> |
571+
| `networkPolicyProvisioning` _[ManagementState](#managementstate)_ | networkPolicyProvisioning defines the management strategy for the proxy egress rule.<br />When set to Managed, the operator automatically provisions and maintains a NetworkPolicy allowing traffic to the configured proxy.<br />If no proxy is configured, no NetworkPolicy will be created regardless of this setting. | Managed | Enum: [Managed Unmanaged] <br /> |
572572

573573

574574
#### SecretReference

pkg/controller/commontest/utils.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,20 @@ import (
66
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
77

88
operatorv1alpha1 "github.com/openshift/external-secrets-operator/api/v1alpha1"
9+
"github.com/openshift/external-secrets-operator/pkg/controller/common"
910
)
1011

1112
const (
1213
// TestExternalSecretsConfigResourceName is the name for ExternalSecretsConfig test CR.
13-
TestExternalSecretsConfigResourceName = "cluster"
14+
TestExternalSecretsConfigResourceName = common.ExternalSecretsConfigObjectName
1415

1516
// TestExternalSecretsImageName is the sample image name for external-secrets operand.
1617
TestExternalSecretsImageName = "registry.redhat.io/external-secrets-operator/external-secrets-operator-rhel9"
1718

1819
// TestBitwardenImageName is the sample image name for bitwarden-sdk-server.
1920
TestBitwardenImageName = "registry.stage.redhat.io/external-secrets-operator/bitwarden-sdk-server-rhel9"
2021

21-
// TestExternalSecretsNamespace is the sample namespace name for external-secrets deployment.
22+
// TestExternalSecretsNamespace is the namespace name for external-secrets deployment.
2223
TestExternalSecretsNamespace = "external-secrets"
2324

2425
// TestCRDName can be used for sample CRD resources.

0 commit comments

Comments
 (0)