Skip to content

Commit 7ebbba8

Browse files
committed
move opensearch-dashboards into own test
1 parent 1681268 commit 7ebbba8

15 files changed

Lines changed: 300 additions & 9 deletions
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# see https://github.com/stackabletech/issues/issues/566
2+
---
3+
apiVersion: kuttl.dev/v1beta1
4+
kind: TestStep
5+
commands:
6+
- script: |
7+
kubectl patch namespace $NAMESPACE --patch='
8+
{
9+
"metadata": {
10+
"labels": {
11+
"pod-security.kubernetes.io/enforce": "privileged"
12+
}
13+
}
14+
}'
15+
timeout: 120
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
---
2+
apiVersion: v1
3+
kind: ServiceAccount
4+
metadata:
5+
name: test-service-account
6+
---
7+
kind: Role
8+
apiVersion: rbac.authorization.k8s.io/v1
9+
metadata:
10+
name: test-role
11+
rules:
12+
- apiGroups:
13+
- security.openshift.io
14+
resources:
15+
- securitycontextconstraints
16+
resourceNames:
17+
- privileged
18+
verbs:
19+
- use
20+
---
21+
kind: RoleBinding
22+
apiVersion: rbac.authorization.k8s.io/v1
23+
metadata:
24+
name: test-role-binding
25+
subjects:
26+
- kind: ServiceAccount
27+
name: test-service-account
28+
roleRef:
29+
apiGroup: rbac.authorization.k8s.io
30+
kind: Role
31+
name: test-role
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
apiVersion: v1
3+
kind: LimitRange
4+
metadata:
5+
name: limit-request-ratio
6+
spec:
7+
limits:
8+
- type: Container
9+
maxLimitRequestRatio:
10+
cpu: 5
11+
memory: 1
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# All fields are checked that are set by the operator.
2+
# This helps to detect unintentional changes. It is also a good reference for the output of the
3+
# operator. The maintenance effort should be okay as long as it is only done in the smoke test.
4+
---
5+
apiVersion: kuttl.dev/v1beta1
6+
kind: TestAssert
7+
timeout: 600
8+
---
9+
apiVersion: apps/v1
10+
kind: StatefulSet
11+
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
21+
status:
22+
readyReplicas: 1
23+
replicas: 1
Lines changed: 213 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,213 @@
1+
---
2+
apiVersion: opensearch.stackable.tech/v1alpha1
3+
kind: OpenSearchCluster
4+
metadata:
5+
name: opensearch
6+
spec:
7+
image:
8+
{% if test_scenario['values']['opensearch'].find(",") > 0 %}
9+
custom: "{{ test_scenario['values']['opensearch'].split(',')[1] }}"
10+
productVersion: "{{ test_scenario['values']['opensearch'].split(',')[0] }}"
11+
{% else %}
12+
productVersion: "{{ test_scenario['values']['opensearch'] }}"
13+
{% endif %}
14+
pullPolicy: IfNotPresent
15+
nodes:
16+
roleGroups:
17+
cluster-manager:
18+
config:
19+
nodeRoles:
20+
- cluster_manager
21+
resources:
22+
storage:
23+
data:
24+
capacity: 100Mi
25+
listenerClass: external-stable
26+
replicas: 1
27+
podOverrides:
28+
spec:
29+
volumes:
30+
- name: tls
31+
ephemeral:
32+
volumeClaimTemplate:
33+
metadata:
34+
annotations:
35+
secrets.stackable.tech/scope: node,pod,service=opensearch,service=opensearch-nodes-cluster-manager-headless
36+
data:
37+
config:
38+
nodeRoles:
39+
- ingest
40+
- data
41+
- remote_cluster_client
42+
resources:
43+
storage:
44+
data:
45+
capacity: 2Gi
46+
listenerClass: cluster-internal
47+
replicas: 1
48+
podOverrides:
49+
spec:
50+
volumes:
51+
- name: tls
52+
ephemeral:
53+
volumeClaimTemplate:
54+
metadata:
55+
annotations:
56+
secrets.stackable.tech/scope: node,pod,service=opensearch-nodes-data-headless
57+
envOverrides:
58+
# Only required for the official image
59+
# The official image (built with https://github.com/opensearch-project/opensearch-build)
60+
# installs a demo configuration if not disabled explicitly.
61+
DISABLE_INSTALL_DEMO_CONFIG: "true"
62+
OPENSEARCH_HOME: {{ test_scenario['values']['opensearch_home'] }}
63+
configOverrides:
64+
opensearch.yml:
65+
# Disable memory mapping in this test; If memory mapping were activated, the kernel setting
66+
# vm.max_map_count would have to be increased to 262144 on the node.
67+
node.store.allow_mmap: "false"
68+
# Disable the disk allocation decider in this test; Otherwise the test depends on the disk
69+
# usage of the node and if the relative watermark set in
70+
# `cluster.routing.allocation.disk.watermark.high` is reached then the security index could
71+
# not be created even if enough disk space would be available.
72+
cluster.routing.allocation.disk.threshold_enabled: "false"
73+
plugins.security.allow_default_init_securityindex: "true"
74+
plugins.security.ssl.transport.enabled: "true"
75+
plugins.security.ssl.transport.pemcert_filepath: {{ test_scenario['values']['opensearch_home'] }}/config/tls/tls.crt
76+
plugins.security.ssl.transport.pemkey_filepath: {{ test_scenario['values']['opensearch_home'] }}/config/tls/tls.key
77+
plugins.security.ssl.transport.pemtrustedcas_filepath: {{ test_scenario['values']['opensearch_home'] }}/config/tls/ca.crt
78+
plugins.security.ssl.http.enabled: "true"
79+
plugins.security.ssl.http.pemcert_filepath: {{ test_scenario['values']['opensearch_home'] }}/config/tls/tls.crt
80+
plugins.security.ssl.http.pemkey_filepath: {{ test_scenario['values']['opensearch_home'] }}/config/tls/tls.key
81+
plugins.security.ssl.http.pemtrustedcas_filepath: {{ test_scenario['values']['opensearch_home'] }}/config/tls/ca.crt
82+
podOverrides:
83+
spec:
84+
containers:
85+
- name: opensearch
86+
volumeMounts:
87+
- name: security-config
88+
mountPath: {{ test_scenario['values']['opensearch_home'] }}/config/opensearch-security
89+
readOnly: true
90+
- name: tls
91+
mountPath: {{ test_scenario['values']['opensearch_home'] }}/config/tls
92+
readOnly: true
93+
volumes:
94+
- name: security-config
95+
secret:
96+
secretName: opensearch-security-config
97+
- name: tls
98+
ephemeral:
99+
volumeClaimTemplate:
100+
metadata:
101+
annotations:
102+
secrets.stackable.tech/class: tls
103+
spec:
104+
storageClassName: secrets.stackable.tech
105+
accessModes:
106+
- ReadWriteOnce
107+
resources:
108+
requests:
109+
storage: "1"
110+
---
111+
apiVersion: v1
112+
kind: Secret
113+
metadata:
114+
name: opensearch-credentials
115+
data:
116+
admin: QUpWRnNHSkJicFQ2bUNobg== # AJVFsGJBbpT6mChn
117+
kibanaserver: RTRrRU51RW1rcUgzanlIQw== # E4kENuEmkqH3jyHC
118+
---
119+
apiVersion: v1
120+
kind: Secret
121+
metadata:
122+
name: opensearch-security-config
123+
stringData:
124+
action_groups.yml: |
125+
---
126+
_meta:
127+
type: actiongroups
128+
config_version: 2
129+
allowlist.yml: |
130+
---
131+
_meta:
132+
type: allowlist
133+
config_version: 2
134+
135+
config:
136+
enabled: false
137+
audit.yml: |
138+
---
139+
_meta:
140+
type: audit
141+
config_version: 2
142+
143+
config:
144+
enabled: false
145+
config.yml: |
146+
---
147+
_meta:
148+
type: config
149+
config_version: 2
150+
151+
config:
152+
dynamic:
153+
authc:
154+
basic_internal_auth_domain:
155+
description: Authenticate via HTTP Basic against internal users database
156+
http_enabled: true
157+
transport_enabled: true
158+
order: 1
159+
http_authenticator:
160+
type: basic
161+
challenge: true
162+
authentication_backend:
163+
type: intern
164+
authz: {}
165+
internal_users.yml: |
166+
---
167+
# The hash value is a bcrypt hash and can be generated with plugin/tools/hash.sh
168+
169+
_meta:
170+
type: internalusers
171+
config_version: 2
172+
173+
admin:
174+
hash: $2y$10$xRtHZFJ9QhG9GcYhRpAGpufCZYsk//nxsuel5URh0GWEBgmiI4Q/e
175+
reserved: true
176+
backend_roles:
177+
- admin
178+
description: OpenSearch admin user
179+
180+
kibanaserver:
181+
hash: $2y$10$vPgQ/6ilKDM5utawBqxoR.7euhVQ0qeGl8mPTeKhmFT475WUDrfQS
182+
reserved: true
183+
description: OpenSearch Dashboards user
184+
nodes_dn.yml: |
185+
---
186+
_meta:
187+
type: nodesdn
188+
config_version: 2
189+
roles.yml: |
190+
---
191+
_meta:
192+
type: roles
193+
config_version: 2
194+
roles_mapping.yml: |
195+
---
196+
_meta:
197+
type: rolesmapping
198+
config_version: 2
199+
200+
all_access:
201+
reserved: false
202+
backend_roles:
203+
- admin
204+
205+
kibana_server:
206+
reserved: true
207+
users:
208+
- kibanaserver
209+
tenants.yml: |
210+
---
211+
_meta:
212+
type: tenants
213+
config_version: 2
File renamed without changes.

tests/templates/kuttl/smoke/30-install-opensearch-dashboards.yaml.j2 renamed to 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
@@ -6,7 +6,7 @@ commands:
66
helm install opensearch-dashboards opensearch-dashboards
77
--repo https://opensearch-project.github.io/helm-charts
88
--version "{{ test_scenario['values']['opensearch'].split(',')[0] }}"
9-
--values 30_opensearch-dashboards-values.yaml
9+
--values 20_opensearch-dashboards-values.yaml
1010
--namespace $NAMESPACE
1111
--wait
1212
timeout: 600

tests/templates/kuttl/smoke/30_opensearch-dashboards-values.yaml.j2 renamed to tests/templates/kuttl/opensearch-dashboards/20_opensearch-dashboards-values.yaml.j2

File renamed without changes.

tests/templates/kuttl/smoke/40-create-configmap.yaml.j2 renamed to tests/templates/kuttl/opensearch-dashboards/30-create-configmap.yaml.j2

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)