changed to unmaintained
[aaf/authz.git] / auth / helm / aaf / templates / aaf-cass.yaml
1 #########
2 ##  ============LICENSE_START====================================================
3 ##  org.onap.aaf
4 ##  ===========================================================================
5 ##  Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
6 ##  ===========================================================================
7 ##  Licensed under the Apache License, Version 2.0 (the "License");
8 ##  you may not use this file except in compliance with the License.
9 ##  You may obtain a copy of the License at
10 ##
11 ##       http://www.apache.org/licenses/LICENSE-2.0
12 ##
13 ##  Unless required by applicable law or agreed to in writing, software
14 ##  distributed under the License is distributed on an "AS IS" BASIS,
15 ##  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 ##  See the License for the specific language governing permissions and
17 ##  limitations under the License.
18 ##  ============LICENSE_END====================================================
19 ##
20
21 kind: Service
22 apiVersion: v1
23 metadata:
24   name: aaf-cass
25   labels:
26     app: aaf-cass
27 spec:
28   selector:
29     app: aaf-cass
30   ports:
31     - name: storage
32       protocol: TCP
33       port: {{.Values.services.cass.storage_port}}
34       containerPort: {{.Values.services.cass.storage_port}}
35     - name: ssl-storage
36       protocol: TCP
37       port: {{.Values.services.cass.ssl_storage_port}}
38       containerPort: {{.Values.services.cass.ssl_storage_port}}
39     - name: native-trans
40       protocol: TCP
41       port: {{.Values.services.cass.native_trans_port}}
42       containerPort: {{.Values.services.cass.native_trans_port}}
43     - name: rpc
44       protocol: TCP
45       port: {{.Values.services.cass.rpc_port}}
46       containerPort: {{.Values.services.cass.rpc_port}}
47 ---
48 apiVersion: apps/v1
49 kind: Deployment
50 metadata:
51   name: aaf-cass
52   labels:
53     app: aaf-cass
54 spec:
55   replicas: {{ .Values.services.cass.replicas }}
56   selector:
57     matchLabels:
58       app: aaf-cass
59   template:
60     metadata:
61       labels:
62         app: aaf-cass
63     spec:
64       volumes:
65       - name: aaf-cass-vol
66         persistentVolumeClaim:
67           claimName: aaf-cass-pvc
68       - name: aaf-status-vol
69         persistentVolumeClaim:
70           claimName: aaf-status-pvc
71       initContainers:
72         - command:
73             - /bin/sh
74             - -c
75             - |
76               chmod -R 775 /opt/app/aaf/status
77               chown -R 1000:1000 /opt/app/aaf/status
78               chmod -R 775 /var/lib/cassandra
79               chown -R 1000:1000 /var/lib/cassandra
80           image: busybox:1.28
81           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
82           name: init-sysctl
83           volumeMounts:
84             - mountPath: /opt/app/aaf/status
85               name: aaf-status-vol
86             - mountPath: /var/lib/cassandra
87               name: aaf-cass-vol
88       containers:
89 ###
90 ### AAF-CASS
91 ###
92       - name: aaf-cass
93         image: {{ .Values.image.repository }}onap/aaf/aaf_cass:{{ .Values.image.version }}
94         imagePullPolicy: IfNotPresent
95         # installing with cmd "onap" will not only initialize the DB, but add ONAP bootstrap data as well
96         command: ["/bin/bash","/opt/app/aaf/cass_init/cmd.sh","onap"]
97         lifecycle:
98           preStop:
99             exec:
100               command: ["/bin/sh","-c","rm /opt/app/aaf/status/aaf-cass"]
101         volumeMounts:
102         - mountPath: "/var/lib/cassandra"
103           name: aaf-cass-vol
104         - mountPath: "/opt/app/aaf/status"
105           name: aaf-status-vol
106         ports:
107         - name: storage
108           containerPort: {{.Values.services.cass.storage_port}}
109         - name: ssl-storage
110           containerPort: {{.Values.services.cass.storage_port}}
111         - name: native-trans
112           containerPort: {{.Values.services.cass.native_trans_port}}
113         - name: rpc
114           containerPort: {{.Values.services.cass.rpc_port}}
115         env:
116         - name: CASSANDRA_CLUSTER_NAME
117           value: {{.Values.services.cass.cluster_name}}
118         - name: CASSANDRA_DC
119           value: {{.Values.services.cass.dc}}
120         - name: HEAP_NEWSIZE
121           value: {{.Values.services.cass.heap_new_size}}
122         - name: MAX_HEAP_SIZE
123           value: {{.Values.services.cass.max_heap_size}}
124         - name: MY_POD_NAME
125           valueFrom:
126             fieldRef:
127               fieldPath: metadata.name
128         - name: MY_POD_NAMESPACE
129           value: {{ .Release.Namespace }}
130         - name: MY_POD_IP
131           valueFrom:
132             fieldRef:
133               fieldPath: status.podIP