File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2222 # required for pip install
2323 - name : HOME
2424 value : /stackable
25- - name : NAMESPACE
26- valueFrom :
27- fieldRef :
28- fieldPath : metadata.namespace
25+ envFrom :
26+ - configMapRef :
27+ name : opensearch-1
2928 volumeMounts :
3029 - name : script
3130 mountPath : /stackable/scripts
@@ -66,17 +65,16 @@ data:
6665 from opensearchpy import OpenSearch
6766 from opensearchpy.exceptions import RequestError
6867
69- namespace = os.environ['NAMESPACE']
68+ host = os.environ['OPENSEARCH_HOST']
69+ port = os.environ['OPENSEARCH_PORT']
70+ http_use_tls = os.environ['OPENSEARCH_PROTOCOL'] == 'https'
7071
7172 # Login as admin
7273 client = OpenSearch(
74+ hosts = [{'host': host, 'port': port}],
7375 http_auth=('admin', 'AJVFsGJBbpT6mChn'),
74- hosts=[{
75- 'host': f'opensearch-1-nodes-default-headless.{namespace}.svc.cluster.local',
76- 'port': 9200
77- }],
7876 http_compress=True,
79- use_ssl=True ,
77+ use_ssl=http_use_tls ,
8078 verify_certs=True,
8179 ca_certs='/stackable/tls/ca.crt'
8280 )
Original file line number Diff line number Diff line change 2222 # required for pip install
2323 - name : HOME
2424 value : /stackable
25- - name : NAMESPACE
26- valueFrom :
27- fieldRef :
28- fieldPath : metadata.namespace
25+ envFrom :
26+ - configMapRef :
27+ name : opensearch-1
2928 volumeMounts :
3029 - name : script
3130 mountPath : /stackable/scripts
@@ -66,17 +65,16 @@ data:
6665 from opensearchpy import OpenSearch
6766 from opensearchpy.exceptions import RequestError
6867
69- namespace = os.environ['NAMESPACE']
68+ host = os.environ['OPENSEARCH_HOST']
69+ port = os.environ['OPENSEARCH_PORT']
70+ http_use_tls = os.environ['OPENSEARCH_PROTOCOL'] == 'https'
7071
7172 # Login as test user
7273 client = OpenSearch(
74+ hosts = [{'host': host, 'port': port}],
7375 http_auth=('testuser', 'L9hUHtLVVEsrcLzZ'),
74- hosts=[{
75- 'host': f'opensearch-1-nodes-default-headless.{namespace}.svc.cluster.local',
76- 'port': 9200
77- }],
7876 http_compress=True,
79- use_ssl=True ,
77+ use_ssl=http_use_tls ,
8078 verify_certs=True,
8179 ca_certs='/stackable/tls/ca.crt'
8280 )
Original file line number Diff line number Diff line change 2222 # required for pip install
2323 - name : HOME
2424 value : /stackable
25- - name : NAMESPACE
26- valueFrom :
27- fieldRef :
28- fieldPath : metadata.namespace
25+ envFrom :
26+ - configMapRef :
27+ name : opensearch-1
2928 volumeMounts :
3029 - name : script
3130 mountPath : /stackable/scripts
@@ -66,16 +65,15 @@ data:
6665 from opensearchpy import OpenSearch
6766 from opensearchpy.exceptions import RequestError
6867
69- namespace = os.environ['NAMESPACE']
68+ host = os.environ['OPENSEARCH_HOST']
69+ port = os.environ['OPENSEARCH_PORT']
70+ http_use_tls = os.environ['OPENSEARCH_PROTOCOL'] == 'https'
7071
7172 client = OpenSearch(
72- hosts=[{
73- 'host': f'opensearch-1-nodes-default-headless.{namespace}.svc.cluster.local',
74- 'port': 9200
75- }],
73+ hosts = [{'host': host, 'port': port}],
7674 http_auth=('admin', 'AJVFsGJBbpT6mChn'),
7775 http_compress=True,
78- use_ssl=True ,
76+ use_ssl=http_use_tls ,
7977 verify_certs=True,
8078 ca_certs='/stackable/tls/ca.crt'
8179 )
Original file line number Diff line number Diff line change 1111 image: oci.stackable.tech/sdp/opensearch:{{ test_scenario['values'] ['opensearch'] .split(',')[0] }}-stackable{{ test_scenario['values'] ['release'] }}
1212 command:
1313 - /stackable/scripts/backup-security-indices.sh
14- env:
15- - name: NAMESPACE
16- valueFrom:
17- fieldRef:
18- fieldPath: metadata.namespace
14+ envFrom:
15+ - configMapRef:
16+ name: opensearch-1
1917 volumeMounts:
2018 - name: scripts
2119 mountPath: /stackable/scripts
@@ -116,7 +114,7 @@ data:
116114 -cacert config/tls/ca.crt \
117115 -cert config/tls-client/tls.crt \
118116 -key config/tls-client/tls.key \
119- --hostname opensearch-1-nodes-default-headless.$NAMESPACE.svc.cluster.local \
117+ --hostname $OPENSEARCH_HOST \
120118 -backup /tmp/backup
121119 upload-security-indices-backup.sh: |
122120 #!/usr/bin/env sh
Original file line number Diff line number Diff line change 4848 image: oci.stackable.tech/sdp/opensearch:{{ test_scenario['values'] ['opensearch'] .split(',')[0] }}-stackable{{ test_scenario['values'] ['release'] }}
4949 command:
5050 - /stackable/scripts/restore-security-indices.sh
51- env:
52- - name: NAMESPACE
53- valueFrom:
54- fieldRef:
55- fieldPath: metadata.namespace
51+ envFrom:
52+ - configMapRef:
53+ name: opensearch-2
5654 volumeMounts:
5755 - name: scripts
5856 mountPath: /stackable/scripts
@@ -121,5 +119,5 @@ data:
121119 -cacert config/tls/ca.crt \
122120 -cert config/tls-client/tls.crt \
123121 -key config/tls-client/tls.key \
124- --hostname opensearch-2-nodes-default-headless.$NAMESPACE.svc.cluster.local \
122+ --hostname $OPENSEARCH_HOST \
125123 --configdir /tmp/backup
Original file line number Diff line number Diff line change 2222 # required for pip install
2323 - name : HOME
2424 value : /stackable
25- - name : NAMESPACE
26- valueFrom :
27- fieldRef :
28- fieldPath : metadata.namespace
25+ envFrom :
26+ - configMapRef :
27+ name : opensearch-2
2928 volumeMounts :
3029 - name : script
3130 mountPath : /stackable/scripts
@@ -66,16 +65,15 @@ data:
6665 from opensearchpy import OpenSearch
6766 from opensearchpy.exceptions import RequestError
6867
69- namespace = os.environ['NAMESPACE']
68+ host = os.environ['OPENSEARCH_HOST']
69+ port = os.environ['OPENSEARCH_PORT']
70+ http_use_tls = os.environ['OPENSEARCH_PROTOCOL'] == 'https'
7071
7172 client = OpenSearch(
72- hosts=[{
73- 'host': f'opensearch-2-nodes-default-headless.{namespace}.svc.cluster.local',
74- 'port': 9200
75- }],
73+ hosts = [{'host': host, 'port': port}],
7674 http_auth=('admin', 'AJVFsGJBbpT6mChn'),
7775 http_compress=True,
78- use_ssl=True ,
76+ use_ssl=http_use_tls ,
7977 verify_certs=True,
8078 ca_certs='/stackable/tls/ca.crt'
8179 )
Original file line number Diff line number Diff line change 2222 # required for pip install
2323 - name : HOME
2424 value : /stackable
25- - name : NAMESPACE
26- valueFrom :
27- fieldRef :
28- fieldPath : metadata.namespace
25+ envFrom :
26+ - configMapRef :
27+ name : opensearch-2
2928 volumeMounts :
3029 - name : script
3130 mountPath : /stackable/scripts
@@ -66,17 +65,16 @@ data:
6665 from opensearchpy import OpenSearch
6766 from opensearchpy.exceptions import RequestError
6867
69- namespace = os.environ['NAMESPACE']
68+ host = os.environ['OPENSEARCH_HOST']
69+ port = os.environ['OPENSEARCH_PORT']
70+ http_use_tls = os.environ['OPENSEARCH_PROTOCOL'] == 'https'
7071
7172 # Login as test user
7273 client = OpenSearch(
74+ hosts = [{'host': host, 'port': port}],
7375 http_auth=('testuser', 'L9hUHtLVVEsrcLzZ'),
74- hosts=[{
75- 'host': f'opensearch-2-nodes-default-headless.{namespace}.svc.cluster.local',
76- 'port': 9200
77- }],
7876 http_compress=True,
79- use_ssl=True ,
77+ use_ssl=http_use_tls ,
8078 verify_certs=True,
8179 ca_certs='/stackable/tls/ca.crt'
8280 )
Original file line number Diff line number Diff line change 5757apiVersion : v1
5858kind : Service
5959metadata :
60- name : opensearch-discovery
60+ name : opensearch
6161spec :
62- type : ClusterIP
62+ type : NodePort # external-stable
Original file line number Diff line number Diff line change 1818 config:
1919 logging:
2020 enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }}
21+ roleConfig:
22+ discoveryServiceListenerClass: test-external-stable-$NAMESPACE
2123 roleGroups:
2224 cluster-manager:
2325 config:
Original file line number Diff line number Diff line change 2222 # required for pip install
2323 - name : HOME
2424 value : /stackable
25- - name : NAMESPACE
26- valueFrom :
27- fieldRef :
28- fieldPath : metadata.namespace
25+ envFrom :
26+ - configMapRef :
27+ name : opensearch
2928 volumeMounts :
3029 - name : script
3130 mountPath : /stackable/scripts
@@ -75,20 +74,17 @@ data:
7574 import os
7675 from opensearchpy import OpenSearch
7776
78- namespace = os.environ['NAMESPACE']
79-
80- host = f'opensearch-nodes-default-headless.{namespace}.svc.cluster.local'
81- port = 9200
82- auth = ('integrationtest', 'integrationtest')
83- ca_certs_path = '/stackable/tls/ca.crt'
77+ host = os.environ['OPENSEARCH_HOST']
78+ port = os.environ['OPENSEARCH_PORT']
79+ http_use_tls = os.environ['OPENSEARCH_PROTOCOL'] == 'https'
8480
8581 client = OpenSearch(
86- hosts = [{'host': host, 'port': port}],
87- http_compress = True ,
88- http_auth = auth ,
89- use_ssl = True ,
90- verify_certs = True,
91- ca_certs = ca_certs_path
82+ hosts = [{'host': host, 'port': port}],
83+ http_auth=('integrationtest', 'integrationtest') ,
84+ http_compress=True ,
85+ use_ssl=http_use_tls ,
86+ verify_certs= True,
87+ ca_certs='/stackable/tls/ca.crt'
9288 )
9389
9490 # Create an index
You can’t perform that action at this time.
0 commit comments