Skip to content

Commit 9de7edb

Browse files
committed
address feedback on PR
1 parent 05d696a commit 9de7edb

10 files changed

Lines changed: 76 additions & 158 deletions

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

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,7 @@ timeout: 600
99
apiVersion: apps/v1
1010
kind: StatefulSet
1111
metadata:
12-
name: opensearch-nodes-cluster-manager
13-
status:
14-
readyReplicas: 1
15-
replicas: 1
16-
---
17-
apiVersion: apps/v1
18-
kind: StatefulSet
19-
metadata:
20-
name: opensearch-nodes-data
12+
name: opensearch-nodes-default
2113
status:
2214
readyReplicas: 1
2315
replicas: 1

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

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -21,35 +21,8 @@ spec:
2121
logging:
2222
enableVectorAgent: {{ lookup('env', 'VECTOR_AGGREGATOR') | length > 0 }}
2323
roleGroups:
24-
cluster-manager:
24+
default:
2525
config:
26-
nodeRoles:
27-
- cluster_manager
28-
resources:
29-
storage:
30-
data:
31-
capacity: 100Mi
32-
listenerClass: external-stable
33-
replicas: 1
34-
podOverrides:
35-
spec:
36-
volumes:
37-
- name: tls
38-
ephemeral:
39-
volumeClaimTemplate:
40-
metadata:
41-
annotations:
42-
secrets.stackable.tech/scope: node,pod,service=opensearch,service=opensearch-nodes-cluster-manager-headless
43-
data:
44-
config:
45-
nodeRoles:
46-
- ingest
47-
- data
48-
- remote_cluster_client
49-
resources:
50-
storage:
51-
data:
52-
capacity: 2Gi
5326
listenerClass: cluster-internal
5427
replicas: 1
5528
podOverrides:
@@ -60,7 +33,7 @@ spec:
6033
volumeClaimTemplate:
6134
metadata:
6235
annotations:
63-
secrets.stackable.tech/scope: node,pod,service=opensearch-nodes-data-headless
36+
secrets.stackable.tech/scope: node,pod,service=opensearch,service=opensearch-nodes-cluster-manager-headless
6437
envOverrides:
6538
# Only required for the official image
6639
# The official image (built with https://github.com/opensearch-project/opensearch-build)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ commands:
88
--version "{{ test_scenario['values']['opensearch'].split(',')[0] }}"
99
--values 20_opensearch-dashboards-values.yaml
1010
--set opensearchHosts=https://opensearch.$NAMESPACE.svc.cluster.local:9200
11-
--namespace $NAMESPACE
11+
--namespace $NAMESPACE
1212
--wait
1313
timeout: 600
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
apiVersion: kuttl.dev/v1beta1
3+
kind: TestAssert
4+
timeout: 600
5+
---
6+
apiVersion: batch/v1
7+
kind: Job
8+
metadata:
9+
name: test-opensearch-dashboards
10+
status:
11+
succeeded: 1

tests/templates/kuttl/opensearch-dashboards/30-create-configmap.yaml.j2

Lines changed: 0 additions & 4 deletions
This file was deleted.
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
apiVersion: kuttl.dev/v1beta1
2+
kind: TestStep
3+
commands:
4+
- script: kubectl create cm test-opensearch-dashboards -n $NAMESPACE --from-file=test.py
5+
---
6+
apiVersion: batch/v1
7+
kind: Job
8+
metadata:
9+
name: test-opensearch-dashboards
10+
spec:
11+
template:
12+
spec:
13+
containers:
14+
- name: test-opensearch-dashboards
15+
image: oci.stackable.tech/sdp/testing-tools:0.2.0-stackable0.0.0-dev
16+
command:
17+
- /bin/bash
18+
- -euxo
19+
- pipefail
20+
- -c
21+
args:
22+
- |
23+
sleep 60
24+
python scripts/test.py
25+
env:
26+
- name: NAMESPACE
27+
valueFrom:
28+
fieldRef:
29+
fieldPath: metadata.namespace
30+
- name: OPENSEARCH_USER
31+
value: admin
32+
- name: OPENSEARCH_PASSWORD
33+
valueFrom:
34+
secretKeyRef:
35+
name: opensearch-credentials
36+
key: admin
37+
volumeMounts:
38+
- name: script
39+
mountPath: /stackable/scripts
40+
securityContext:
41+
allowPrivilegeEscalation: false
42+
capabilities:
43+
drop:
44+
- ALL
45+
runAsNonRoot: true
46+
resources:
47+
requests:
48+
memory: 128Mi
49+
cpu: 100m
50+
limits:
51+
memory: 128Mi
52+
cpu: 400m
53+
volumes:
54+
- name: script
55+
configMap:
56+
name: test-opensearch-dashboards
57+
serviceAccountName: test-service-account
58+
securityContext:
59+
fsGroup: 1000
60+
restartPolicy: OnFailure

tests/templates/kuttl/opensearch-dashboards/31-assert.yaml

Lines changed: 0 additions & 14 deletions
This file was deleted.

tests/templates/kuttl/opensearch-dashboards/31-install-test-container.yaml.j2

Lines changed: 0 additions & 86 deletions
This file was deleted.

tests/templates/kuttl/opensearch-dashboards/35-assert.yaml

Lines changed: 0 additions & 10 deletions
This file was deleted.

tests/templates/kuttl/opensearch-dashboards/test.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,9 @@
22
import os
33
import requests
44
import sys
5-
import urllib3
6-
7-
# disable tls insecure warnings
8-
urllib3.disable_warnings()
95

106
logging.basicConfig(
11-
level="INFO", format="%(asctime)s %(levelname)s: %(message)s", stream=sys.stdout
7+
level="DEBUG", format="%(asctime)s %(levelname)s: %(message)s", stream=sys.stdout
128
)
139

1410
namespace = os.environ["NAMESPACE"]

0 commit comments

Comments
 (0)