You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sk...@apache.org on 2024/01/11 14:01:00 UTC
(ignite) branch master updated: IGNITE-17780 Updated deployment example to StatefulSet (#11098)
This is an automated email from the ASF dual-hosted git repository.
sk0x50 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite.git
The following commit(s) were added to refs/heads/master by this push:
new 8a32f14e402 IGNITE-17780 Updated deployment example to StatefulSet (#11098)
8a32f14e402 is described below
commit 8a32f14e402326ee0a850429d2e79e688639455c
Author: IgGusev <ig...@gridgain.com>
AuthorDate: Thu Jan 11 18:00:52 2024 +0400
IGNITE-17780 Updated deployment example to StatefulSet (#11098)
---
.../k8s/stateless/deployment-template.yaml | 80 +++++++++++++++-------
.../kubernetes/generic-configuration.adoc | 6 +-
2 files changed, 57 insertions(+), 29 deletions(-)
diff --git a/docs/_docs/code-snippets/k8s/stateless/deployment-template.yaml b/docs/_docs/code-snippets/k8s/stateless/deployment-template.yaml
index fe388d8d191..0190060dccc 100644
--- a/docs/_docs/code-snippets/k8s/stateless/deployment-template.yaml
+++ b/docs/_docs/code-snippets/k8s/stateless/deployment-template.yaml
@@ -15,8 +15,8 @@
#tag::config-block[]
# An example of a Kubernetes configuration for pod deployment.
-apiVersion: apps/v1
-kind: Deployment
+apiVersion: apps/v1
+kind: StatefulSet
metadata:
# Cluster name.
name: ignite-cluster
@@ -27,34 +27,64 @@ spec:
selector:
matchLabels:
app: ignite
+ serviceName: ignite
template:
metadata:
labels:
- app: ignite
+ app: ignite
spec:
- serviceAccountName: ignite
- terminationGracePeriodSeconds: 60000
+ serviceAccountName: ignite
+ terminationGracePeriodSeconds: 60000
containers:
# Custom pod name.
- - name: ignite-node
- image: apacheignite/ignite:{version}
- env:
- - name: OPTION_LIBS
- value: ignite-kubernetes,ignite-rest-http
- - name: CONFIG_URI
- value: file:///ignite/config/node-configuration.xml
- ports:
- # Ports to open.
- - containerPort: 47100 # communication SPI port
- - containerPort: 47500 # discovery SPI port
- - containerPort: 49112 # dafault JMX port
- - containerPort: 10800 # thin clients/JDBC driver port
- - containerPort: 8080 # REST API
- volumeMounts:
- - mountPath: /ignite/config
- name: config-vol
+ - name: ignite-node
+ image: apacheignite/ignite:{version}
+ env:
+ - name: OPTION_LIBS
+ value: ignite-kubernetes,ignite-rest-http
+ - name: CONFIG_URI
+ value: file:///opt/ignite/config/node-configuration.xml
+ - name: JVM_OPTS
+ value: "-DIGNITE_WAIT_FOR_BACKUPS_ON_SHUTDOWN=true"
+ ports:
+ # Ports to open.
+ - containerPort: 47100 # communication SPI port
+ - containerPort: 47500 # discovery SPI port
+ - containerPort: 49112 # JMX port
+ - containerPort: 10800 # thin clients/JDBC driver port
+ - containerPort: 8080 # REST API
+ volumeMounts:
+ - mountPath: /opt/ignite/config
+ name: config-vol
+ - mountPath: /opt/ignite/work/db/binary_meta
+ name: internal-metadata-vol
+ readinessProbe:
+ httpGet:
+ path: /ignite?cmd=probe
+ port: 8080
+ initialDelaySeconds: 5
+ failureThreshold: 3
+ periodSeconds: 10
+ timeoutSeconds: 10
+ livenessProbe:
+ httpGet:
+ path: /ignite?cmd=version
+ port: 8080
+ initialDelaySeconds: 5
+ failureThreshold: 3
+ periodSeconds: 10
+ timeoutSeconds: 10
volumes:
- - name: config-vol
- configMap:
- name: ignite-config
+ - name: config-vol
+ configMap:
+ name: ignite-config
+ volumeClaimTemplates:
+ - metadata:
+ name: internal-metadata-vol
+ spec:
+ accessModes: [ "ReadWriteOnce" ]
+ resources:
+ requests:
+ storage: "1Gi" # make sure to provide enough space for your application data
+
#end::config-block[]
diff --git a/docs/_docs/installation/kubernetes/generic-configuration.adoc b/docs/_docs/installation/kubernetes/generic-configuration.adoc
index 4595a83f4e7..09abbfe53c7 100644
--- a/docs/_docs/installation/kubernetes/generic-configuration.adoc
+++ b/docs/_docs/installation/kubernetes/generic-configuration.adoc
@@ -159,9 +159,7 @@ include::{script}[tags=create-configmap]
=== Creating Pod Configuration
-Now we will create a configuration for pods.
-In the case of stateless deployment, we will use a link:https://kubernetes.io/docs/concepts/workloads/controllers/deployment/[Deployment,window=_blank].
-For a stateful deployment, we will use a link:https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/[StatefulSet,window=_blank].
+Now we create a configuration for pods that use a link:https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/[StatefulSet,window=_blank].
[tabs]
@@ -181,7 +179,7 @@ In the container's configuration, we will:
** 10800 — thin client/JDBC/ODBC port
** 8080 — REST API port
-The deployment configuration file might look like as follows:
+The configuration file might look like as follows:
.deployment.yaml
[source, yaml,subs="attributes,specialchars"]