|
| 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 | + |
| 115 | +{{- end }} |
| 116 | +{{- end }} |
| 117 | + |
| 118 | +{{ include "opensearch.validateValues" . }} |
| 119 | +{{- include "common.warnings.rollingTag" .Values.image }} |
| 120 | +{{- include "common.warnings.rollingTag" .Values.sysctlImage }} |
| 121 | +{{- include "common.warnings.rollingTag" .Values.dashboards.image }} |
| 122 | +{{- include "common.warnings.rollingTag" .Values.volumePermissions.image }} |
| 123 | +{{- include "common.warnings.rollingTag" .Values.snapshots.image }} |
| 124 | +{{- include "common.warnings.resources" (dict "sections" (list "coordinating" "dashboards" "data" "ingest" "master" "sysctlImage" "volumePermissions" "snapshots") "context" $) }} |
| 125 | +{{- include "common.warnings.modifiedImages" (dict "images" (list .Values.image .Values.volumePermissions.image .Values.sysctlImage .Values.dashboards.image .Values.snapshots.image) "context" $) }} |
| 126 | +{{- include "common.errors.insecureImages" (dict "images" (list .Values.image .Values.volumePermissions.image .Values.sysctlImage .Values.dashboards.image .Values.snapshots.image) "context" $) }} |
0 commit comments