Skip to content

Commit 0d67d9c

Browse files
authored
Merge pull request #50576 from jayeshmahajan/patch-9
Example Cassandra app for Hindi content
2 parents bac6aea + d5728ab commit 0d67d9c

File tree

2 files changed

+112
-0
lines changed

2 files changed

+112
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
labels:
5+
app: cassandra
6+
name: cassandra
7+
spec:
8+
clusterIP: None
9+
ports:
10+
- port: 9042
11+
selector:
12+
app: cassandra
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
apiVersion: apps/v1
2+
kind: StatefulSet
3+
metadata:
4+
name: cassandra
5+
labels:
6+
app: cassandra
7+
spec:
8+
serviceName: cassandra
9+
replicas: 3
10+
selector:
11+
matchLabels:
12+
app: cassandra
13+
template:
14+
metadata:
15+
labels:
16+
app: cassandra
17+
spec:
18+
terminationGracePeriodSeconds: 500
19+
containers:
20+
- name: cassandra
21+
image: gcr.io/google-samples/cassandra:v13
22+
imagePullPolicy: Always
23+
ports:
24+
- containerPort: 7000
25+
name: intra-node
26+
- containerPort: 7001
27+
name: tls-intra-node
28+
- containerPort: 7199
29+
name: jmx
30+
- containerPort: 9042
31+
name: cql
32+
resources:
33+
limits:
34+
cpu: "500m"
35+
memory: 1Gi
36+
requests:
37+
cpu: "500m"
38+
memory: 1Gi
39+
securityContext:
40+
capabilities:
41+
add:
42+
- IPC_LOCK
43+
lifecycle:
44+
preStop:
45+
exec:
46+
command:
47+
- /bin/sh
48+
- -c
49+
- nodetool drain
50+
env:
51+
- name: MAX_HEAP_SIZE
52+
value: 512M
53+
- name: HEAP_NEWSIZE
54+
value: 100M
55+
- name: CASSANDRA_SEEDS
56+
value: "cassandra-0.cassandra.default.svc.cluster.local"
57+
- name: CASSANDRA_CLUSTER_NAME
58+
value: "K8Demo"
59+
- name: CASSANDRA_DC
60+
value: "DC1-K8Demo"
61+
- name: CASSANDRA_RACK
62+
value: "Rack1-K8Demo"
63+
- name: POD_IP
64+
valueFrom:
65+
fieldRef:
66+
fieldPath: status.podIP
67+
readinessProbe:
68+
exec:
69+
command:
70+
- /bin/bash
71+
- -c
72+
- /ready-probe.sh
73+
initialDelaySeconds: 15
74+
timeoutSeconds: 5
75+
# These volume mounts are persistent. They are like inline claims,
76+
# but not exactly because the names need to match exactly one of
77+
# the stateful pod volumes.
78+
volumeMounts:
79+
- name: cassandra-data
80+
mountPath: /cassandra_data
81+
# These are converted to volume claims by the controller
82+
# and mounted at the paths mentioned above.
83+
# do not use these in production until ssd GCEPersistentDisk or other ssd pd
84+
volumeClaimTemplates:
85+
- metadata:
86+
name: cassandra-data
87+
spec:
88+
accessModes: [ "ReadWriteOnce" ]
89+
storageClassName: fast
90+
resources:
91+
requests:
92+
storage: 1Gi
93+
---
94+
kind: StorageClass
95+
apiVersion: storage.k8s.io/v1
96+
metadata:
97+
name: fast
98+
provisioner: k8s.io/minikube-hostpath
99+
parameters:
100+
type: pd-ssd

0 commit comments

Comments
 (0)