### Disable Demo Configuration Installation Source: https://github.com/opensearch-project/helm-charts/blob/main/README.md Example of disabling the automatic execution of `install_demo_configuration.sh` by setting the `DISABLE_INSTALL_DEMO_CONFIG` environment variable to 'true' in value.yml. This can resolve startup issues when using custom certificates. ```yaml extraEnvs: - name: DISABLE_INSTALL_DEMO_CONFIG value: "true" ``` -------------------------------- ### Install OpenSearch Helm Chart Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch/README.md Installs the OpenSearch Helm chart with default configurations. Ensure the Helm repository is added before running this command. ```shell helm install my-release opensearch/opensearch ``` -------------------------------- ### Install OpenSearch Helm Chart Source: https://github.com/opensearch-project/helm-charts/blob/main/README.md Basic command to install an OpenSearch Helm chart with a custom deployment name. ```shell helm install my-deployment opensearch/ ``` -------------------------------- ### Install Data Prepper Chart Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/data-prepper/README.md Install the Data Prepper Helm chart using the Helm package manager. Replace 'my-data-prepper-release' with your desired release name. If no pipeline is defined, a demo pipeline with a random source and stdout sink will be configured. ```bash helm install my-data-prepper-release opensearch/data-prepper ``` -------------------------------- ### Configure Startup Probe Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch/README.md Define a startup probe to check if a container has started successfully. If the startup probe fails, the container is restarted. ```yaml startupProbe: httpGet: path: /_cluster/health port: 9200 failureThreshold: 30 periodSeconds: 10 ``` -------------------------------- ### Get Application URL with Ingress Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch-dashboards/templates/NOTES.txt Use this when Ingress is enabled to construct the application URL. ```go-template {{- if .Values.ingress.enabled }} {{- range $host := .Values.ingress.hosts }} {{- range .paths }} http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} {{- end }} {{- end }} {{- end }} ``` -------------------------------- ### Get Application URL with ClusterIP and Port Forwarding Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch-dashboards/templates/NOTES.txt Use this when the service type is ClusterIP. This method sets up port forwarding to access the application locally. ```bash {{- else if contains "ClusterIP" .Values.service.type }} export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "opensearch-dashboards.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") echo "Visit http://127.0.0.1:8080 to use your application" kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT {{- end }} ``` -------------------------------- ### Set Admin Password During Installation Source: https://github.com/opensearch-project/helm-charts/blob/main/README.md Alternative method to set the custom admin password directly during `helm install` using the `--set` flag. ```shell helm install opensearch opensearch/opensearch --set extraEnvs[0].name=OPENSEARCH_INITIAL_ADMIN_PASSWORD,extraEnvs[0].value=$OPENSEARCH_INITIAL_ADMIN_PASSWORD ``` -------------------------------- ### Install OpenSearch Dashboards Helm Chart Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch-dashboards/README.md Deploys OpenSearch Dashboards with its associated components on a Kubernetes cluster in the default configuration. Ensure you have added the Helm repository first. ```shell helm install my-release opensearch/opensearch-dashboards ``` -------------------------------- ### Get Application URL with LoadBalancer Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch-dashboards/templates/NOTES.txt Use this when the service type is LoadBalancer. Note that it may take a few minutes for the LoadBalancer IP to be available. You can monitor its status with 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "opensearch-dashboards.fullname" . }}'. ```bash {{- else if contains "LoadBalancer" .Values.service.type }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "opensearch-dashboards.fullname" . }}' export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "opensearch-dashboards.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}) echo http://$SERVICE_IP:{{ .Values.service.port }} {{- end }} ``` -------------------------------- ### Configure Custom Admin Password Source: https://github.com/opensearch-project/helm-charts/blob/main/README.md Example of setting a custom strong password for the initial admin user via a value.yml file. This is required for OpenSearch versions 2.12.0 and above to prevent cluster startup failures. ```yaml extraEnvs: - name: OPENSEARCH_INITIAL_ADMIN_PASSWORD value: ``` -------------------------------- ### Get Application URL with NodePort Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch-dashboards/templates/NOTES.txt Use this when the service type is NodePort to get the application URL. It requires kubectl to fetch the NodePort and Node IP. ```bash {{- else if contains "NodePort" .Values.service.type }} export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "opensearch-dashboards.fullname" . }}) export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") echo http://$NODE_IP:$NODE_PORT {{- end }} ``` -------------------------------- ### Get Application URL with LoadBalancer Service Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/data-prepper/templates/NOTES.txt Retrieves the application URL for a LoadBalancer service. Note that it may take a few minutes for the LoadBalancer IP to become available. Monitor its status with 'kubectl get svc -w'. ```bash NOTE: It may take a few minutes for the LoadBalancer IP to be available. You can watch its status by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "data-prepper.fullname" . }}' export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "data-prepper.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}) echo http://$SERVICE_IP:{{ .Values.service.port }} ``` -------------------------------- ### Get Application URL with ClusterIP Service Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/data-prepper/templates/NOTES.txt Provides instructions to access an application using a ClusterIP service via port-forwarding. This method exposes the application on localhost. ```bash export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "data-prepper.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") echo "Visit http://127.0.0.1:8080 to use your application" kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT ``` -------------------------------- ### Get Application URL with NodePort Service Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/data-prepper/templates/NOTES.txt Obtains the application URL for a NodePort service. This command requires kubectl to be configured and the NodePort to be accessible. ```bash export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "data-prepper.fullname" . }}) export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") echo http://$NODE_IP:$NODE_PORT ``` -------------------------------- ### Check Demo Pipeline Configuration Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/data-prepper/templates/NOTES.txt Determines if the demo pipeline configuration is enabled. This configuration uses the 'random' source and 'stdout' sink. ```go-template {{- if eq "true" (include "data-prepper.demoPipeline" .) }} The demo pipeline configuration is enabled, using the `random` source and `stdout` sink. {{- end }} ``` -------------------------------- ### Configure Readiness Probe Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch/README.md Define a readiness probe to determine when a container is ready to serve traffic. The probe is executed periodically. ```yaml readinessProbe: httpGet: path: /_cluster/health port: 9200 initialDelaySeconds: 5 periodSeconds: 10 ``` -------------------------------- ### Clone Repository Source: https://github.com/opensearch-project/helm-charts/blob/main/DEVELOPER_GUIDE.md Clone the repository locally after forking it on GitHub. ```bash git clone ``` -------------------------------- ### Configure StatefulSet Volume Claim Templates Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch/README.md Define persistent volume claims for StatefulSet pods, ensuring stable storage for each pod instance. ```yaml volumeClaimTemplates: - metadata: name: workdir spec: accessModes: ["ReadWriteOnce"] resources: requests: storage: 10Gi ``` -------------------------------- ### Check Inline Pipeline Configuration Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/data-prepper/templates/NOTES.txt Identifies if inline pipeline configuration is enabled. Refer to the values.yaml file for specific configuration details. ```go-template {{- else if .Values.pipelineConfig.enabled }} Inline pipeline configuration is enabled. Please refer to the values.yaml file for the configuration. {{- end }} ``` -------------------------------- ### Watch Cluster Members Come Up Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch/templates/NOTES.txt Use this command to monitor the status of OpenSearch cluster members as they become available. It filters pods by the component label and watches for changes. ```bash kubectl get pods --namespace={{ .Release.Namespace }} -l app.kubernetes.io/component={{ template "opensearch.uname" . }} -w ``` -------------------------------- ### Configure Termination Grace Period Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch/README.md Specify the duration (in seconds) for which the kubelet will wait before the container is forcefully killed. Allows for graceful shutdown. ```yaml terminationGracePeriodSeconds: 60 ``` -------------------------------- ### Configure Pod Environment Variables from ConfigMap Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch/README.md Set environment variables in a pod by referencing keys from a ConfigMap. Ensure the ConfigMap is created before the pod. ```yaml env: - name: MY_ENV_VAR valueFrom: configMapKeyRef: name: my-configmap key: my-key ``` -------------------------------- ### Add and Update Helm Repository Source: https://github.com/opensearch-project/helm-charts/blob/main/README.md Commands to add the OpenSearch Helm chart repository and update your local repository references. ```shell helm repo add opensearch https://opensearch-project.github.io/helm-charts/ helm repo update ``` -------------------------------- ### Set Container Resource Limits and Requests Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch/README.md Specify CPU and memory limits and requests for containers to manage resource allocation and prevent resource starvation. ```yaml resources: requests: cpu: "100m" memory: "128Mi" limits: cpu: "500m" memory: "512Mi" ``` -------------------------------- ### Configure Security Context for Pods and Containers Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch/README.md Define privilege and access control settings for pods or containers. This includes user/group IDs and capabilities. ```yaml securityContext: runAsUser: 1000 runAsGroup: 1000 fsGroup: 1000 ``` -------------------------------- ### Search Helm Charts Source: https://github.com/opensearch-project/helm-charts/blob/main/README.md Command to search for available OpenSearch charts within your configured repositories. ```shell helm search repo opensearch ``` -------------------------------- ### Configure Pod Disruption Budget (maxUnavailable) Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch/README.md Set the maximum number of pods that can be unavailable during voluntary disruptions. This ensures application availability. ```yaml podDisruptionBudget: maxUnavailable: 1 ``` -------------------------------- ### Configure Liveness Probe Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch/README.md Define a liveness probe to determine if a container needs to be restarted. If the probe fails, Kubernetes restarts the container. ```yaml livenessProbe: httpGet: path: /_cluster/health port: 9200 initialDelaySeconds: 15 periodSeconds: 20 ``` -------------------------------- ### Configure Pod Topology Spread Constraints Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch/README.md Distribute pods evenly across nodes or availability zones to improve availability and resource utilization. ```yaml topologySpreadConstraints: - maxSkew: 1 topologyKey: "topology.kubernetes.io/zone" whenUnsatisfiable: DoNotSchedule labelSelector: matchLabels: app: opensearch ``` -------------------------------- ### Configure Service Type Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch/README.md Define how a Service is exposed. Common types include ClusterIP, NodePort, and LoadBalancer. ```yaml service: type: LoadBalancer ``` ```yaml service: type: NodePort ``` -------------------------------- ### Configure Node Selector Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch/README.md Assign pods to nodes with specific labels. This is a simple way to control pod placement. ```yaml nodeSelector: disktype: ssd ``` -------------------------------- ### Set sysctl vm.max_map_count Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch/README.md Configure the `vm.max_map_count` kernel parameter for OpenSearch nodes. This is a critical setting for OpenSearch performance. ```yaml sysctl: vm.max_map_count: "262144" ``` -------------------------------- ### Configure StatefulSet Update Strategy Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch/README.md Define how pods in a StatefulSet are updated. 'RollingUpdate' is a common strategy for zero-downtime updates. ```yaml updateStrategy: type: RollingUpdate ``` -------------------------------- ### Configure StatefulSet Pod Management Policy Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch/README.md Control how pods in a StatefulSet are created, updated, or deleted. 'Serial' ensures pods are processed one at a time. ```yaml podManagementPolicy: Serial ``` -------------------------------- ### Configure LoadBalancer Annotations Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch/README.md Add annotations to a Service of type LoadBalancer to customize its behavior, such as enabling SSL support on AWS. ```yaml service: type: LoadBalancer annotations: service.beta.kubernetes.io/aws-load-balancer-ssl-cert: arn:aws:acm:us-east-1:123456789012:certificate/my-certificate ``` -------------------------------- ### Configure ServiceMonitor for Prometheus Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch/README.md Define a ServiceMonitor resource to enable Prometheus to discover and scrape metrics from OpenSearch services. ```yaml serviceMonitor: enabled: true interval: "30s" ``` -------------------------------- ### Uninstall Data Prepper Chart Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/data-prepper/README.md Uninstall or delete the Data Prepper Helm deployment. This command removes all associated Kubernetes components and the release. ```bash helm delete my-data-prepper ``` -------------------------------- ### Apply Tolerations to Pods Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch/README.md Allow pods to be scheduled on nodes with matching taints. Tolerations override node taints. ```yaml tolerations: - key: "key" operator: "Equal" value: "value" effect: "NoSchedule" ``` -------------------------------- ### Check Pipeline Configuration from Secret Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/data-prepper/templates/NOTES.txt Verifies if pipeline configuration is loaded from an existing secret. The name of the secret is specified in values.yaml. ```go-template {{- else }} Pipeline configuration from secret {{ .Values.pipelineConfig.existingSecret }} is enabled. {{- end }} ``` -------------------------------- ### Apply Labels to Pods Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch/README.md Assign labels to pods for identification and selection. Labels are key-value pairs used by Kubernetes objects. ```yaml labels: app: opensearch version: v1 ``` -------------------------------- ### Define Ingress Configuration Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch/README.md Configure Ingress resources to manage external access to services within the cluster. This typically involves setting hostnames and paths. ```yaml ingress: enabled: true hosts: - host: chart-example.local paths: - path: / pathType: ImplementationSpecific ``` -------------------------------- ### Configure Node Affinity Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch/README.md Specify rules for scheduling pods onto nodes based on node labels. This allows for preferred or required node selection. ```yaml affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: kubernetes.io/os operator: In values: - linux ``` -------------------------------- ### Configure Alternate Scheduler for Pods Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch/README.md Specify a custom scheduler for pods if multiple schedulers are configured in the cluster. Defaults to the Kubernetes scheduler. ```yaml schedulerName: my-custom-scheduler ``` -------------------------------- ### Set Image Pull Policy Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch/README.md Define when Kubernetes should pull a new image for a container. Common values are 'Always', 'IfNotPresent', and 'Never'. ```yaml imagePullPolicy: IfNotPresent ``` -------------------------------- ### Configure LoadBalancer External Traffic Policy Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch/README.md Set the external traffic policy for a LoadBalancer service to preserve the client source IP address. ```yaml service: type: LoadBalancer externalTrafficPolicy: Local ``` -------------------------------- ### Apply Annotations to Pods Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch/README.md Add annotations to pods for storing arbitrary non-identifying metadata. These are often used by external tools and controllers. ```yaml annotations: prometheus.io/scrape: "true" prometheus.io/port: "9090" ``` -------------------------------- ### Configure Pod Affinity Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch/README.md Define rules for scheduling pods in relation to other pods. This can be used to co-locate or spread pods across nodes. ```yaml affinity: podAffinity: requiredDuringSchedulingIgnoredDuringExecution: labelSelector: matchExpressions: - key: app operator: In values: - backend ``` -------------------------------- ### Configure Image Pull Secrets Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch/README.md Specify secrets for pulling images from private registries. Ensure the secret exists in the same namespace. ```yaml imagePullSecrets: - name: my-registry-secret ``` -------------------------------- ### Set Pod Priority Class Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch/README.md Assign a priority class to pods to influence their scheduling priority relative to other pods in the cluster. ```yaml priorityClassName: high-priority ``` -------------------------------- ### Uninstall OpenSearch Dashboards Helm Chart Source: https://github.com/opensearch-project/helm-charts/blob/main/charts/opensearch-dashboards/README.md Deletes or uninstalls the OpenSearch Dashboards chart using its release name. This command removes the deployed release from the Kubernetes cluster. ```shell helm uninstall my-release ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.