blob: 56688f8799cf425e38f8efe447e6da9cab4a03aa [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:
20 namespace: {{ .Values.namespace }}
21 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:
34 namespace: {{ .Values.namespace }}
35 name: cassandra
36 labels:
37 app: cassandra
38spec:
39 serviceName: cassandra
40 replicas: 1 # 3
41 selector:
42 matchLabels:
43 app: cassandra
44 template:
45 metadata:
46 namespace: {{ .Values.namespace }}
47 labels:
48 app: cassandra
49 spec:
50 terminationGracePeriodSeconds: 1
51 containers:
52 - name: cassandra
53 image: ngick8stesting/c3po-cassandra:5e2eaf6
54 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
65 value: "cassandra-0.cassandra.{{ .Values.namespace }}.svc.cluster.local"
66 - 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