blob: 7bd033b37020998c171f7cf9adb16f69ea0f4d8d [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: ConfigMap
metadata:
name: hssdb
labels:
{{ tuple "hssdb" . | include "mcord-services.metadata_labels" | indent 4 }}
data:
cassandra-rackdc.properties: |
dc=DC1
rack=RAC1
prefer_local=true
---
apiVersion: v1
kind: Service
metadata:
name: hssdb
labels:
{{ tuple "hssdb" . | include "mcord-services.metadata_labels" | indent 4 }}
spec:
clusterIP: None
ports:
- name: cql
port: 9042
selector:
{{ tuple "hssdb" . | include "mcord-services.metadata_labels" | indent 4 }}
---
apiVersion: "apps/v1"
kind: StatefulSet
metadata:
name: hssdb
labels:
{{ tuple "hssdb" . | include "mcord-services.metadata_labels" | indent 4 }}
spec:
serviceName: hssdb
replicas: 1
selector:
matchLabels:
{{ tuple "hssdb" . | include "mcord-services.metadata_labels" | indent 6 }}
template:
metadata:
labels:
{{ tuple "hssdb" . | include "mcord-services.metadata_labels" | indent 8 }}
spec:
{{- if .Values.nodeSelectors.enabled }}
nodeSelector:
{{ .Values.nodeSelectors.hssdb.label }}: {{ .Values.nodeSelectors.hssdb.value }}
{{- end }}
securityContext:
runAsUser: 999
fsGroup: 999
containers:
- name: cassandra
image: {{ .Values.images.tags.hssdb }}
imagePullPolicy: {{ .Values.images.pullPolicy }}
ports:
- containerPort: 9042
name: cql
env:
- name: MAX_HEAP_SIZE
value: 512M
- name: HEAP_NEWSIZE
value: 100M
- name: CASSANDRA_SEEDS
value: {{ tuple "hssdb" "identity" . | include "mcord-services.endpoint_lookup" | quote }}
- name: CASSANDRA_CLUSTER_NAME
value: "HSS Cluster"
- name: CASSANDRA_RPC_ADDRESS
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: CASSANDRA_ENDPOINT_SNITCH
value: "GossipingPropertyFileSnitch"
readinessProbe:
exec:
command: ["/bin/bash", "-c", "nodetool status -r | awk -v h=$(hostname) '$2==h {exit ($1==\"UN\" ? 0 : -1)}'"]
initialDelaySeconds: 15
timeoutSeconds: 5
{{- if .Values.resources.enabled }}
resources:
{{ toYaml .Values.resources.hssdb | indent 10 }}
{{- end }}
volumeMounts:
- name: hssdb-config
mountPath: /etc/cassandra/cassandra-rackdc.properties
subPath: cassandra-rackdc.properties
volumes:
- name: hssdb-config
configMap:
name: hssdb