blob: cdb827c5590a8edad0a12a2f76bf54d25d7ea854 [file] [log] [blame]
---
# Copyright 2018-present Open Networking Foundation
# Copyright 2018 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
---
apiVersion: v1
kind: Service
metadata:
labels:
app: cassandra
name: cassandra
spec:
clusterIP: None
ports:
- port: 9042
selector:
app: cassandra
---
apiVersion: "apps/v1"
kind: StatefulSet
metadata:
name: cassandra
labels:
app: cassandra
spec:
serviceName: cassandra
replicas: 1 # 3
selector:
matchLabels:
app: cassandra
template:
metadata:
labels:
app: cassandra
spec:
nodeSelector:
kubernetes.io/hostname: "{{ .Values.hssdb_node_selector }}"
terminationGracePeriodSeconds: 1
containers:
- name: cassandra
image: {{ .Values.hss.images.init }}
imagePullPolicy: Always
resources:
limits:
cpu: "3"
memory: 4Gi
env:
- name: MAX_HEAP_SIZE
value: 512M
- name: HEAP_NEWSIZE
value: 100M
- name: CASSANDRA_SEEDS
value: "{{ .Values.hssdb_hostname }}-0"
- name: CASSANDRA_CLUSTER_NAME
value: "HSS Cluster"
- name: CASSANDRA_RPC_ADDRESS
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: CASSANDRA_ENDPOINT_SNITCH
value: "GossipingPropertyFileSnitch"
securityContext:
runAsUser: 1337
readinessProbe:
exec:
command: ["/bin/bash", "-c", "nodetool status -r | awk -v h=$(hostname) '$2==h {exit ($1==\"UN\" ? 0 : -1)}'"]
initialDelaySeconds: 15
timeoutSeconds: 5
volumeMounts:
- name: cassandra-config
mountPath: /etc/cassandra/cassandra-rackdc.properties
subPath: cassandra-rackdc.properties
volumes:
- name: cassandra-config
configMap:
name: cassandra