Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 1 | --- |
Wei-Yu Chen | 53aec36 | 2019-01-18 16:30:33 -0800 | [diff] [blame] | 2 | # Copyright 2018-present Open Networking Foundation |
| 3 | # Copyright 2018 Intel Corporation |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 4 | # |
| 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 | --- |
| 18 | apiVersion: v1 |
| 19 | kind: Service |
| 20 | metadata: |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 21 | labels: |
| 22 | app: cassandra |
| 23 | name: cassandra |
| 24 | spec: |
| 25 | clusterIP: None |
| 26 | ports: |
| 27 | - port: 9042 |
| 28 | selector: |
| 29 | app: cassandra |
| 30 | --- |
| 31 | apiVersion: "apps/v1" |
| 32 | kind: StatefulSet |
| 33 | metadata: |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 34 | name: cassandra |
| 35 | labels: |
| 36 | app: cassandra |
| 37 | spec: |
| 38 | serviceName: cassandra |
| 39 | replicas: 1 # 3 |
| 40 | selector: |
| 41 | matchLabels: |
| 42 | app: cassandra |
| 43 | template: |
| 44 | metadata: |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 45 | 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 Chen | da76c32 | 2019-01-18 13:31:55 -0800 | [diff] [blame] | 63 | value: "{{ .Values.hssdb_hostname }}-0" |
Wei-Yu Chen | 450a98a | 2019-01-15 16:56:30 -0800 | [diff] [blame] | 64 | - 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 |