blob: cdb827c5590a8edad0a12a2f76bf54d25d7ea854 [file] [log] [blame]
Wei-Yu Chen450a98a2019-01-15 16:56:30 -08001---
Wei-Yu Chen53aec362019-01-18 16:30:33 -08002# Copyright 2018-present Open Networking Foundation
3# Copyright 2018 Intel Corporation
Wei-Yu Chen450a98a2019-01-15 16:56:30 -08004#
5# Licensed under the Apache License, Version 2.0 (the "License");
6# you may not use this file except in compliance with the License.
7# You may obtain a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS,
13# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14# See the License for the specific language governing permissions and
15# limitations under the License.
16
17---
18apiVersion: v1
19kind: Service
20metadata:
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080021 labels:
22 app: cassandra
23 name: cassandra
24spec:
25 clusterIP: None
26 ports:
27 - port: 9042
28 selector:
29 app: cassandra
30---
31apiVersion: "apps/v1"
32kind: StatefulSet
33metadata:
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080034 name: cassandra
35 labels:
36 app: cassandra
37spec:
38 serviceName: cassandra
39 replicas: 1 # 3
40 selector:
41 matchLabels:
42 app: cassandra
43 template:
44 metadata:
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080045 labels:
46 app: cassandra
Wei-Yu Chenec8a2d72019-02-12 14:36:10 -080047 spec:
48 nodeSelector:
Wei-Yu Chen9f533ef2019-02-18 11:39:17 -080049 kubernetes.io/hostname: "{{ .Values.hssdb_node_selector }}"
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080050 terminationGracePeriodSeconds: 1
51 containers:
52 - name: cassandra
Wei-Yu Chenb4ae01e2019-02-11 13:11:44 -080053 image: {{ .Values.hss.images.init }}
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080054 imagePullPolicy: Always
55 resources:
56 limits:
57 cpu: "3"
58 memory: 4Gi
59 env:
60 - name: MAX_HEAP_SIZE
61 value: 512M
62 - name: HEAP_NEWSIZE
63 value: 100M
64 - name: CASSANDRA_SEEDS
Wei-Yu Chenda76c322019-01-18 13:31:55 -080065 value: "{{ .Values.hssdb_hostname }}-0"
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080066 - name: CASSANDRA_CLUSTER_NAME
67 value: "HSS Cluster"
68 - name: CASSANDRA_RPC_ADDRESS
69 valueFrom:
70 fieldRef:
71 fieldPath: status.podIP
72 - name: CASSANDRA_ENDPOINT_SNITCH
73 value: "GossipingPropertyFileSnitch"
74 securityContext:
75 runAsUser: 1337
76 readinessProbe:
77 exec:
78 command: ["/bin/bash", "-c", "nodetool status -r | awk -v h=$(hostname) '$2==h {exit ($1==\"UN\" ? 0 : -1)}'"]
79 initialDelaySeconds: 15
80 timeoutSeconds: 5
81 volumeMounts:
82 - name: cassandra-config
83 mountPath: /etc/cassandra/cassandra-rackdc.properties
84 subPath: cassandra-rackdc.properties
85 volumes:
86 - name: cassandra-config
87 configMap:
88 name: cassandra