Skip to content

Commit eefb8fa

Browse files
Document the OpenSearch operator (#14)
* Copy the docs from the superset-operator * Adapt docs/modules/opensearch/pages/index.adoc * Run pre-commit * Adapt the getting started guide * doc: Remove usage guides with unimplemented features * doc: Adapt resource page * doc: Adapt overrides page * doc: Adapt the operations pages * doc: Adapt the reference pages * doc: Add the node roles page * feat: Add node role coordinating_only * doc: Fix typos and improve style * doc: Fix typo Co-authored-by: Andrew Kenworthy <[email protected]> * doc: Fix typo Co-authored-by: Andrew Kenworthy <[email protected]> * doc: Fix typo Co-authored-by: Andrew Kenworthy <[email protected]> * doc: Fix typo Co-authored-by: Andrew Kenworthy <[email protected]> * doc: Increase timeout * doc: Clarify the term "role" --------- Co-authored-by: Andrew Kenworthy <[email protected]>
1 parent cff9140 commit eefb8fa

33 files changed

+1123
-4
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
version: 0.1.0
3+
spec:
4+
units: []
5+
properties: []

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,10 @@ spec:
136136
nodeRoles:
137137
items:
138138
enum:
139+
- cluster_manager
140+
- coordinating_only
139141
- data
140142
- ingest
141-
- cluster_manager
142143
- remote_cluster_client
143144
- warm
144145
- search
@@ -327,9 +328,10 @@ spec:
327328
nodeRoles:
328329
items:
329330
enum:
331+
- cluster_manager
332+
- coordinating_only
330333
- data
331334
- ingest
332-
- cluster_manager
333335
- remote_cluster_client
334336
- warm
335337
- search

docs/antora.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
name: home
3+
version: "nightly"
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
#! /usr/bin/env bash
2+
set -euo pipefail
3+
4+
# DO NOT EDIT THE SCRIPT
5+
# Instead, update the j2 template, and regenerate it for dev with `make render-docs`.
6+
7+
# This script contains all the code snippets from the guide, as well as some assert tests
8+
# to test if the instructions in the guide work. The user *could* use it, but it is intended
9+
# for testing only.
10+
# The script will install the operators, create a OpenSearch instance and briefly open a port
11+
# forward and connect to the OpenSearch instance to make sure it is up and running.
12+
# No running processes are left behind (i.e. the port-forwarding is closed at the end)
13+
14+
if [ $# -eq 0 ]
15+
then
16+
echo "Installation method argument ('helm' or 'stackablectl') required."
17+
exit 1
18+
fi
19+
20+
cd "$(dirname "$0")"
21+
22+
case "$1" in
23+
"helm")
24+
echo "Installing Operators with Helm"
25+
# tag::helm-install-operators[]
26+
helm install --wait commons-operator oci://oci.stackable.tech/sdp-charts/commons-operator --version 0.0.0-dev
27+
helm install --wait secret-operator oci://oci.stackable.tech/sdp-charts/secret-operator --version 0.0.0-dev
28+
helm install --wait listener-operator oci://oci.stackable.tech/sdp-charts/listener-operator --version 0.0.0-dev
29+
helm install --wait opensearch-operator oci://oci.stackable.tech/sdp-charts/opensearch-operator --version 0.0.0-dev
30+
# end::helm-install-operators[]
31+
;;
32+
"stackablectl")
33+
echo "installing Operators with stackablectl"
34+
# tag::stackablectl-install-operators[]
35+
stackablectl operator install \
36+
commons=0.0.0-dev \
37+
secret=0.0.0-dev \
38+
listener=0.0.0-dev \
39+
opensearch=0.0.0-dev
40+
# end::stackablectl-install-operators[]
41+
;;
42+
*)
43+
echo "Need to give 'helm' or 'stackablectl' as an argument for which installation method to use!"
44+
exit 1
45+
;;
46+
esac
47+
48+
echo "Creating OpenSearch security plugin configuration"
49+
# tag::apply-security-config[]
50+
kubectl apply -f opensearch-security-config.yaml
51+
# end::apply-security-config[]
52+
53+
echo "Creating OpenSearch cluster"
54+
# tag::apply-cluster[]
55+
kubectl apply -f opensearch.yaml
56+
# end::apply-cluster[]
57+
58+
sleep 5
59+
60+
for (( i=1; i<=15; i++ ))
61+
do
62+
echo "Waiting for OpenSearchCluster to appear ..."
63+
if eval kubectl get statefulset simple-opensearch-nodes-default; then
64+
break
65+
fi
66+
67+
sleep 1
68+
done
69+
70+
echo "Waiting on OpenSearch StatefulSet ..."
71+
# tag::await-cluster[]
72+
kubectl rollout status --watch statefulset/simple-opensearch-nodes-default --timeout 600s
73+
# end::await-cluster[]
74+
75+
# wait a bit for the port to open
76+
sleep 10
77+
78+
echo "Starting port-forwarding of port 9200"
79+
# tag::port-forwarding[]
80+
kubectl port-forward services/simple-opensearch 9200 > /dev/null 2>&1 &
81+
# end::port-forwarding[]
82+
PORT_FORWARD_PID=$!
83+
# shellcheck disable=2064 # we want the PID evaluated now, not at the time the trap is
84+
trap "kill $PORT_FORWARD_PID" EXIT
85+
sleep 5
86+
87+
echo "Using the REST API"
88+
# tag::rest-api[]
89+
export CREDENTIALS=admin:AJVFsGJBbpT6mChn
90+
91+
curl \
92+
--insecure \
93+
--user $CREDENTIALS \
94+
--request PUT \
95+
--json '{"name": "Stackable"}' \
96+
https://localhost:9200/sample_index/_doc/1
97+
98+
# Output:
99+
# {"_index":"sample_index","_id":"1","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":0,"_primary_term":1}
100+
101+
curl \
102+
--insecure \
103+
--user $CREDENTIALS \
104+
--request GET \
105+
https://localhost:9200/sample_index/_doc/1
106+
107+
# Output:
108+
# {"_index":"sample_index","_id":"1","_version":1,"_seq_no":0,"_primary_term":1,"found":true,"_source":{"name": "Stackable"}}
109+
# end::rest-api[]
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
#! /usr/bin/env bash
2+
set -euo pipefail
3+
4+
# DO NOT EDIT THE SCRIPT
5+
# Instead, update the j2 template, and regenerate it for dev with `make render-docs`.
6+
7+
# This script contains all the code snippets from the guide, as well as some assert tests
8+
# to test if the instructions in the guide work. The user *could* use it, but it is intended
9+
# for testing only.
10+
# The script will install the operators, create a OpenSearch instance and briefly open a port
11+
# forward and connect to the OpenSearch instance to make sure it is up and running.
12+
# No running processes are left behind (i.e. the port-forwarding is closed at the end)
13+
14+
if [ $# -eq 0 ]
15+
then
16+
echo "Installation method argument ('helm' or 'stackablectl') required."
17+
exit 1
18+
fi
19+
20+
cd "$(dirname "$0")"
21+
22+
case "$1" in
23+
"helm")
24+
echo "Installing Operators with Helm"
25+
# tag::helm-install-operators[]
26+
helm install --wait commons-operator oci://{{ helm.repo_url }}/{{ helm.repo_name }}/commons-operator --version {{ versions.commons }}
27+
helm install --wait secret-operator oci://{{ helm.repo_url }}/{{ helm.repo_name }}/secret-operator --version {{ versions.secret }}
28+
helm install --wait listener-operator oci://{{ helm.repo_url }}/{{ helm.repo_name }}/listener-operator --version {{ versions.listener }}
29+
helm install --wait opensearch-operator oci://{{ helm.repo_url }}/{{ helm.repo_name }}/opensearch-operator --version {{ versions.opensearch }}
30+
# end::helm-install-operators[]
31+
;;
32+
"stackablectl")
33+
echo "installing Operators with stackablectl"
34+
# tag::stackablectl-install-operators[]
35+
stackablectl operator install \
36+
commons={{ versions.commons }} \
37+
secret={{ versions.secret }} \
38+
listener={{ versions.listener }} \
39+
opensearch={{ versions.opensearch }}
40+
# end::stackablectl-install-operators[]
41+
;;
42+
*)
43+
echo "Need to give 'helm' or 'stackablectl' as an argument for which installation method to use!"
44+
exit 1
45+
;;
46+
esac
47+
48+
echo "Creating OpenSearch security plugin configuration"
49+
# tag::apply-security-config[]
50+
kubectl apply -f opensearch-security-config.yaml
51+
# end::apply-security-config[]
52+
53+
echo "Creating OpenSearch cluster"
54+
# tag::apply-cluster[]
55+
kubectl apply -f opensearch.yaml
56+
# end::apply-cluster[]
57+
58+
sleep 5
59+
60+
for (( i=1; i<=15; i++ ))
61+
do
62+
echo "Waiting for OpenSearchCluster to appear ..."
63+
if eval kubectl get statefulset simple-opensearch-nodes-default; then
64+
break
65+
fi
66+
67+
sleep 1
68+
done
69+
70+
echo "Waiting on OpenSearch StatefulSet ..."
71+
# tag::await-cluster[]
72+
kubectl rollout status --watch statefulset/simple-opensearch-nodes-default --timeout 600s
73+
# end::await-cluster[]
74+
75+
# wait a bit for the port to open
76+
sleep 10
77+
78+
echo "Starting port-forwarding of port 9200"
79+
# tag::port-forwarding[]
80+
kubectl port-forward services/simple-opensearch 9200 > /dev/null 2>&1 &
81+
# end::port-forwarding[]
82+
PORT_FORWARD_PID=$!
83+
# shellcheck disable=2064 # we want the PID evaluated now, not at the time the trap is
84+
trap "kill $PORT_FORWARD_PID" EXIT
85+
sleep 5
86+
87+
echo "Using the REST API"
88+
# tag::rest-api[]
89+
export CREDENTIALS=admin:AJVFsGJBbpT6mChn
90+
91+
curl \
92+
--insecure \
93+
--user $CREDENTIALS \
94+
--request PUT \
95+
--json '{"name": "Stackable"}' \
96+
https://localhost:9200/sample_index/_doc/1
97+
98+
# Output:
99+
# {"_index":"sample_index","_id":"1","_version":1,"result":"created","_shards":{"total":2,"successful":1,"failed":0},"_seq_no":0,"_primary_term":1}
100+
101+
curl \
102+
--insecure \
103+
--user $CREDENTIALS \
104+
--request GET \
105+
https://localhost:9200/sample_index/_doc/1
106+
107+
# Output:
108+
# {"_index":"sample_index","_id":"1","_version":1,"_seq_no":0,"_primary_term":1,"found":true,"_source":{"name": "Stackable"}}
109+
# end::rest-api[]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Installed commons=0.0.0-dev operator
2+
Installed secret=0.0.0-dev operator
3+
Installed listener=0.0.0-dev operator
4+
Installed opensearch=0.0.0-dev operator
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Installed commons={{ versions.commons }} operator
2+
Installed secret={{ versions.secret }} operator
3+
Installed listener={{ versions.listener }} operator
4+
Installed opensearch={{ versions.opensearch }} operator
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
---
2+
apiVersion: v1
3+
kind: Secret
4+
metadata:
5+
name: opensearch-security-config
6+
stringData:
7+
action_groups.yml: |
8+
---
9+
_meta:
10+
type: actiongroups
11+
config_version: 2
12+
allowlist.yml: |
13+
---
14+
_meta:
15+
type: allowlist
16+
config_version: 2
17+
18+
config:
19+
enabled: false
20+
audit.yml: |
21+
---
22+
_meta:
23+
type: audit
24+
config_version: 2
25+
26+
config:
27+
enabled: false
28+
config.yml: |
29+
---
30+
_meta:
31+
type: config
32+
config_version: 2
33+
34+
config:
35+
dynamic:
36+
authc:
37+
basic_internal_auth_domain:
38+
description: Authenticate via HTTP Basic against internal users database
39+
http_enabled: true
40+
transport_enabled: true
41+
order: 1
42+
http_authenticator:
43+
type: basic
44+
challenge: true
45+
authentication_backend:
46+
type: intern
47+
authz: {}
48+
internal_users.yml: |
49+
---
50+
_meta:
51+
type: internalusers
52+
config_version: 2
53+
54+
admin:
55+
hash: $2y$10$xRtHZFJ9QhG9GcYhRpAGpufCZYsk//nxsuel5URh0GWEBgmiI4Q/e
56+
reserved: true
57+
backend_roles:
58+
- admin
59+
description: OpenSearch admin user
60+
61+
kibanaserver:
62+
hash: $2y$10$vPgQ/6ilKDM5utawBqxoR.7euhVQ0qeGl8mPTeKhmFT475WUDrfQS
63+
reserved: true
64+
description: OpenSearch Dashboards user
65+
nodes_dn.yml: |
66+
---
67+
_meta:
68+
type: nodesdn
69+
config_version: 2
70+
roles.yml: |
71+
---
72+
_meta:
73+
type: roles
74+
config_version: 2
75+
roles_mapping.yml: |
76+
---
77+
_meta:
78+
type: rolesmapping
79+
config_version: 2
80+
81+
all_access:
82+
reserved: false
83+
backend_roles:
84+
- admin
85+
86+
kibana_server:
87+
reserved: true
88+
users:
89+
- kibanaserver
90+
tenants.yml: |
91+
---
92+
_meta:
93+
type: tenants
94+
config_version: 2

0 commit comments

Comments
 (0)