Keycloak

Форк
0
/
concepts-infinispan-cli-batch.adoc 
54 строки · 1.9 Кб
1
<#import "/templates/guide.adoc" as tmpl>
2
<#import "/templates/links.adoc" as links>
3

4
<@tmpl.guide
5
title="Concepts to automate {jdgserver_name} CLI commands"
6
summary="{jdgserver_name} CLI commands can be automated by creating a `Batch` CR instance."
7
tileVisible="false" >
8

9
include::partials/infinispan/infinispan-attributes.adoc[]
10

11
When interacting with an external {jdgserver_name} in Kubernetes, the `Batch` CR allows you to automate this using standard `kubectl` commands.
12

13
== When to use it
14

15
Use this when automating interactions on Kubernetes.
16
This avoids providing usernames and passwords and checking shell script outputs and their status.
17

18
For human interactions, the CLI shell might still be a better fit.
19

20
== Example
21

22
The following `Batch` CR takes an {jdgserver_name} site offline as described in the operational procedure <@links.ha id="operate-switch-over" />.
23

24
[source,yaml,subs="+attributes"]
25
----
26
apiVersion: infinispan.org/v2alpha1
27
kind: Batch
28
metadata:
29
  name: take-offline
30
  namespace: {ns} #<1>
31
spec:
32
  cluster: {cluster-name} #<2>
33
  config: | #<3>
34
    site take-offline --all-caches --site={site-a-cr}
35
    site status --all-caches --site={site-a-cr}
36
----
37
<1> The `Batch` CR must be created in the same namespace as the {jdgserver_name} deployment.
38
<2> The name of the Infinispan CR.
39
<3> A multiline string containing one or more {jdgserver_name} CLI commands.
40

41
Once the CR has been created, wait for the status to show the completion.
42

43
[source,bash,subs="+attributes"]
44
----
45
kubectl -n {ns} wait --for=jsonpath='{.status.phase}'=Succeeded Batch/take-offline
46
----
47

48
NOTE: Modifying a `Batch` CR instance has no effect. Batch operations are "`one-time`" events that modify Infinispan resources. To update `.spec` fields for the CR, or when a batch operation fails, you must create a new instance of the `Batch` CR.
49

50
== Further reading
51

52
For more information, see the link:{infinispan-operator-docs}#batch-cr[{jdgserver_name} Operator Batch CR documentation].
53

54
</@tmpl.guide>
55

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.