Skip to content

Commit 24e5df6

Browse files
committed
feat(addons): add opensearch
1 parent 95f0b67 commit 24e5df6

59 files changed

Lines changed: 8258 additions & 1 deletion

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

addons/index.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,6 @@ entries:
2424
spark:
2525
- version: 3.4
2626
description: "Apache Spark is a multi-language engine for executing data engineering, data science, and machine learning on single-node machines or clusters."
27+
opensearch:
28+
- version: 2.10
29+
description: "OpenSearch is a scalable, flexible, and extensible open-source software suite for search, analytics, and observability applications licensed under Apache 2.0."
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Copyright VMware, Inc.
2+
# SPDX-License-Identifier: APACHE-2.0
3+
4+
annotations:
5+
category: Analytics
6+
licenses: Apache-2.0
7+
apiVersion: v2
8+
appVersion: 2.10.0
9+
dependencies:
10+
- name: common
11+
repository: oci://registry.drycc.cc/charts
12+
version: ~1.1.3
13+
description: OpenSearch is a scalable open-source solution for search, analytics, and observability. Features full-text queries, natural language processing, custom dictionaries, amongst others.
14+
home: https://bitnami.com
15+
icon: https://bitnami.com/assets/stacks/opensearch/img/opensearch-stack-220x234.png
16+
keywords:
17+
- opensearch
18+
maintainers:
19+
- name: VMware, Inc.
20+
url: https://github.com/bitnami/charts
21+
name: opensearch
22+
sources:
23+
- https://github.com/bitnami/charts/tree/main/bitnami/opensearch
24+
version: 0.2.2

addons/opensearch/2.10/chart/opensearch/README.md

Lines changed: 926 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
CHART NAME: {{ .Chart.Name }}
2+
CHART VERSION: {{ .Chart.Version }}
3+
APP VERSION: {{ .Chart.AppVersion }}
4+
5+
{{- if contains .Values.service.type "LoadBalancer" }}
6+
7+
-------------------------------------------------------------------------------
8+
WARNING
9+
10+
By specifying "service.type=LoadBalancer" you have most likely
11+
exposed the Opensearch service externally.
12+
13+
Please note that Opensearch does not implement a authentication
14+
mechanism to secure your cluster. For security reasons, we strongly
15+
suggest that you switch to "ClusterIP" or "NodePort".
16+
-------------------------------------------------------------------------------
17+
{{- end }}
18+
{{- if not .Values.sysctlImage.enabled }}
19+
20+
-------------------------------------------------------------------------------
21+
WARNING
22+
23+
Opensearch requires some changes in the kernel of the host machine to
24+
work as expected. If those values are not set in the underlying operating
25+
system, the OS containers fail to boot with ERROR messages.
26+
27+
To check whether the host machine meets the requirements, run the command
28+
below:
29+
30+
kubectl logs --namespace {{ include "common.names.namespace" . }} $(kubectl get --namespace {{ include "common.names.namespace" . }} \
31+
pods -l app={{ template "common.names.name" . }},role=master -o jsonpath='{.items[0].metadata.name}') \
32+
opensearch
33+
34+
You can adapt the Kernel parameters on you cluster as described in the
35+
official documentation:
36+
37+
https://kubernetes.io/docs/tasks/administer-cluster/sysctl-cluster
38+
39+
As an alternative, you can specify "sysctlImage.enabled=true" to use a
40+
privileged initContainer to change those settings in the Kernel:
41+
42+
helm upgrade --namespace {{ include "common.names.namespace" . }} {{ .Release.Name }} oci://registry-1.docker.io/bitnamicharts/opensearch --set sysctlImage.enabled=true
43+
44+
Note that this requires the ability to run privileged containers, which is likely not
45+
the case on many secure clusters. To cover this use case, you can also set some parameters
46+
in the config file to customize the default settings:
47+
48+
https://www.open.co/guide/en/opensearch/reference/current/index-modules-store.html
49+
https://www.open.co/guide/en/cloud-on-k8s/master/k8s-virtual-memory.html
50+
51+
For that, you can place the desired parameters by using the "config" block present in the values.yaml
52+
53+
{{- else if .Values.sysctlImage.enabled }}
54+
55+
-------------------------------------------------------------------------------
56+
WARNING
57+
58+
Opensearch requires some changes in the kernel of the host machine to
59+
work as expected. If those values are not set in the underlying operating
60+
system, the OS containers fail to boot with ERROR messages.
61+
62+
More information about these requirements can be found in the links below:
63+
64+
https://www.open.co/guide/en/opensearch/reference/current/file-descriptors.html
65+
https://www.open.co/guide/en/opensearch/reference/current/vm-max-map-count.html
66+
67+
This chart uses a privileged initContainer to change those settings in the Kernel
68+
by running: sysctl -w vm.max_map_count=262144 && sysctl -w fs.file-max=65536
69+
70+
{{- end }}
71+
72+
** Please be patient while the chart is being deployed **
73+
74+
{{- if .Values.diagnosticMode.enabled }}
75+
The chart has been deployed in diagnostic mode. All probes have been disabled and the command has been overwritten with:
76+
77+
command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 4 }}
78+
args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 4 }}
79+
80+
Get the list of pods by executing:
81+
82+
kubectl get pods --namespace {{ include "common.names.namespace" . }} -l app.kubernetes.io/instance={{ .Release.Name }}
83+
84+
Access the pod you want to debug by executing
85+
86+
kubectl exec --namespace {{ include "common.names.namespace" . }} -ti <NAME OF THE POD> -- bash
87+
88+
In order to replicate the container startup scripts execute this command:
89+
90+
/opt/drycc/scripts/opensearch/entrypoint.sh /opt/drycc/scripts/opensearch/run.sh
91+
92+
{{- else }}
93+
94+
Opensearch can be accessed within the cluster on port {{ include "opensearch.service.ports.restAPI" . }} at {{ template "opensearch.service.name" . }}.{{ include "common.names.namespace" . }}.svc.{{ .Values.clusterDomain }}
95+
96+
To access from outside the cluster execute the following commands:
97+
98+
{{- if contains "NodePort" .Values.service.type }}
99+
100+
export NODE_PORT=$(kubectl get --namespace {{ include "common.names.namespace" . }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "opensearch.service.name" . }})
101+
export NODE_IP=$(kubectl get nodes --namespace {{ include "common.names.namespace" . }} -o jsonpath="{.items[0].status.addresses[0].address}")
102+
curl http://$NODE_IP:$NODE_PORT/
103+
{{- else if contains "LoadBalancer" .Values.service.type }}
104+
105+
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
106+
Watch the status with: 'kubectl get svc --namespace {{ include "common.names.namespace" . }} -w {{ template "opensearch.service.name" . }}'
107+
108+
export SERVICE_IP=$(kubectl get svc --namespace {{ include "common.names.namespace" . }} {{ template "opensearch.service.name" . }} --template "{{ "{{ range (index .status.loadBalancer.ingress 0) }}{{ . }}{{ end }}" }}")
109+
curl http://$SERVICE_IP:{{ include "opensearch.service.ports.restAPI" . }}/
110+
{{- else if contains "ClusterIP" .Values.service.type }}
111+
112+
kubectl port-forward --namespace {{ include "common.names.namespace" . }} svc/{{ template "opensearch.service.name" . }} {{ include "opensearch.service.ports.restAPI" . }}:9200 &
113+
curl http://127.0.0.1:9200/
114+
{{- end }}
115+
116+
{{- include "common.warnings.rollingTag" .Values.image }}
117+
{{- include "common.warnings.rollingTag" .Values.volumePermissions.image }}
118+
{{- include "common.warnings.rollingTag" .Values.sysctlImage }}
119+
120+
{{- end }}
121+
{{ include "opensearch.validateValues" . }}

0 commit comments

Comments
 (0)