diff options
author | iharijono <indra.harijono@huawei.com> | 2018-05-08 18:27:59 -0700 |
---|---|---|
committer | Indra Harijono <indra.harijono@huawei.com> | 2018-07-23 13:36:10 -0700 |
commit | dc421a4df9c86bbdffa68107a50bf267f20a5268 (patch) | |
tree | b6e01de1d6cb3a8051dba7e29b88e6d80b2405a8 | |
parent | 0254cb223d2eace1eaf295eacf4cea4fc4fd9844 (diff) |
Adding cassandra service with a separate yaml file.
- Left the file samples/scenarios/service_delivery_controller_opnfv.yaml unchanged.
- Added a yaml definition of Cassandra StatefulSet and its service into a separate file under tools directory
- Cassandra Service run with 1 replica
- Deleted 'data-plane-ns' and use 'default' instead for cassandra containers.
- Revoked changes for samples/scenarios/service_delivery_controller_opnfv.yaml.
- Added new line (Wutien suggested it)
JIRA: CLOVER-000
Change-Id: I2bb4249cf2523f5011d6fefc69dc469a90e20eaf
Signed-off-by: iharijono <indra.harijono@huawei.com>
-rw-r--r-- | clover/tools/yaml/cassandra.yaml | 97 | ||||
-rw-r--r-- | samples/scenarios/service_delivery_controller_opnfv.yaml | 1 |
2 files changed, 97 insertions, 1 deletions
diff --git a/clover/tools/yaml/cassandra.yaml b/clover/tools/yaml/cassandra.yaml new file mode 100644 index 0000000..83ed20f --- /dev/null +++ b/clover/tools/yaml/cassandra.yaml @@ -0,0 +1,97 @@ +# +# +# The addition below can be executed after the invocation of +# the original service_delivery_controller_opnfv.yaml +# by invoking: +# % kubectl create -f <(istioctl kube-inject --debug -f cassandra.yaml) +# +# +# +# Cassandra Statefulset +# +# Assumption: +# - The Cassandra Statefulset right now assumes that +# the service is deployed in the 'default' namespace +# therefore the environment variable CASSANDRA_SEEDS is set to +# "cassandra-0.cassandra.default.svc.cluster.local" below. +# if you want to use your own name space other than 'default' +# the value becomes: +# "cassandra-0.cassandra.<NAMESPACE_NAME>.svc.cluster.local" +# note that this value rely on a functioning DNS on kubernetes to resolve the IP +# +# This static method can be made dynamic by using Helm +# or bash script to replace the namespace on the fly. +# +# - Cassandra launch only 1 replica in the cluster +# to dynamically scale up or down, you can use: +# kubectl edit statefulset cassandra +# and edit the value of the replica key +# +# +# +--- +apiVersion: v1 +kind: Service +metadata: + labels: + app: cassandra + name: cassandra +spec: + clusterIP: None + ports: + - port: 9042 + selector: + app: cassandra +--- +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: cassandra + labels: + app: cassandra +spec: + serviceName: cassandra + replicas: 1 + selector: + matchLabels: + app: cassandra + template: + metadata: + labels: + app: cassandra + spec: + terminationGracePeriodSeconds: 1800 + containers: + - name: cassandra + image: cassandra:3 + imagePullPolicy: Always + ports: + - containerPort: 7000 + name: intra-node + - containerPort: 7001 + name: tls-intra-node + - containerPort: 7199 + name: jmx + - containerPort: 9042 + name: cql + resources: + limits: + cpu: "500m" + memory: 1Gi + requests: + cpu: "500m" + memory: 1Gi + env: + - name: MAX_HEAP_SIZE + value: 512M + - name: HEAP_NEWSIZE + value: 100M + - name: CASSANDRA_SEEDS + value: "cassandra-0.cassandra.default.svc.cluster.local" + - name: CASSANDRA_CLUSTER_NAME + value: "MyCassandraDemo" + - name: CASSANDRA_DC + value: "DC1-K8Demo" + - name: CASSANDRA_RACK + value: "Rack1-K8Demo" + diff --git a/samples/scenarios/service_delivery_controller_opnfv.yaml b/samples/scenarios/service_delivery_controller_opnfv.yaml index ee0adcc..9fee92f 100644 --- a/samples/scenarios/service_delivery_controller_opnfv.yaml +++ b/samples/scenarios/service_delivery_controller_opnfv.yaml @@ -358,4 +358,3 @@ spec: backend: serviceName: proxy-access-control servicePort: 9180 ---- |