Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.

Chapter 7. Concepts to automate Data Grid CLI commands


Data Grid CLI commands can be automated by creating a `Batch` CR instance.

When interacting with an external Data Grid in Kubernetes, the Batch CR allows you to automate this using standard oc commands.

7.1. When to use it

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

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

7.2. Example

The following Batch CR takes a site offline as described in the operational procedure Taking a site offline.

apiVersion: infinispan.org/v2alpha1
kind: Batch
metadata:
  name: take-offline
  namespace: keycloak 
1

spec:
  cluster: infinispan 
2

  config: | 
3

    site take-offline --all-caches --site=site-a
    site status --all-caches --site=site-a
Copy to Clipboard Toggle word wrap
1
The Batch CR must be created in the same namespace as the Data Grid deployment.
2
The name of the Infinispan CR.
3
A multiline string containing one or more Data Grid CLI commands.

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

oc -n keycloak wait --for=jsonpath='{.status.phase}'=Succeeded Batch/take-offline
Copy to Clipboard Toggle word wrap
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.

7.3. Further reading

For more information, see the Data Grid Operator Batch CR documentation.

Nach oben
Red Hat logoGithubredditYoutubeTwitter

Lernen

Testen, kaufen und verkaufen

Communitys

Über Red Hat Dokumentation

Wir helfen Red Hat Benutzern, mit unseren Produkten und Diensten innovativ zu sein und ihre Ziele zu erreichen – mit Inhalten, denen sie vertrauen können. Entdecken Sie unsere neuesten Updates.

Mehr Inklusion in Open Source

Red Hat hat sich verpflichtet, problematische Sprache in unserem Code, unserer Dokumentation und unseren Web-Eigenschaften zu ersetzen. Weitere Einzelheiten finden Sie in Red Hat Blog.

Über Red Hat

Wir liefern gehärtete Lösungen, die es Unternehmen leichter machen, plattform- und umgebungsübergreifend zu arbeiten, vom zentralen Rechenzentrum bis zum Netzwerkrand.

Theme

© 2025 Red Hat