blob: d6d21fe265cbd1dd900f2c1a18093915b3caab83 [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
47 spec:
48 terminationGracePeriodSeconds: 1
49 containers:
50 - name: cassandra
51 image: ngick8stesting/c3po-cassandra:5e2eaf6
52 imagePullPolicy: Always
53 resources:
54 limits:
55 cpu: "3"
56 memory: 4Gi
57 env:
58 - name: MAX_HEAP_SIZE
59 value: 512M
60 - name: HEAP_NEWSIZE
61 value: 100M
62 - name: CASSANDRA_SEEDS
Wei-Yu Chenda76c322019-01-18 13:31:55 -080063 value: "{{ .Values.hssdb_hostname }}-0"
Wei-Yu Chen450a98a2019-01-15 16:56:30 -080064 - name: CASSANDRA_CLUSTER_NAME
65 value: "HSS Cluster"
66 - name: CASSANDRA_RPC_ADDRESS
67 valueFrom:
68 fieldRef:
69 fieldPath: status.podIP
70 - name: CASSANDRA_ENDPOINT_SNITCH
71 value: "GossipingPropertyFileSnitch"
72 securityContext:
73 runAsUser: 1337
74 readinessProbe:
75 exec:
76 command: ["/bin/bash", "-c", "nodetool status -r | awk -v h=$(hostname) '$2==h {exit ($1==\"UN\" ? 0 : -1)}'"]
77 initialDelaySeconds: 15
78 timeoutSeconds: 5
79 volumeMounts:
80 - name: cassandra-config
81 mountPath: /etc/cassandra/cassandra-rackdc.properties
82 subPath: cassandra-rackdc.properties
83 volumes:
84 - name: cassandra-config
85 configMap:
86 name: cassandra