From b3dd1a9c475ccc18698941563ec1cf43790373e3 Mon Sep 17 00:00:00 2001 From: raihankhan Date: Wed, 25 Sep 2024 15:11:44 +0600 Subject: [PATCH] Fix elasticsearch update for terminationPolicy > deletionPolicy Signed-off-by: raihankhan --- .../elasticsearch/concepts/elasticsearch-dashboard/index.md | 2 +- .../elasticsearch/elasticsearch-dashboard/kibana/index.md | 2 +- .../kibana/yamls/es-cluster-dashboard.yaml | 2 +- .../elasticsearch-dashboard/opensearch-dashboards/index.md | 2 +- .../opensearch-dashboards/yamls/os-cluster-dashboard.yaml | 2 +- .../quickstart/overview/elasticsearch/index.md | 6 +++--- .../elasticsearch/yamls/elasticsearch-v1alpha2.yaml | 2 +- .../elasticsearch/quickstart/overview/opensearch/index.md | 4 ++-- .../overview/opensearch/yamls/opensearch-v1alpha2.yaml | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/guides/elasticsearch/concepts/elasticsearch-dashboard/index.md b/docs/guides/elasticsearch/concepts/elasticsearch-dashboard/index.md index 5845f0bfe6..a32132b38a 100644 --- a/docs/guides/elasticsearch/concepts/elasticsearch-dashboard/index.md +++ b/docs/guides/elasticsearch/concepts/elasticsearch-dashboard/index.md @@ -56,7 +56,7 @@ spec: certificates: - alias: database-client secretName: es-cluster-client-cert - terminationPolicy: WipeOut + deletionPolicy: WipeOut ``` diff --git a/docs/guides/elasticsearch/elasticsearch-dashboard/kibana/index.md b/docs/guides/elasticsearch/elasticsearch-dashboard/kibana/index.md index 1b9f7d4b95..263a464684 100644 --- a/docs/guides/elasticsearch/elasticsearch-dashboard/kibana/index.md +++ b/docs/guides/elasticsearch/elasticsearch-dashboard/kibana/index.md @@ -429,7 +429,7 @@ spec: enableSSL: true databaseRef: name: es-cluster - terminationPolicy: WipeOut + deletionPolicy: WipeOut ``` > Note: Elasticsearch Database and Elasticsearch dashboard should have to be deployed in the same namespace. In this tutorial, we use demo namespace for both cases. diff --git a/docs/guides/elasticsearch/elasticsearch-dashboard/kibana/yamls/es-cluster-dashboard.yaml b/docs/guides/elasticsearch/elasticsearch-dashboard/kibana/yamls/es-cluster-dashboard.yaml index 2e7ed29694..d6757a9257 100644 --- a/docs/guides/elasticsearch/elasticsearch-dashboard/kibana/yamls/es-cluster-dashboard.yaml +++ b/docs/guides/elasticsearch/elasticsearch-dashboard/kibana/yamls/es-cluster-dashboard.yaml @@ -7,4 +7,4 @@ spec: enableSSL: true databaseRef: name: es-cluster - terminationPolicy: WipeOut \ No newline at end of file + deletionPolicy: WipeOut \ No newline at end of file diff --git a/docs/guides/elasticsearch/elasticsearch-dashboard/opensearch-dashboards/index.md b/docs/guides/elasticsearch/elasticsearch-dashboard/opensearch-dashboards/index.md index ef370c2f16..de7a4c857b 100644 --- a/docs/guides/elasticsearch/elasticsearch-dashboard/opensearch-dashboards/index.md +++ b/docs/guides/elasticsearch/elasticsearch-dashboard/opensearch-dashboards/index.md @@ -417,7 +417,7 @@ spec: enableSSL: true databaseRef: name: os-cluster - terminationPolicy: WipeOut + deletionPolicy: WipeOut ``` > Note: OpenSearch Database and OpenSearch dashboard should have to be deployed in the same namespace. In this tutorial, we use `demo` namespace for both cases. diff --git a/docs/guides/elasticsearch/elasticsearch-dashboard/opensearch-dashboards/yamls/os-cluster-dashboard.yaml b/docs/guides/elasticsearch/elasticsearch-dashboard/opensearch-dashboards/yamls/os-cluster-dashboard.yaml index d844bffee6..0fb8d6a977 100644 --- a/docs/guides/elasticsearch/elasticsearch-dashboard/opensearch-dashboards/yamls/os-cluster-dashboard.yaml +++ b/docs/guides/elasticsearch/elasticsearch-dashboard/opensearch-dashboards/yamls/os-cluster-dashboard.yaml @@ -7,4 +7,4 @@ spec: enableSSL: true databaseRef: name: os-cluster - terminationPolicy: WipeOut \ No newline at end of file + deletionPolicy: WipeOut \ No newline at end of file diff --git a/docs/guides/elasticsearch/quickstart/overview/elasticsearch/index.md b/docs/guides/elasticsearch/quickstart/overview/elasticsearch/index.md index f9c08b6638..15136d17d6 100644 --- a/docs/guides/elasticsearch/quickstart/overview/elasticsearch/index.md +++ b/docs/guides/elasticsearch/quickstart/overview/elasticsearch/index.md @@ -187,7 +187,7 @@ spec: resources: requests: storage: 1Gi - terminationPolicy: Delete + deletionPolicy: Delete ``` ```bash @@ -202,7 +202,7 @@ Here, - `spec.replicas` - specifies the number of Elasticsearch nodes. - `spec.storageType` - specifies the type of storage that will be used for Elasticsearch database. It can be `Durable` or `Ephemeral`. The default value of this field is `Durable`. If `Ephemeral` is used then KubeDB will create the Elasticsearch database using `EmptyDir` volume. In this case, you don't have to specify `spec.storage` field. This is useful for testing purposes. - `spec.storage` specifies the StorageClass of PVC dynamically allocated to store data for this database. This storage spec will be passed to the StatefulSet created by the KubeDB operator to run database pods. You can specify any StorageClass available in your cluster with appropriate resource requests. If you don't specify `spec.storageType: Ephemeral`, then this field is required. -- `spec.terminationPolicy` or `spec.deletionPolicy` specifies what KubeDB should do when a user try to delete Elasticsearch CR. Termination policy `Delete` will delete the database pods, secret and PVC when the Elasticsearch CR is deleted. +- `spec.deletionPolicy` or `spec.deletionPolicy` specifies what KubeDB should do when a user try to delete Elasticsearch CR. Termination policy `Delete` will delete the database pods, secret and PVC when the Elasticsearch CR is deleted. > Note: `spec.storage` section is used to create PVC for database pod. It will create PVC with storage size specified in the `storage.resources.requests` field. Don't specify `limits` here. PVC does not get resized automatically. @@ -657,7 +657,7 @@ namespace "demo" deleted If you are just testing some basic functionalities, you might want to avoid additional hassles due to some safety features that are great for the production environment. You can follow these tips to avoid them. 1. **Use `storageType: Ephemeral`**. Databases are precious. You might not want to lose your data in your production environment if the database pod fails. So, we recommend to use `spec.storageType: Durable` and provide storage spec in `spec.storage` section. For testing purposes, you can just use `spec.storageType: Ephemeral`. KubeDB will use [emptyDir](https://kubernetes.io/docs/concepts/storage/volumes/#emptydir) for storage. You will not require to provide `spec.storage` section. -2. **Use `terminationPolicy: WipeOut`**. It is nice to be able to resume the database from the previous one. So, we preserve all your `PVCs` and auth `Secrets`. If you don't want to resume the database, you can just use `spec.terminationPolicy: WipeOut`. It will clean up every resouce that was created with the Elasticsearch CR. For more details, please visit [here](/docs/guides/elasticsearch/concepts/elasticsearch/index.md#specterminationpolicy). +2. **Use `deletionPolicy: WipeOut`**. It is nice to be able to resume the database from the previous one. So, we preserve all your `PVCs` and auth `Secrets`. If you don't want to resume the database, you can just use `spec.deletionPolicy: WipeOut`. It will clean up every resouce that was created with the Elasticsearch CR. For more details, please visit [here](/docs/guides/elasticsearch/concepts/elasticsearch/index.md#specdeletionPolicy). ## Next Steps diff --git a/docs/guides/elasticsearch/quickstart/overview/elasticsearch/yamls/elasticsearch-v1alpha2.yaml b/docs/guides/elasticsearch/quickstart/overview/elasticsearch/yamls/elasticsearch-v1alpha2.yaml index 6446a26577..35b6e87d1f 100644 --- a/docs/guides/elasticsearch/quickstart/overview/elasticsearch/yamls/elasticsearch-v1alpha2.yaml +++ b/docs/guides/elasticsearch/quickstart/overview/elasticsearch/yamls/elasticsearch-v1alpha2.yaml @@ -15,4 +15,4 @@ spec: resources: requests: storage: 1Gi - terminationPolicy: Delete \ No newline at end of file + deletionPolicy: Delete \ No newline at end of file diff --git a/docs/guides/elasticsearch/quickstart/overview/opensearch/index.md b/docs/guides/elasticsearch/quickstart/overview/opensearch/index.md index bda71bbf17..37a6bfa3f8 100644 --- a/docs/guides/elasticsearch/quickstart/overview/opensearch/index.md +++ b/docs/guides/elasticsearch/quickstart/overview/opensearch/index.md @@ -182,7 +182,7 @@ spec: resources: requests: storage: 1Gi - terminationPolicy: DoNotTerminate + deletionPolicy: DoNotTerminate ``` ```bash @@ -197,7 +197,7 @@ Here, - `spec.replicas` - specifies the number of OpenSearch nodes. - `spec.storageType` - specifies the type of storage that will be used for OpenSearch database. It can be `Durable` or `Ephemeral`. The default value of this field is `Durable`. If `Ephemeral` is used then KubeDB will create the OpenSearch database using `EmptyDir` volume. In this case, you don't have to specify `spec.storage` field. This is useful for testing purposes. - `spec.storage` specifies the StorageClass of PVC dynamically allocated to store data for this database. This storage spec will be passed to the StatefulSet created by the KubeDB operator to run database pods. You can specify any StorageClass available in your cluster with appropriate resource requests. If you don't specify `spec.storageType: Ephemeral`, then this field is required. -- `spec.terminationPolicy` or `spec.deletionPolicy` specifies what KubeDB should do when a user try to delete the operation of Elasticsearch CR. Termination policy `DoNotTerminate` prevents a user from deleting this object if the admission webhook is enabled. +- `spec.deletionPolicy` or `spec.deletionPolicy` specifies what KubeDB should do when a user try to delete the operation of Elasticsearch CR. Termination policy `DoNotTerminate` prevents a user from deleting this object if the admission webhook is enabled. > Note: `spec.storage` section is used to create PVC for database pod. It will create PVC with storage size specified in the `storage.resources.requests` field. Don't specify `limits` here. PVC does not get resized automatically. diff --git a/docs/guides/elasticsearch/quickstart/overview/opensearch/yamls/opensearch-v1alpha2.yaml b/docs/guides/elasticsearch/quickstart/overview/opensearch/yamls/opensearch-v1alpha2.yaml index 8fdd504fbc..345ea5c7da 100644 --- a/docs/guides/elasticsearch/quickstart/overview/opensearch/yamls/opensearch-v1alpha2.yaml +++ b/docs/guides/elasticsearch/quickstart/overview/opensearch/yamls/opensearch-v1alpha2.yaml @@ -15,4 +15,4 @@ spec: resources: requests: storage: 1Gi - terminationPolicy: DoNotTerminate \ No newline at end of file + deletionPolicy: DoNotTerminate \ No newline at end of file