-
-
Notifications
You must be signed in to change notification settings - Fork 0
test: Create integration test for OpenSearch Dashboards #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
1681268
extend smoke test with opensearch-dashboards
labrenbe 7ebbba8
move opensearch-dashboards into own test
labrenbe b6d774e
Update tests/templates/kuttl/opensearch-dashboards/20_opensearch-dash…
labrenbe cbe9988
Merge remote-tracking branch 'origin/main' into test/opensearch-dashb…
labrenbe a22c9c6
add vector aggregator to test
labrenbe 05d696a
verify the opensearch tls cert in the opensearch-dashboards test
labrenbe 9de7edb
address feedback on PR
labrenbe ed57fd0
remove limit range
labrenbe 2d0ac53
remove unnecessary comment
labrenbe 37cb841
Apply suggestions from code review
labrenbe c77ed2f
set listener class in test to external-stable
labrenbe 5aa1595
directly create cm with test script
labrenbe 88f92dd
run opensearch-dashboards test with original image
labrenbe 4d7958d
removed openshift dimension
labrenbe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
tests/templates/kuttl/opensearch-dashboards/00-patch-ns.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| # see https://github.com/stackabletech/issues/issues/566 | ||
| --- | ||
| apiVersion: kuttl.dev/v1beta1 | ||
| kind: TestStep | ||
| commands: | ||
| - script: | | ||
| kubectl patch namespace $NAMESPACE --patch=' | ||
| { | ||
| "metadata": { | ||
| "labels": { | ||
| "pod-security.kubernetes.io/enforce": "privileged" | ||
| } | ||
| } | ||
| }' | ||
| timeout: 120 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| --- | ||
| apiVersion: v1 | ||
| kind: ServiceAccount | ||
| metadata: | ||
| name: test-service-account | ||
| --- | ||
| kind: Role | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| metadata: | ||
| name: test-role | ||
| rules: | ||
| - apiGroups: | ||
| - security.openshift.io | ||
| resources: | ||
| - securitycontextconstraints | ||
| resourceNames: | ||
| - privileged | ||
| verbs: | ||
| - use | ||
| --- | ||
| kind: RoleBinding | ||
| apiVersion: rbac.authorization.k8s.io/v1 | ||
| metadata: | ||
| name: test-role-binding | ||
| subjects: | ||
| - kind: ServiceAccount | ||
| name: test-service-account | ||
| roleRef: | ||
| apiGroup: rbac.authorization.k8s.io | ||
| kind: Role | ||
| name: test-role |
11 changes: 11 additions & 0 deletions
11
tests/templates/kuttl/opensearch-dashboards/02-limit-range.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| --- | ||
| apiVersion: v1 | ||
| kind: LimitRange | ||
| metadata: | ||
| name: limit-request-ratio | ||
| spec: | ||
| limits: | ||
| - type: Container | ||
| maxLimitRequestRatio: | ||
| cpu: 5 | ||
| memory: 1 |
23 changes: 23 additions & 0 deletions
23
tests/templates/kuttl/opensearch-dashboards/10-assert.yaml.j2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # All fields are checked that are set by the operator. | ||
| # This helps to detect unintentional changes. It is also a good reference for the output of the | ||
| # operator. The maintenance effort should be okay as long as it is only done in the smoke test. | ||
siegfriedweber marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| --- | ||
| apiVersion: kuttl.dev/v1beta1 | ||
| kind: TestAssert | ||
| timeout: 600 | ||
| --- | ||
| apiVersion: apps/v1 | ||
| kind: StatefulSet | ||
| metadata: | ||
| name: opensearch-nodes-cluster-manager | ||
| status: | ||
| readyReplicas: 1 | ||
| replicas: 1 | ||
| --- | ||
| apiVersion: apps/v1 | ||
| kind: StatefulSet | ||
| metadata: | ||
| name: opensearch-nodes-data | ||
| status: | ||
| readyReplicas: 1 | ||
| replicas: 1 | ||
213 changes: 213 additions & 0 deletions
213
tests/templates/kuttl/opensearch-dashboards/10-install-opensearch.yaml.j2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,213 @@ | ||
| --- | ||
| apiVersion: opensearch.stackable.tech/v1alpha1 | ||
| kind: OpenSearchCluster | ||
| metadata: | ||
| name: opensearch | ||
| spec: | ||
| image: | ||
| {% if test_scenario['values']['opensearch'].find(",") > 0 %} | ||
| custom: "{{ test_scenario['values']['opensearch'].split(',')[1] }}" | ||
| productVersion: "{{ test_scenario['values']['opensearch'].split(',')[0] }}" | ||
| {% else %} | ||
| productVersion: "{{ test_scenario['values']['opensearch'] }}" | ||
| {% endif %} | ||
| pullPolicy: IfNotPresent | ||
| nodes: | ||
| roleGroups: | ||
| cluster-manager: | ||
siegfriedweber marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| config: | ||
| nodeRoles: | ||
| - cluster_manager | ||
| resources: | ||
| storage: | ||
| data: | ||
| capacity: 100Mi | ||
| listenerClass: external-stable | ||
| replicas: 1 | ||
| podOverrides: | ||
| spec: | ||
| volumes: | ||
| - name: tls | ||
| ephemeral: | ||
| volumeClaimTemplate: | ||
| metadata: | ||
| annotations: | ||
| secrets.stackable.tech/scope: node,pod,service=opensearch,service=opensearch-nodes-cluster-manager-headless | ||
labrenbe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| data: | ||
| config: | ||
| nodeRoles: | ||
| - ingest | ||
| - data | ||
| - remote_cluster_client | ||
| resources: | ||
| storage: | ||
| data: | ||
| capacity: 2Gi | ||
| listenerClass: cluster-internal | ||
| replicas: 1 | ||
| podOverrides: | ||
| spec: | ||
| volumes: | ||
| - name: tls | ||
| ephemeral: | ||
| volumeClaimTemplate: | ||
| metadata: | ||
| annotations: | ||
| secrets.stackable.tech/scope: node,pod,service=opensearch-nodes-data-headless | ||
| envOverrides: | ||
| # Only required for the official image | ||
| # The official image (built with https://github.com/opensearch-project/opensearch-build) | ||
| # installs a demo configuration if not disabled explicitly. | ||
| DISABLE_INSTALL_DEMO_CONFIG: "true" | ||
| OPENSEARCH_HOME: {{ test_scenario['values']['opensearch_home'] }} | ||
| configOverrides: | ||
| opensearch.yml: | ||
| # Disable memory mapping in this test; If memory mapping were activated, the kernel setting | ||
| # vm.max_map_count would have to be increased to 262144 on the node. | ||
| node.store.allow_mmap: "false" | ||
| # Disable the disk allocation decider in this test; Otherwise the test depends on the disk | ||
| # usage of the node and if the relative watermark set in | ||
| # `cluster.routing.allocation.disk.watermark.high` is reached then the security index could | ||
| # not be created even if enough disk space would be available. | ||
| cluster.routing.allocation.disk.threshold_enabled: "false" | ||
| plugins.security.allow_default_init_securityindex: "true" | ||
| plugins.security.ssl.transport.enabled: "true" | ||
| plugins.security.ssl.transport.pemcert_filepath: {{ test_scenario['values']['opensearch_home'] }}/config/tls/tls.crt | ||
| plugins.security.ssl.transport.pemkey_filepath: {{ test_scenario['values']['opensearch_home'] }}/config/tls/tls.key | ||
| plugins.security.ssl.transport.pemtrustedcas_filepath: {{ test_scenario['values']['opensearch_home'] }}/config/tls/ca.crt | ||
| plugins.security.ssl.http.enabled: "true" | ||
| plugins.security.ssl.http.pemcert_filepath: {{ test_scenario['values']['opensearch_home'] }}/config/tls/tls.crt | ||
| plugins.security.ssl.http.pemkey_filepath: {{ test_scenario['values']['opensearch_home'] }}/config/tls/tls.key | ||
| plugins.security.ssl.http.pemtrustedcas_filepath: {{ test_scenario['values']['opensearch_home'] }}/config/tls/ca.crt | ||
| podOverrides: | ||
| spec: | ||
| containers: | ||
| - name: opensearch | ||
| volumeMounts: | ||
| - name: security-config | ||
| mountPath: {{ test_scenario['values']['opensearch_home'] }}/config/opensearch-security | ||
| readOnly: true | ||
| - name: tls | ||
| mountPath: {{ test_scenario['values']['opensearch_home'] }}/config/tls | ||
| readOnly: true | ||
| volumes: | ||
| - name: security-config | ||
| secret: | ||
| secretName: opensearch-security-config | ||
| - name: tls | ||
| ephemeral: | ||
| volumeClaimTemplate: | ||
| metadata: | ||
| annotations: | ||
| secrets.stackable.tech/class: tls | ||
| spec: | ||
| storageClassName: secrets.stackable.tech | ||
| accessModes: | ||
| - ReadWriteOnce | ||
| resources: | ||
| requests: | ||
| storage: "1" | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Secret | ||
| metadata: | ||
| name: opensearch-credentials | ||
| data: | ||
| admin: QUpWRnNHSkJicFQ2bUNobg== # AJVFsGJBbpT6mChn | ||
| kibanaserver: RTRrRU51RW1rcUgzanlIQw== # E4kENuEmkqH3jyHC | ||
| --- | ||
| apiVersion: v1 | ||
| kind: Secret | ||
| metadata: | ||
| name: opensearch-security-config | ||
| stringData: | ||
| action_groups.yml: | | ||
| --- | ||
| _meta: | ||
| type: actiongroups | ||
| config_version: 2 | ||
| allowlist.yml: | | ||
| --- | ||
| _meta: | ||
| type: allowlist | ||
| config_version: 2 | ||
|
|
||
| config: | ||
| enabled: false | ||
| audit.yml: | | ||
| --- | ||
| _meta: | ||
| type: audit | ||
| config_version: 2 | ||
|
|
||
| config: | ||
| enabled: false | ||
| config.yml: | | ||
| --- | ||
| _meta: | ||
| type: config | ||
| config_version: 2 | ||
|
|
||
| config: | ||
| dynamic: | ||
| authc: | ||
| basic_internal_auth_domain: | ||
| description: Authenticate via HTTP Basic against internal users database | ||
| http_enabled: true | ||
| transport_enabled: true | ||
| order: 1 | ||
| http_authenticator: | ||
| type: basic | ||
| challenge: true | ||
| authentication_backend: | ||
| type: intern | ||
| authz: {} | ||
| internal_users.yml: | | ||
| --- | ||
| # The hash value is a bcrypt hash and can be generated with plugin/tools/hash.sh | ||
|
|
||
| _meta: | ||
| type: internalusers | ||
| config_version: 2 | ||
|
|
||
| admin: | ||
| hash: $2y$10$xRtHZFJ9QhG9GcYhRpAGpufCZYsk//nxsuel5URh0GWEBgmiI4Q/e | ||
| reserved: true | ||
| backend_roles: | ||
| - admin | ||
| description: OpenSearch admin user | ||
|
|
||
| kibanaserver: | ||
| hash: $2y$10$vPgQ/6ilKDM5utawBqxoR.7euhVQ0qeGl8mPTeKhmFT475WUDrfQS | ||
| reserved: true | ||
| description: OpenSearch Dashboards user | ||
| nodes_dn.yml: | | ||
| --- | ||
| _meta: | ||
| type: nodesdn | ||
| config_version: 2 | ||
| roles.yml: | | ||
| --- | ||
| _meta: | ||
| type: roles | ||
| config_version: 2 | ||
| roles_mapping.yml: | | ||
| --- | ||
| _meta: | ||
| type: rolesmapping | ||
| config_version: 2 | ||
|
|
||
| all_access: | ||
| reserved: false | ||
| backend_roles: | ||
| - admin | ||
|
|
||
| kibana_server: | ||
| reserved: true | ||
| users: | ||
| - kibanaserver | ||
| tenants.yml: | | ||
| --- | ||
| _meta: | ||
| type: tenants | ||
| config_version: 2 | ||
12 changes: 12 additions & 0 deletions
12
tests/templates/kuttl/opensearch-dashboards/20-assert.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| --- | ||
| apiVersion: kuttl.dev/v1beta1 | ||
| kind: TestAssert | ||
| timeout: 600 | ||
| --- | ||
| apiVersion: apps/v1 | ||
| kind: Deployment | ||
| metadata: | ||
| name: opensearch-dashboards | ||
| status: | ||
| readyReplicas: 1 | ||
| replicas: 1 |
12 changes: 12 additions & 0 deletions
12
tests/templates/kuttl/opensearch-dashboards/20-install-opensearch-dashboards.yaml.j2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| --- | ||
| apiVersion: kuttl.dev/v1beta1 | ||
| kind: TestStep | ||
| commands: | ||
| - script: > | ||
| helm install opensearch-dashboards opensearch-dashboards | ||
| --repo https://opensearch-project.github.io/helm-charts | ||
| --version "{{ test_scenario['values']['opensearch'].split(',')[0] }}" | ||
| --values 20_opensearch-dashboards-values.yaml | ||
| --namespace $NAMESPACE | ||
siegfriedweber marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| --wait | ||
| timeout: 600 | ||
17 changes: 17 additions & 0 deletions
17
tests/templates/kuttl/opensearch-dashboards/20_opensearch-dashboards-values.yaml.j2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| opensearchHosts: https://opensearch-nodes-cluster-manager:9200 | ||
| image: | ||
| repository: oci.stackable.tech/sdp/opensearch-dashboards | ||
| tag: {{ test_scenario['values']['opensearch'].split(',')[0] }}-stackable0.0.0-dev | ||
| service: | ||
| type: NodePort | ||
| serviceAccount: | ||
| # The Helm chart appends "-dashboards", so that the actual | ||
| # ServiceAccount name is "opensearch-dashboards". | ||
| # see https://github.com/opensearch-project/helm-charts/blob/opensearch-dashboards-2.27.1/charts/opensearch-dashboards/templates/_helpers.tpl#L58 | ||
| name: opensearch | ||
labrenbe marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| extraEnvs: | ||
| - name: OPENSEARCH_PASSWORD | ||
| valueFrom: | ||
| secretKeyRef: | ||
| name: opensearch-credentials | ||
| key: kibanaserver | ||
4 changes: 4 additions & 0 deletions
4
tests/templates/kuttl/opensearch-dashboards/30-create-configmap.yaml.j2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| apiVersion: kuttl.dev/v1beta1 | ||
| kind: TestStep | ||
| commands: | ||
| - script: kubectl create cm test-script -n $NAMESPACE --from-file=test.py |
14 changes: 14 additions & 0 deletions
14
tests/templates/kuttl/opensearch-dashboards/31-assert.yaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| --- | ||
| apiVersion: kuttl.dev/v1beta1 | ||
| kind: TestAssert | ||
| metadata: | ||
| name: install-test-container | ||
| timeout: 300 | ||
| --- | ||
| apiVersion: apps/v1 | ||
| kind: StatefulSet | ||
| metadata: | ||
| name: python | ||
| status: | ||
| readyReplicas: 1 | ||
| replicas: 1 |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.