Skip to content
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

Add probes config #728

Merged
merged 8 commits into from
Feb 26, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ spec:
additionalConfig:
{{ toYaml $val.additionalConfig | nindent 8 }}
{{- end }}
{{- if $val.probes }}
probes:
{{ toYaml $val.probes | nindent 8 }}
{{- end }}
{{- end }}
{{- if .Values.opensearchCluster.security }}
security:
Expand Down Expand Up @@ -309,4 +313,4 @@ spec:
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -4564,6 +4564,60 @@ spec:
type: object
priorityClassName:
type: string
probes:
properties:
liveness:
properties:
failureThreshold:
format: int32
type: integer
initialDelaySeconds:
format: int32
type: integer
periodSeconds:
format: int32
type: integer
successThreshold:
format: int32
type: integer
timeoutSeconds:
format: int32
type: integer
type: object
readiness:
properties:
failureThreshold:
format: int32
type: integer
initialDelaySeconds:
format: int32
type: integer
periodSeconds:
format: int32
type: integer
timeoutSeconds:
format: int32
type: integer
type: object
startup:
properties:
failureThreshold:
format: int32
type: integer
initialDelaySeconds:
format: int32
type: integer
periodSeconds:
format: int32
type: integer
successThreshold:
format: int32
type: integer
timeoutSeconds:
format: int32
type: integer
type: object
type: object
replicas:
format: int32
type: integer
Expand Down
173 changes: 151 additions & 22 deletions docs/designs/crd.md
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ GeneralConfig defines global Opensearch cluster configuration
<td><b>DefaultRepo</b></td>
<td>string</td>
<td>Default image repository to use</td>
<td></td>
<td></td>
</tr><tr>
<td><b>keystore</b></td>
<td>[]opsterv1.KeystoreValue</td>
Expand Down Expand Up @@ -281,7 +283,7 @@ Bootstrap defines Opensearch bootstrap pod configuration
<td>string</td>
<td>JVM args. Use this to define heap size</td>
<td>false</td>
<td>-Xmx512M -Xms512M<td>
<td>-Xmx512M -Xms512M</td>
</tr><tr>
<td><b>additionalConfig</b></td>
<td>string</td>
Expand Down Expand Up @@ -343,28 +345,24 @@ Dashboards defines Opensearch-Dashboard configuration and deployment
<td>defining Dashbaord TLS configuration</td>
<td>false</td>
<td>false</td>
</tr><tr>
</tr><tr>
<td><b>env</b></td>
<td>[]corev1.Env</td>
<td>add user defined environment variables to dashboard app</td>
<td>false</td>
<td> - </td>
</tr><tr>
</tr><tr>
<td><b>image</b></td>
<td>string</td>
<td>Define Opensearch-dashboards image</td>
<td>false</td>
<td> - </td>
</tr><tr>
</tr><tr>
<td><b>imagePullPolicy</b></td>
<td>corev1.PullPolicy</td>
<td>Define Opensearch-dashboards image pull policy</td>
<td>false</td>
<td> - </td>
</tr><tr>
</tr><tr>
<td><b>imagePullSecrets</b></td>
<td>corev1.LocalObjectReference</td>
Expand All @@ -389,14 +387,12 @@ Dashboards defines Opensearch-Dashboard configuration and deployment
<td>Adds affinity to dashboard pods</td>
<td>false</td>
<td>-</td>
</tr>
</tr><tr>
<td><b>labels</b></td>
<td>map[string]string</td>
<td>Adds labels to dashboard pods</td>
<td>false</td>
<td>-</td>
</tr><tr>
</tr><tr>
<td><b>annotations</b></td>
<td>map[string]string</td>
Expand Down Expand Up @@ -428,7 +424,7 @@ Dashboards defines Opensearch-Dashboard configuration and deployment
<td>false</td>
<td> - </td>
</tr>
</tr><tr>
</tr>
</table>


Expand Down Expand Up @@ -536,6 +532,13 @@ Every NodePool is defining different Opensearch Nodes StatefulSet
<td>false</td>
<td>-</td>
</tr><tr>
</tr><tr>
<td><b>probes</b></td>
<td>ProbesConfig</td>
<td>Updates the probes timeouts and thresholds config</td>
<td>false</td>
<td>-</td>
</tr>
</table>

<h3 id="InitHelperConfig">
Expand Down Expand Up @@ -616,21 +619,19 @@ Monitoring defines Opensearch monitoring configuration
<td>Define interval for scraping</td>
<td>false</td>
<td>30s</td>
</tr><tr>
</tr><tr>
<td><b>pluginURL</b></td>
<td>string</td>
<td>Define offline link to Aiven Plugin</td>
<td>false</td>
<td>https://github.com/aiven/prometheus-exporter-plugin-for-opensearch/releases/download/<YOUR_CLUSTER_VERSION>/prometheus-exporter-<YOUR_CLUSTER_VERSION>.zip/</td>
</tr><tr>
</tr><tr>
<td><b>tlsConfig</b></td>
<td>map[]</td>
<td>Tls Configuration <b>See <i>tlsConfig</i> below</b></td>
<td>false</td>
<td> - </td>
</tr><tr>
</tr>
</table>

<h3 id="GeneralConfig">
Expand All @@ -650,18 +651,18 @@ Monitoring TLS configuration options
</tr>
</thead>
<tbody><tr>
<td><b>serverName</b></td>
<td>string</td>
<td>Used to verify the hostname for the targets</td>
<td>false</td>
<td></td>
</tr><tr>
<td><b>insecureSkipVerify</b></td>
<td>bool</td>
<td>Disable target certificate validation</td>
<td>false</td>
<td>false</td>
<td><b>serverName</b></td>
<td>string</td>
<td>Used to verify the hostname for the targets</td>
<td>false</td>
<td></td>
</tr><tr>
<td><b>insecureSkipVerify</b></td>
<td>bool</td>
<td>Disable target certificate validation</td>
<td>false</td>
<td>false</td>
</tr>
</tbody>
</table>

Expand Down Expand Up @@ -742,3 +743,131 @@ AdditionalVolume object define additional volume and volumeMount
</tbody>
</table>

<h3 id="ProbesConfig">
ProbesConfig
</h3>

ProbesConfig defines per nodepool probes thresholds and timeouts instead of defaults

<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
<th>default</th>
</tr>
</thead>
<tbody><tr>
<td><b>liveness</b></td>
<td>ProbeConfig</td>
<td>Update liveness probe thresholds and timeouts</td>
<td>false</td>
<td> - </td>
</tr><tr>
<td><b>readiness</b></td>
<td>ReadinessProbeConfig</td>
<td>Update readiness probe thresholds and timeouts</td>
<td>false</td>
<td> - </td>
</tr><tr>
<td><b>startup</b></td>
<td>ProbeConfig</td>
<td>Update startup probe thresholds and timeouts</td>
<td>false</td>
<td> - </td>
</tr>
</table>

<h3 id="ProbeConfig">
ProbeConfig
</h3>

ProbeConfig defines per probe thresholds and timeouts instead of defaults

<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
<th>default</th>
</tr>
</thead>
<tbody><tr>
<td><b>initialDelaySeconds</b></td>
<td>int32</td>
<td>Update probe's initialDelaySeconds</td>
<td>false</td>
<td> 10 </td>
</tr><tr>
<td><b>periodSeconds</b></td>
<td>int32</td>
<td>Update probe's periodSeconds</td>
<td>false</td>
<td> 20 </td>
</tr><tr>
<td><b>timeoutSeconds</b></td>
<td>int32</td>
<td>Update probe's timeoutSeconds</td>
<td>false</td>
<td> 5 </td>
</tr><tr>
<td><b>successThreshold</b></td>
<td>int32</td>
<td>Update probe's successThreshold</td>
<td>false</td>
<td> 1 </td>
</tr><tr>
<td><b>failureThreshold</b></td>
<td>int32</td>
<td>Update probe's failureThreshold</td>
<td>false</td>
<td> 10 </td>
</tr>
</table>

<h3 id="ReadinessProbeConfig">
ReadinessProbeConfig
</h3>

ReadinessProbeConfig defines per probe thresholds and timeouts instead of defaults

<table>
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Description</th>
<th>Required</th>
<th>default</th>
</tr>
</thead>
<tbody><tr>
<td><b>initialDelaySeconds</b></td>
<td>int32</td>
<td>Update probe's initialDelaySeconds</td>
<td>false</td>
<td> 60 </td>
</tr><tr>
<td><b>periodSeconds</b></td>
<td>int32</td>
<td>Update probe's periodSeconds</td>
<td>false</td>
<td> 30 </td>
</tr><tr>
<td><b>timeoutSeconds</b></td>
<td>int32</td>
<td>Update probe's timeoutSeconds</td>
<td>false</td>
<td> 30 </td>
</tr><tr>
<td><b>failureThreshold</b></td>
<td>int32</td>
<td>Update probe's failureThreshold</td>
<td>false</td>
<td> 5 </td>
</tr>
</table>
33 changes: 33 additions & 0 deletions docs/userguide/main.md
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,39 @@ spec:
If you want to expose the REST API of OpenSearch outside your Kubernetes cluster, the recommended way is to do this via ingress.
Internally you should use self-signed certificates (you can let the operator generate them), and then let the ingress use a certificate from an accepted CA (for example LetsEncrypt or a company-internal CA). That way you do not have the hassle of supplying custom certificates to the opensearch cluster but your users still see valid certificates.

### Customizing probe timeouts and thresholds

If the cluster nodes do not spins up before the threshold reaches and the pod restarts the timeouts and thresholds can be configured per node as per the requirements.

```yaml
apiVersion: opensearch.opster.io/v1
kind: OpenSearchCluster
...
spec:
nodePools:
- component: masters
replicas: 3
diskSize: "30Gi"
probes:
liveness:
initialDelaySeconds: 10
periodSeconds: 20
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 10
startup:
initialDelaySeconds: 10
periodSeconds: 20
timeoutSeconds: 5
successThreshold: 1
failureThreshold: 10
readiness:
initialDelaySeconds: 60
periodSeconds: 30
timeoutSeconds: 30
failureThreshold: 5
```

## Cluster operations

The operator contains several features that automate management tasks that might be needed during the cluster lifecycle. The different available options are documented here.
Expand Down
Loading
Loading