3.3. 데이터 그리드 서비스 노드 생성
사이트 간 복제와 같은 Data Grid 기능과 함께 사용자 정의 캐시 정의를 사용하려면 Data Grid 서비스 노드의 클러스터를 생성합니다.
프로세스
InfinispanCR의spec.service.type값으로DataCryostat를 지정합니다.apiVersion: infinispan.org/v1 kind: Infinispan metadata: name: example-infinispan spec: replicas: 2 service: type: DataGrid참고노드를 생성한 후에는
spec.service.type필드를 변경할 수 없습니다. 서비스 유형을 변경하려면 기존 노드를 삭제하고 새 노드를 생성해야 합니다.- 다른 Data Grid 서비스 리소스를 사용하여 노드를 구성합니다.
-
InfinispanCR을 적용하여 클러스터를 생성합니다.
3.3.1. Data Grid 서비스 리소스 링크 복사링크가 클립보드에 복사되었습니다!
링크 복사링크가 클립보드에 복사되었습니다!
apiVersion: infinispan.org/v1
kind: Infinispan
metadata:
# Names the cluster.
name: example-infinispan
spec:
# Specifies the number of nodes in the cluster.
replicas: 6
service:
# Configures the service type as Data Grid.
type: DataGrid
# Configures storage resources.
container:
storage: 2Gi
storageClassName: my-storage-class
# Configures cross-site replication.
sites:
local:
name: azure
expose:
type: LoadBalancer
locations:
- name: azure
url: openshift://api.azure.host:6443
secretName: azure-token
- name: aws
url: openshift://api.aws.host:6443
secretName: aws-token
# Configures authentication and encryption.
security:
# Defines a secret with custom credentials.
endpointSecretName: endpoint-identities
# Adds a custom TLS certificate to encrypt client connections.
endpointEncryption:
type: Secret
certSecretName: tls-secret
# Sets container resources.
container:
extraJvmOpts: "-XX:NativeMemoryTracking=summary"
cpu: "1000m"
memory: 1Gi
# Configures logging levels.
logging:
categories:
org.infinispan: debug
org.jgroups: debug
org.jgroups.protocols.TCP: error
org.jgroups.protocols.relay.RELAY2: fatal
# Configures how the cluster is exposed on the network.
expose:
type: LoadBalancer
# Configures affinity and anti-affinity strategies.
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchLabels:
app: infinispan-pod
clusterName: example-infinispan
infinispan_cr: example-infinispan
topologyKey: "kubernetes.io/hostname"