.test-infra/kubernetes/cassandra/SmallITCluster/cassandra-svc-rc.yaml (55 lines of code) (raw):

# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you 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. # Headless service that allows us to get the IP addresses of our Cassandra nodes apiVersion: v1 kind: Service metadata: labels: name: cassandra-peers name: cassandra-peers spec: clusterIP: None ports: - port: 7000 name: intra-node-communication - port: 7001 name: tls-intra-node-communication selector: name: cassandra type: NodePort --- # Replication Controller for Cassandra which tracks the Cassandra pods. apiVersion: v1 kind: ReplicationController metadata: labels: name: cassandra name: cassandra spec: replicas: 1 selector: name: cassandra template: metadata: labels: name: cassandra spec: containers: - image: cassandra name: cassandra env: - name: PEER_DISCOVERY_SERVICE value: cassandra-peers - name: CASSANDRA_CLUSTER_NAME value: Cassandra - name: CASSANDRA_DC value: DC1 - name: CASSANDRA_RACK value: Kubernetes Cluster # Number of tokens currently configured to 1. If this is not configured, default value is 256. You can change it as per requirement. - name: CASSANDRA_NUM_TOKENS value: '1' ports: - containerPort: 9042 name: cql volumeMounts: - mountPath: /var/lib/cassandra/data name: data volumes: - name: data emptyDir: {}