Created
April 13, 2021 15:55
-
-
Save rdemoraes/46400da5af02dfc9549b6b2d6e1ca6ad to your computer and use it in GitHub Desktop.
Statefulset for cassandra
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
apiVersion: "apps/v1" | |
kind: StatefulSet | |
metadata: | |
name: cassandra | |
namespace: cassandra | |
labels: | |
app: cassandra | |
spec: | |
serviceName: cassandra | |
replicas: 3 | |
updateStrategy: | |
type: RollingUpdate | |
selector: | |
matchLabels: | |
app: cassandra | |
template: | |
metadata: | |
labels: | |
app: cassandra | |
spec: | |
containers: | |
- name: aws-cli | |
image: amazon/aws-cli:latest | |
command: [ "sleep" ] | |
args: [ "infinity" ] | |
volumeMounts: | |
- name: cassandra-data | |
mountPath: /var/lib/cassandra/data | |
- name: cassandra | |
image: docker.io/library/cassandra:3.9 | |
imagePullPolicy: IfNotPresent | |
ports: | |
- containerPort: 7000 | |
name: intra-node | |
- containerPort: 7001 | |
name: tls-intra-node | |
- containerPort: 7199 | |
name: jmx | |
- containerPort: 9042 | |
name: cql | |
resources: | |
limits: | |
cpu: "1000m" | |
memory: 58Gi | |
requests: | |
cpu: "1000m" | |
memory: 58Gi | |
securityContext: | |
capabilities: | |
add: | |
- IPC_LOCK | |
lifecycle: | |
preStop: | |
exec: | |
command: | |
- /bin/sh | |
- -c | |
- nodetool drain | |
env: | |
- name: CASSANDRA_START_RPC | |
value: "true" | |
- name: CASSANDRA_CLUSTER_NAME | |
value: "Source_Cluster_Name" | |
- name: CASSANDRA_DC | |
value: "Source_Datacenter_Name" | |
- name: CASSANDRA_RACK | |
value: "Source_Rack_Name" | |
- name: CASSANDRA_ENDPOINT_SNITCH | |
value: GossipingPropertyFileSnitch | |
- name: POD_IP | |
valueFrom: | |
fieldRef: | |
fieldPath: status.podIP | |
envFrom: | |
- configMapRef: | |
name: cassandra-rings | |
readinessProbe: | |
exec: | |
command: | |
- /bin/bash | |
- -c | |
- /var/tmp/ready-probe.sh | |
initialDelaySeconds: 120 | |
periodSeconds: 120 | |
timeoutSeconds: 30 | |
volumeMounts: | |
- name: cassandra-data | |
mountPath: /var/lib/cassandra/data | |
- name: docker-entrypoint-sh | |
mountPath: /docker-entrypoint.sh | |
subPath: docker-entrypoint.sh | |
- name: readiness-probe-sh | |
mountPath: /var/tmp/ready-probe.sh | |
subPath: ready-probe.sh | |
schedulerName: default-scheduler | |
terminationGracePeriodSeconds: 180 | |
volumes: | |
- name: docker-entrypoint-sh | |
configMap: | |
name: docker-entrypoint-sh | |
defaultMode: 0777 | |
- name: readiness-probe-sh | |
configMap: | |
name: readiness-probe-sh | |
defaultMode: 0777 | |
volumeClaimTemplates: | |
- metadata: | |
name: cassandra-data | |
spec: | |
accessModes: ["ReadWriteOnce"] | |
storageClassName: gp2-encrypted | |
resources: | |
requests: | |
storage: 4Ti |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment