-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcassandra
More file actions
121 lines (121 loc) · 2.83 KB
/
cassandra
File metadata and controls
121 lines (121 loc) · 2.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
apiVersion: v1
kind: Namespace
metadata:
name: cassandra-prod
---
# 🔐 Admin credentials (Cassandra superuser)
# You can pre-create this secret with a random password (recommended) or let this YAML hold it.
apiVersion: v1
kind: Secret
metadata:
name: cassandra-admin-secret
namespace: cassandra-prod
type: Opaque
stringData:
username: cassadmin
password: "{{ random 16 }}" # Replace dynamically or pre-generate via CLI
---
# 🧱 Cassandra Cluster (1 DC, 3 racks/nodes)
apiVersion: cassandra.datastax.com/v1beta1
kind: CassandraDatacenter
metadata:
name: dc1
namespace: cassandra-prod
spec:
clusterName: cassandra-prod-cluster
serverType: cassandra
serverVersion: "4.1.3"
managementApiAuth:
insecure: false
enabled: true
manual: false
secretRef:
name: cassandra-admin-secret
size: 3
racks:
- name: rack1
- name: rack2
- name: rack3
storageConfig:
cassandraDataVolumeClaimSpec:
storageClassName: efs-sc # 🔸 Your EFS storage class name
accessModes: ["ReadWriteMany"]
resources:
requests:
storage: 100Gi
resources:
requests:
cpu: "1000m"
memory: "4Gi"
limits:
cpu: "2000m"
memory: "8Gi"
config:
cassandra-yaml:
authenticator: PasswordAuthenticator
authorizer: CassandraAuthorizer
role_manager: CassandraRoleManager
num_tokens: 16
start_native_transport: true
start_rpc: false
# 🔒 Enable client-node and node-node encryption (optional, recommended)
server_encryption_options:
internode_encryption: all
require_client_auth: true
keystore_password: cassandra
truststore_password: cassandra
client_encryption_options:
enabled: true
optional: false
require_client_auth: false
keystore_password: cassandra
truststore_password: cassandra
jvm-options:
initial_heap_size: "2G"
max_heap_size: "4G"
podTemplateSpec:
metadata:
labels:
app: cassandra
spec:
containers:
- name: cassandra
ports:
- containerPort: 9042
name: cql
- containerPort: 7000
name: intra-node
- containerPort: 7001
name: tls-intra-node
---
# 🧭 Internal Service for intra-cluster and in-cluster access
apiVersion: v1
kind: Service
metadata:
name: cassandra-service
namespace: cassandra-prod
labels:
app: cassandra
spec:
type: ClusterIP
ports:
- name: cql
port: 9042
targetPort: 9042
selector:
app: cassandra
---
# 🌐 External access (OpenShift Route)
apiVersion: route.openshift.io/v1
kind: Route
metadata:
name: cassandra-route
namespace: cassandra-prod
spec:
to:
kind: Service
name: cassandra-service
port:
targetPort: cql
tls:
termination: passthrough