forked from manishmarahatta/kong-dist-google-cloud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cassandraservice.jinja
64 lines (56 loc) · 1.57 KB
/
cassandraservice.jinja
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{% set CLUSTER_TYPE = env['project'] + '/' + properties['clusterType'] %}
{% set COLLECTION_PREFIX = '/api/v1/namespaces/{namespace}/' %}
{% set RC_COLLECTION = COLLECTION_PREFIX + 'replicationcontrollers' %}
{% set SERVICE_COLLECTION = COLLECTION_PREFIX + 'services' %}
{% set NAME_PREFIX = env['name'] %}
{% set CQL_PORT = properties['cql_port'] %}
{% set THIRFT_PORT = properties['thirft_port'] %}
resources:
- name: {{ NAME_PREFIX }}
type: {{ CLUSTER_TYPE }}:{{ SERVICE_COLLECTION }}
properties:
apiVersion: v1
kind: Service
namespace: default
metadata:
name: {{ NAME_PREFIX }}
spec:
ports:
- name: cql
port: {{ CQL_PORT }}
targetPort: 9042
protocol: TCP
- name: thrift
port: {{ THIRFT_PORT }}
targetPort: 9160
protocol: TCP
selector:
name: {{ NAME_PREFIX }}
- name: {{ NAME_PREFIX }}-rc
type: {{ CLUSTER_TYPE }}:{{ RC_COLLECTION }}
properties:
apiVersion: v1
kind: ReplicationController
namespace: default
metadata:
name: {{ NAME_PREFIX }}-rc
spec:
template:
metadata:
labels:
name: {{ NAME_PREFIX }}
spec:
containers:
- name: cassandra
image: {{ properties['image'] }}
ports:
- containerPort: 9042
name: cql
- containerPort: 9160
name: thrift
volumeMounts:
- mountPath: /cassandra_data
name: data
volumes:
- name: data
emptyDir: {}