Skip to content
This repository was archived by the owner on Mar 22, 2018. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions cassandra-atomicapp/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
FROM projectatomic/atomicapp:0.4.4
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0.4.5 please :)


MAINTAINER Varun Joshi <varunj.1011@gmail.com>

LABEL io.projectatomic.nulecule.providers="docker,kubernetes" \
io.projectatomic.nuleclue.specversion="0.0.2"

ADD /Nulecule /Dockerfile /application-entity/
ADD /artifacts /application-entity/artifacts
53 changes: 53 additions & 0 deletions cassandra-atomicapp/Nulecule
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
specversion: 0.0.2
id: cassandra-atomicapp

metadata:
name: Cassandra App
appversion: 0.0.1
description: Cassandra Atomic App

graph:
- name: cassandra-app
params:
- name: image
description: The cassandra image
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no default value for what image?

- name: hostport
description: The port where cassandra runs
default: 7000
- name: listen_address
description: This variable is for controlling which IP address to listen for incoming connections on.
default: auto
- name: broadcast_address
description: This variable is for controlling which IP address to advertise to other nodes.
default: auto
- name: rpc_address
description: This variable is for controlling which address to bind the thrift rpc server to.
default: 0.0.0.0
- name: start_rpc
description: This variable is for controlling if the thrift rpc server is started.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't need This variable is for controlling in each description. It'll be cleaner to remove it and just say "If the thrift rpc server is started"

Same goes with "Which IP address to advertise to other nodes"

default: ""
- name: seeds
description: This variable is the comma-separated list of IP addresses used by gossip for bootstrapping new nodes joining a cluster.
default: ""
- name: cluster_name
description: This variable sets the name of the cluster and must be the same for all nodes in the cluster.
default: ""
- name: num_tokens
description: This variable sets number of tokens for this node.
default: ""
- name: dc
description: This variable sets the datacenter name of this node.
default: ""
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what happens if we don't include all the params that have "" as a default? :) does cassandra explictly require them?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cassandra assumes default values for those, so I let them remain empty.

- name: rack
description: This variable sets the rack name of this node.
default: ""
- name: endpoint_snitch
description: This variable sets the snitch implementation this node will use.
default: ""
artifacts:
docker:
- file://artifacts/docker/cassandra_run
kubernetes:
- file://artifacts/kubernetes/cassandra-rc.yaml
- file://artifacts/kubernetes/cassandra-svc.yaml
16 changes: 16 additions & 0 deletions cassandra-atomicapp/answers.conf.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[cassandra-app]
num_tokens = None
endpoint_snitch = ""
broadcast_address = auto
start_rpc = ""
image = ""
hostport = 7000
dc = ""
cluster_name = ""
seeds = ""
rpc_address = 0.0.0.0
listen_address = auto
rack = ""
[general]
namespace = default
provider = docker
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no answers.conf.sample please! :) I'll be updating the read-me to fix this.

12 changes: 12 additions & 0 deletions cassandra-atomicapp/artifacts/docker/cassandra_run
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
docker run -d -p 7000:$hostport
-e CASSANDRA_LISTEN_ADDRESS=$listen_address
-e CASSANDRA_BROADCAST_ADDRESS=$broadcast_address
-e CASSANDRA_RPC_ADDRESS=$rpc_address
-e CASSANDRA_START_RPC=$start_rpc
-e CASSANDRA_SEEDS=$seeds
-e CASSANDRA_CLUSTER_NAME=$cluster_name
-e CASSANDRA_NUM_TOKENS=$num_tokens
-e CASSANDRA_DC=$dc
-e CASSANDRA_RACK=$rack
-e CASSANDRA_ENDPOINT_SNITCH=$endpoint_snitch
$image
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing new line backticks? ex.

docker run -d -p 7000:$hostport \ 
   -e CASSANDRA_LISTEN_ADDRESS=$listen_address \ 
...

43 changes: 43 additions & 0 deletions cassandra-atomicapp/artifacts/kubernetes/cassandra-rc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
apiVersion: v1
kind: ReplicationController
metadata:
name: cassandra
labels:
name: cassandra
spec:
replicas: 1
selector:
name: cassandra
template:
metadata:
labels:
name: cassandra
spec:
containers:
- name: cassandra
image: $image
ports:
- name: cassandra-server
containerPort: $hostport
env:
- name: CASSANDRA_LISTEN_ADDRESS
value: $listen_address
- name: CASSANDRA_BROADCAST_ADDRESS
value: $broadcast_address
- name: CASSANDRA_RPC_ADDRESS
value: $rpc_address
- name: CASSANDRA_START_RPC
value: $start_rpc
- name: CASSANDRA_SEEDS
value: $seeds
- name: CASSANDRA_CLUSTER_NAME
value: $cluster_name
- name: CASSANDRA_NUM_TOKENS
value: $num_tokens
- name: CASSANDRA_DC
value: $dc
- name: CASSANDRA_RACK
value: $rack
- name: CASSANDRA_ENDPOINT_SNITCH
value: $endpoint_snitch
14 changes: 14 additions & 0 deletions cassandra-atomicapp/artifacts/kubernetes/cassandra-svc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
apiVersion: v1
kind: Service
metadata:
name: cassandra-svc
labels:
name: cassandra-svc
spec:
type: NodePort
ports:
- port: 7000
targetPort: cassandra-server
selector:
name: cassandra