Adding Zookeeper charm
[osm/devops.git] / installers / charm / zookeeper-k8s / reactive / spec_template.yaml
1 # Copyright 2021 Canonical Ltd.
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License"); you may
4 # not use this file except in compliance with the License. You may obtain
5 # a copy of the License at
6 #
7 #         http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 # License for the specific language governing permissions and limitations
13 # under the License.
14 #
15 # For those usages not covered by the Apache License, Version 2.0 please
16 # contact: legal@canonical.com
17 #
18 # To get in touch with the maintainers, please contact:
19 # osm-charmers@lists.launchpad.net
20 ##
21
22 version: 2
23 containers:
24   - name: %(name)s
25     image: %(docker_image_path)s
26     kubernetes:
27       readinessProbe:
28         tcpSocket:
29           port: %(client-port)s
30         initialDelaySeconds: 10
31         timeoutSeconds: 5
32         failureThreshold: 6
33         successThreshold: 1
34       livenessProbe:
35         tcpSocket:
36           port: %(client-port)s
37         initialDelaySeconds: 20
38     ports:
39     - containerPort: %(client-port)s
40       name: client
41     - containerPort: %(server-port)s
42       name: server
43     - containerPort: %(leader-election-port)s
44       name: leader-election
45     config:
46         ALLOW_ANONYMOUS_LOGIN: 'yes'
47     command:
48     - sh
49     - -c
50     - "start-zookeeper \
51       --servers=%(zookeeper-units)s \
52       --data_dir=/var/lib/zookeeper/data \
53       --data_log_dir=/var/lib/zookeeper/data/log \
54       --conf_dir=/opt/zookeeper/conf \
55       --client_port=%(client-port)s \
56       --election_port=%(leader-election-port)s \
57       --server_port=%(server-port)s \
58       --tick_time=2000 \
59       --init_limit=10 \
60       --sync_limit=5 \
61       --heap=512M \
62       --max_client_cnxns=60 \
63       --snap_retain_count=3 \
64       --purge_interval=12 \
65       --max_session_timeout=40000 \
66       --min_session_timeout=4000 \
67       --log_level=INFO"
68     # readinessProbe:
69     #   exec:
70     #     command:
71     #     - sh
72     #     - -c
73     #     - "zookeeper-ready 2181"
74     #   initialDelaySeconds: 10
75     #   timeoutSeconds: 5
76     #   failureThreshold: 6
77     #   successThreshold: 1
78     # livenessProbe:
79     #   exec:
80     #     command:
81     #     - sh
82     #     - -c
83     #     - "zookeeper-ready 2181"
84     #   initialDelaySeconds: 20