Rechercher

Ce contenu n'est pas disponible dans la langue sélectionnée.

Chapter 16. Concepts to automate Data Grid CLI commands

download PDF

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

16.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.

16.2. Example

The following Batch CR takes a site offline as described in the operational procedure Switch over to the secondary site.

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
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
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.

16.3. Further reading

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

Red Hat logoGithubRedditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez leBlog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

© 2024 Red Hat, Inc.