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