Skip to content

Commit 0294f91

Browse files
committed
rename CRD fields based on decision
1 parent 36120a8 commit 0294f91

16 files changed

Lines changed: 107 additions & 132 deletions

File tree

deploy/helm/opensearch-operator/crds/crds.yaml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,36 +31,36 @@ spec:
3131
clusterConfig:
3232
default:
3333
tls:
34-
httpSecretClass: tls
35-
transportSecretClass: tls
34+
internalSecretClass: tls
35+
serverSecretClass: tls
3636
description: Configuration that applies to all roles and role groups
3737
properties:
3838
tls:
3939
default:
40-
httpSecretClass: tls
41-
transportSecretClass: tls
42-
description: TLS configuration options for the REST API and internal communication (transport).
40+
internalSecretClass: tls
41+
serverSecretClass: tls
42+
description: TLS configuration options for the server (REST API) and internal communication (transport).
4343
properties:
44-
httpSecretClass:
44+
internalSecretClass:
4545
default: tls
4646
description: |-
47-
Only affects client connections to the REST API.
47+
Only affects internal communication (transport). Used for mutual verification between OpenSearch nodes.
4848
This setting controls:
49-
- If TLS encryption is used at all
50-
- Which cert the servers should use to authenticate themselves against the client
49+
- Which cert the servers should use to authenticate themselves against other servers
50+
- Which ca.crt to use when validating the other server
5151
maxLength: 253
5252
minLength: 1
53-
nullable: true
5453
type: string
55-
transportSecretClass:
54+
serverSecretClass:
5655
default: tls
5756
description: |-
58-
Only affects internal communication (transport). Used for mutual verification between OpenSearch nodes.
57+
Only affects client connections to the REST API.
5958
This setting controls:
60-
- Which cert the servers should use to authenticate themselves against other servers
61-
- Which ca.crt to use when validating the other server
59+
- If TLS encryption is used at all
60+
- Which cert the servers should use to authenticate themselves against the client
6261
maxLength: 253
6362
minLength: 1
63+
nullable: true
6464
type: string
6565
type: object
6666
vectorAggregatorConfigMapName:

docs/modules/opensearch/examples/getting_started/opensearch.yaml

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,6 @@ spec:
1414
opensearch.yml:
1515
plugins.security.allow_default_init_securityindex: "true"
1616
plugins.security.restapi.roles_enabled: all_access
17-
plugins.security.ssl.transport.enabled: "true"
18-
plugins.security.ssl.transport.pemcert_filepath: /stackable/opensearch/config/tls/tls.crt
19-
plugins.security.ssl.transport.pemkey_filepath: /stackable/opensearch/config/tls/tls.key
20-
plugins.security.ssl.transport.pemtrustedcas_filepath: /stackable/opensearch/config/tls/ca.crt
21-
plugins.security.ssl.http.enabled: "true"
22-
plugins.security.ssl.http.pemcert_filepath: /stackable/opensearch/config/tls/tls.crt
23-
plugins.security.ssl.http.pemkey_filepath: /stackable/opensearch/config/tls/tls.key
24-
plugins.security.ssl.http.pemtrustedcas_filepath: /stackable/opensearch/config/tls/ca.crt
2517
podOverrides:
2618
spec:
2719
containers:
@@ -30,25 +22,8 @@ spec:
3022
- name: security-config
3123
mountPath: /stackable/opensearch/config/opensearch-security
3224
readOnly: true
33-
- name: tls
34-
mountPath: /stackable/opensearch/config/tls
35-
readOnly: true
3625
volumes:
3726
- name: security-config
3827
secret:
3928
secretName: opensearch-security-config
4029
defaultMode: 0o660
41-
- name: tls
42-
ephemeral:
43-
volumeClaimTemplate:
44-
metadata:
45-
annotations:
46-
secrets.stackable.tech/class: tls
47-
secrets.stackable.tech/scope: node,pod,service=simple-opensearch,service=simple-opensearch-nodes-default,service=simple-opensearch-nodes-default-headless
48-
spec:
49-
storageClassName: secrets.stackable.tech
50-
accessModes:
51-
- ReadWriteOnce
52-
resources:
53-
requests:
54-
storage: "1"

docs/modules/opensearch/pages/usage-guide/security.adoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ spec:
1818
productVersion: 3.1.0
1919
clusterConfig:
2020
tls:
21-
httpSecretClass: tls # <1>
22-
transportSecretClass: opensearch-transport-tls # <2>
21+
serverSecretClass: tls # <1>
22+
internalSecretClass: opensearch-internal-tls # <2>
2323
nodes:
2424
config:
2525
requestedSecretLifetime: 7d # <3>
2626
roleGroups:
2727
default:
2828
replicas: 3
2929
----
30-
<1> The `spec.clusterConfig.tls.httpSecretClass` refers to the client-to-server encryption at the REST API. Defaults to the `tls` SecretClass and can be disabled by setting `httpSecretClass` to `null`.
31-
<2> The `spec.clusterConfig.tls.transportSecretClass` refers to the internal encryption between OpenSearch nodes using mTLS (transport). Defaults to the `tls` SecretClass` and can't be disabled.
30+
<1> The `spec.clusterConfig.tls.serverSecretClass` refers to the client-to-server encryption at the REST API. Defaults to the `tls` SecretClass and can be disabled by setting `serverSecretClass` to `null`.
31+
<2> The `spec.clusterConfig.tls.internalSecretClass` refers to the internal encryption between OpenSearch nodes using mTLS (transport). Defaults to the `tls` SecretClass` and can't be disabled.
3232
<3> The lifetime for autoTls certificates generated by the secret operator.
3333
Only a lifetime up to the `maxCertificateLifetime` setting in the SecretClass is applied.
3434

@@ -52,4 +52,4 @@ spec:
5252
maxCertificateLifetime: 15d
5353
----
5454

55-
You can create your own secrets and reference them e.g. in the `spec.clusterConfig.tls.httpSecretClass` or `spec.clusterConfig.tls.transportSecretClass` to use different certificates.
55+
You can create your own secrets and reference them e.g. in the `spec.clusterConfig.tls.serverSecretClass` or `spec.clusterConfig.tls.internalSecretClass` to use different certificates.

rust/operator-binary/src/controller/build/node_config.rs

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -195,34 +195,34 @@ impl NodeConfig {
195195
);
196196
config.insert(
197197
CONFIG_OPTION_PLUGINS_SECURITY_SSL_TRANSPORT_PEMCERT_FILEPATH.to_owned(),
198-
json!(format!("{opensearch_path_conf}/tls/transport/tls.crt")),
198+
json!(format!("{opensearch_path_conf}/tls/internal/tls.crt")),
199199
);
200200
config.insert(
201201
CONFIG_OPTION_PLUGINS_SECURITY_SSL_TRANSPORT_PEMKEY_FILEPATH.to_owned(),
202-
json!(format!("{opensearch_path_conf}/tls/transport/tls.key")),
202+
json!(format!("{opensearch_path_conf}/tls/internal/tls.key")),
203203
);
204204
config.insert(
205205
CONFIG_OPTION_PLUGINS_SECURITY_SSL_TRANSPORT_PEMTRUSTEDCAS_FILEPATH.to_owned(),
206-
json!(format!("{opensearch_path_conf}/tls/transport/ca.crt")),
206+
json!(format!("{opensearch_path_conf}/tls/internal/ca.crt")),
207207
);
208208

209-
// TLS config for HTTP port which is optional.
210-
if self.cluster.tls_config.http_secret_class.is_some() {
209+
// TLS config for HTTP port (REST API) (optional).
210+
if self.cluster.tls_config.server_secret_class.is_some() {
211211
config.insert(
212212
CONFIG_OPTION_PLUGINS_SECURITY_SSL_HTTP_ENABLED.to_owned(),
213213
json!("true".to_string()),
214214
);
215215
config.insert(
216216
CONFIG_OPTION_PLUGINS_SECURITY_SSL_HTTP_PEMCERT_FILEPATH.to_owned(),
217-
json!(format!("{opensearch_path_conf}/tls/http/tls.crt")),
217+
json!(format!("{opensearch_path_conf}/tls/server/tls.crt")),
218218
);
219219
config.insert(
220220
CONFIG_OPTION_PLUGINS_SECURITY_SSL_HTTP_PEMKEY_FILEPATH.to_owned(),
221-
json!(format!("{opensearch_path_conf}/tls/http/tls.key")),
221+
json!(format!("{opensearch_path_conf}/tls/server/tls.key")),
222222
);
223223
config.insert(
224224
CONFIG_OPTION_PLUGINS_SECURITY_SSL_HTTP_PEMTRUSTEDCAS_FILEPATH.to_owned(),
225-
json!(format!("{opensearch_path_conf}/tls/http/ca.crt")),
225+
json!(format!("{opensearch_path_conf}/tls/server/ca.crt")),
226226
);
227227
} else {
228228
config.insert(
@@ -524,13 +524,13 @@ mod tests {
524524
"node.attr.role-group: \"data\"\n",
525525
"plugins.security.nodes_dn: [\"CN=generated certificate for pod\"]\n",
526526
"plugins.security.ssl.http.enabled: \"true\"\n",
527-
"plugins.security.ssl.http.pemcert_filepath: \"/stackable/opensearch/config/tls/http/tls.crt\"\n",
528-
"plugins.security.ssl.http.pemkey_filepath: \"/stackable/opensearch/config/tls/http/tls.key\"\n",
529-
"plugins.security.ssl.http.pemtrustedcas_filepath: \"/stackable/opensearch/config/tls/http/ca.crt\"\n",
527+
"plugins.security.ssl.http.pemcert_filepath: \"/stackable/opensearch/config/tls/server/tls.crt\"\n",
528+
"plugins.security.ssl.http.pemkey_filepath: \"/stackable/opensearch/config/tls/server/tls.key\"\n",
529+
"plugins.security.ssl.http.pemtrustedcas_filepath: \"/stackable/opensearch/config/tls/server/ca.crt\"\n",
530530
"plugins.security.ssl.transport.enabled: \"true\"\n",
531-
"plugins.security.ssl.transport.pemcert_filepath: \"/stackable/opensearch/config/tls/transport/tls.crt\"\n",
532-
"plugins.security.ssl.transport.pemkey_filepath: \"/stackable/opensearch/config/tls/transport/tls.key\"\n",
533-
"plugins.security.ssl.transport.pemtrustedcas_filepath: \"/stackable/opensearch/config/tls/transport/ca.crt\"\n",
531+
"plugins.security.ssl.transport.pemcert_filepath: \"/stackable/opensearch/config/tls/internal/tls.crt\"\n",
532+
"plugins.security.ssl.transport.pemkey_filepath: \"/stackable/opensearch/config/tls/internal/tls.key\"\n",
533+
"plugins.security.ssl.transport.pemtrustedcas_filepath: \"/stackable/opensearch/config/tls/internal/ca.crt\"\n",
534534
"test: \"value\"",
535535
)
536536
.to_owned(),

rust/operator-binary/src/controller/build/role_group_builder.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ constant!(DATA_VOLUME_NAME: VolumeName = "data");
7676
constant!(LISTENER_VOLUME_NAME: PersistentVolumeClaimName = "listener");
7777
const LISTENER_VOLUME_DIR: &str = "/stackable/listener";
7878

79-
constant!(TLS_HTTP_VOLUME_NAME: VolumeName = "tls-http");
80-
constant!(TLS_TRANSPORT_VOLUME_NAME: VolumeName = "tls-transport");
79+
constant!(TLS_SERVER_VOLUME_NAME: VolumeName = "tls-server");
80+
constant!(TLS_INTERNAL_VOLUME_NAME: VolumeName = "tls-internal");
8181

8282
constant!(LOG_VOLUME_NAME: VolumeName = "log");
8383
const LOG_VOLUME_DIR: &str = "/stackable/log";
@@ -295,18 +295,18 @@ impl<'a> RoleGroupBuilder<'a> {
295295
..Volume::default()
296296
},
297297
self.build_tls_volume(
298-
&TLS_TRANSPORT_VOLUME_NAME.to_string(),
299-
&self.cluster.tls_config.transport_secret_class,
298+
&TLS_INTERNAL_VOLUME_NAME.to_string(),
299+
&self.cluster.tls_config.internal_secret_class,
300300
vec![],
301301
SecretFormat::TlsPem,
302302
&self.role_group_config.config.requested_secret_lifetime,
303303
Some(&LISTENER_VOLUME_NAME.to_string()),
304304
),
305305
];
306306

307-
if let Some(tls_http_secret_class_name) = &self.cluster.tls_config.http_secret_class {
307+
if let Some(tls_http_secret_class_name) = &self.cluster.tls_config.server_secret_class {
308308
volumes.push(self.build_tls_volume(
309-
&TLS_HTTP_VOLUME_NAME.to_string(),
309+
&TLS_SERVER_VOLUME_NAME.to_string(),
310310
tls_http_secret_class_name,
311311
service_scopes,
312312
SecretFormat::TlsPem,
@@ -456,16 +456,16 @@ impl<'a> RoleGroupBuilder<'a> {
456456
..VolumeMount::default()
457457
},
458458
VolumeMount {
459-
mount_path: format!("{opensearch_path_conf}/tls/transport"),
460-
name: TLS_TRANSPORT_VOLUME_NAME.to_string(),
459+
mount_path: format!("{opensearch_path_conf}/tls/internal"),
460+
name: TLS_INTERNAL_VOLUME_NAME.to_string(),
461461
..VolumeMount::default()
462462
},
463463
];
464464

465-
if self.cluster.tls_config.http_secret_class.is_some() {
465+
if self.cluster.tls_config.server_secret_class.is_some() {
466466
volume_mounts.push(VolumeMount {
467-
mount_path: format!("{opensearch_path_conf}/tls/http"),
468-
name: TLS_HTTP_VOLUME_NAME.to_string(),
467+
mount_path: format!("{opensearch_path_conf}/tls/server"),
468+
name: TLS_SERVER_VOLUME_NAME.to_string(),
469469
..VolumeMount::default()
470470
})
471471
}
@@ -1088,12 +1088,12 @@ mod tests {
10881088
"name": "log"
10891089
},
10901090
{
1091-
"mountPath": "/stackable/opensearch/config/tls/transport",
1092-
"name": "tls-transport"
1091+
"mountPath": "/stackable/opensearch/config/tls/internal",
1092+
"name": "tls-internal"
10931093
},
10941094
{
1095-
"mountPath": "/stackable/opensearch/config/tls/http",
1096-
"name": "tls-http",
1095+
"mountPath": "/stackable/opensearch/config/tls/server",
1096+
"name": "tls-server",
10971097
}
10981098
]
10991099
},
@@ -1245,7 +1245,7 @@ mod tests {
12451245
}
12461246
}
12471247
},
1248-
"name": "tls-transport"
1248+
"name": "tls-internal"
12491249
},
12501250
{
12511251
"ephemeral": {
@@ -1271,7 +1271,7 @@ mod tests {
12711271
}
12721272
}
12731273
},
1274-
"name": "tls-http"
1274+
"name": "tls-server"
12751275
},
12761276
]
12771277
}

rust/operator-binary/src/controller/validate.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,8 +497,8 @@ mod tests {
497497
)]
498498
.into(),
499499
OpenSearchTls {
500-
http_secret_class: Some(SecretClassName::from_str_unsafe("tls")),
501-
transport_secret_class: SecretClassName::from_str_unsafe("tls")
500+
server_secret_class: Some(SecretClassName::from_str_unsafe("tls")),
501+
internal_secret_class: SecretClassName::from_str_unsafe("tls")
502502
},
503503
)),
504504
result.ok()

rust/operator-binary/src/crd/mod.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ pub mod versioned {
8181
#[derive(Clone, Debug, Default, Deserialize, Eq, JsonSchema, PartialEq, Serialize)]
8282
#[serde(rename_all = "camelCase")]
8383
pub struct OpenSearchClusterConfig {
84-
/// TLS configuration options for the REST API and internal communication (transport).
84+
/// TLS configuration options for the server (REST API) and internal communication (transport).
8585
#[serde(default)]
8686
pub tls: OpenSearchTls,
8787
/// Name of the Vector aggregator [discovery ConfigMap](DOCS_BASE_URL_PLACEHOLDER/concepts/service_discovery).
@@ -100,16 +100,16 @@ pub mod versioned {
100100
/// - If TLS encryption is used at all
101101
/// - Which cert the servers should use to authenticate themselves against the client
102102
#[serde(
103-
default = "http_secret_class_default",
103+
default = "server_secret_class_default",
104104
skip_serializing_if = "Option::is_none"
105105
)]
106-
pub http_secret_class: Option<SecretClassName>,
106+
pub server_secret_class: Option<SecretClassName>,
107107
/// Only affects internal communication (transport). Used for mutual verification between OpenSearch nodes.
108108
/// This setting controls:
109109
/// - Which cert the servers should use to authenticate themselves against other servers
110110
/// - Which ca.crt to use when validating the other server
111-
#[serde(default = "transport_secret_class_default")]
112-
pub transport_secret_class: SecretClassName,
111+
#[serde(default = "internal_secret_class_default")]
112+
pub internal_secret_class: SecretClassName,
113113
}
114114

115115
// The possible node roles are by default the built-in roles and the search role, see
@@ -336,17 +336,17 @@ impl v1alpha1::OpenSearchConfig {
336336
impl Default for v1alpha1::OpenSearchTls {
337337
fn default() -> Self {
338338
v1alpha1::OpenSearchTls {
339-
http_secret_class: http_secret_class_default(),
340-
transport_secret_class: transport_secret_class_default(),
339+
server_secret_class: server_secret_class_default(),
340+
internal_secret_class: internal_secret_class_default(),
341341
}
342342
}
343343
}
344344

345-
fn http_secret_class_default() -> Option<SecretClassName> {
345+
fn server_secret_class_default() -> Option<SecretClassName> {
346346
Some(TLS_DEFAULT_SECRET_CLASS.to_owned())
347347
}
348348

349-
fn transport_secret_class_default() -> SecretClassName {
349+
fn internal_secret_class_default() -> SecretClassName {
350350
TLS_DEFAULT_SECRET_CLASS.to_owned()
351351
}
352352

tests/templates/kuttl/ldap/20_opensearch-security-config.yaml.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ stringData:
5858
enable_ssl: true
5959
hosts:
6060
- openldap.$NAMESPACE.svc.cluster.local:1636
61-
pemtrustedcas_filepath: {{ test_scenario['values']['opensearch_home'] }}/config/tls/transport/ca.crt
61+
pemtrustedcas_filepath: {{ test_scenario['values']['opensearch_home'] }}/config/tls/internal/ca.crt
6262
userbase: ou=users,dc=stackable,dc=tech
6363
username_attribute: uid
6464
usersearch: (cn={0})
@@ -73,7 +73,7 @@ stringData:
7373
enable_ssl: true
7474
hosts:
7575
- openldap.$NAMESPACE.svc.cluster.local:1636
76-
pemtrustedcas_filepath: {{ test_scenario['values']['opensearch_home'] }}/config/tls/transport/ca.crt
76+
pemtrustedcas_filepath: {{ test_scenario['values']['opensearch_home'] }}/config/tls/internal/ca.crt
7777
userbase: ou=users,dc=stackable,dc=tech
7878
username_attribute: uid
7979
usersearch: (cn={0})

tests/templates/kuttl/metrics/20-install-opensearch.yaml.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ spec:
1111
productVersion: "{{ test_scenario['values']['opensearch'].split(',')[0] }}"
1212
pullPolicy: IfNotPresent
1313
clusterConfig:
14-
{% if test_scenario['values']['http-use-tls'] == 'false' %}
14+
{% if test_scenario['values']['server-use-tls'] == 'false' %}
1515
tls:
16-
httpSecretClass: null
16+
serverSecretClass: null
1717
{% endif %}
1818
{% if lookup('env', 'VECTOR_AGGREGATOR') %}
1919
vectorAggregatorConfigMapName: vector-aggregator-discovery

tests/templates/kuttl/opensearch-dashboards/10-install-opensearch.yaml.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ spec:
1111
productVersion: "{{ test_scenario['values']['opensearch'].split(',')[0] }}"
1212
pullPolicy: IfNotPresent
1313
clusterConfig:
14-
{% if test_scenario['values']['http-use-tls'] == 'false' %}
14+
{% if test_scenario['values']['server-use-tls'] == 'false' %}
1515
tls:
16-
httpSecretClass: null
16+
serverSecretClass: null
1717
{% endif %}
1818
{% if lookup('env', 'VECTOR_AGGREGATOR') %}
1919
vectorAggregatorConfigMapName: vector-aggregator-discovery

0 commit comments

Comments
 (0)