Updated zookeeper templates to v 3.4.9

This commit is contained in:
Raul Sanchez 2016-11-30 01:38:49 +01:00
parent 41c2541e98
commit 2c8c14b6af
9 changed files with 345 additions and 4 deletions

View File

@ -0,0 +1,31 @@
# Apache Zookeeper (Experimental)
### Info:
This template creates, scale in and scale out a multinodes zk (zookeeper) cluster on top of k8s. The configuration is generated with confd watching k8s metadata.
Cluster size are variable after deployment, and get reconfigured if you scale.
The services generates ZKID's (saving them as pod labels) and start the zookeeper cluster.
### Usage:
Select Apache Zookeeper from catalog.
Change the following zookeeper default parameters, if you need:
- zk_name="zookeeper" # Name of the k8s rc and service.
- zk_namespace="default" # Name of the k8s namespace
- zk_scale="3" # Number of zk replicas
- zk_mem="512" # Mem to configure zk.
- zk_data_dir="/opt/zk/data" # Zk dataDir param value
- zk_init_limit="10" # zk initLimit param value
- zk_max_client_cxns="500" # zk maxClientCnxns param value
- zk_sync_limit="5" # zk syncLimit param value
- zk_tick_time="2000" # zk tickTime param value
Click deploy.
Zookeeper can now be accessed over the Rancher network.
Testing Feature: When you scale the cluster, zero downtime is expected...

View File

@ -0,0 +1,73 @@
.catalog:
name: Zookeeper
version: 3.4.9-k8s1
description: |
(Experimental) Apache Zookeeper cluster.
minimum_rancher_version: v0.59.0
maintainer: "Raul Sanchez <rawmind@gmail.com>"
uuid: zk-0
questions:
- variable: "zk_name"
description: "Name of zookeeper rc and service."
label: "K8s rc name:"
required: true
default: "zookeeper"
type: "string"
- variable: "zk_namespace"
description: "Name of zookeeper namespace."
label: "K8s namespace:"
required: true
default: "default"
type: "string"
- variable: "zk_scale"
description: "Number of zk nodes. Note: Recommended an odd number"
label: "Zk Nodes:"
required: true
default: 3
type: "int"
- variable: "zk_mem"
description: "Amount of memory to config zk."
label: "Zk Memory (mb):"
required: true
default: 512
type: "int"
- variable: "zk_init_limit"
description: "Time to allow followers to connect and sync with leader"
label: "Zk init limit (ticks):"
required: true
default: 10
type: "int"
- variable: "zk_data_dir"
description: "Directory where zookeeper store data"
label: "Zk data dir:"
required: true
default: "/opt/zk/data"
type: "string"
- variable: "zk_max_client_cxns"
description: "Max client concurrent connections"
label: "Zk max client cxns:"
required: true
default: 500
type: "int"
- variable: "zk_sync_limit"
description: "Time to allow followers to sync with leader"
label: "Zk sync limit (ticks):"
required: true
default: 5
type: "int"
- variable: "zk_tick_time"
description: "Tick time length"
label: "Zk tick time (ms):"
required: true
default: 2000
type: "int"
zk:
scale: ${zk_scale}
retain_ip: true
health_check:
port: 2181
interval: 5000
unhealthy_threshold: 3
request_line: ''
healthy_threshold: 2
response_timeout: 5000

View File

@ -0,0 +1,80 @@
apiVersion: v1
kind: ReplicationController
metadata:
name: "${zk_name}"
namespace: "${zk_namespace}"
labels:
name: "${zk_name}"
spec:
replicas: ${zk_scale}
selector:
name: "${zk_name}"
template:
metadata:
labels:
name: "${zk_name}"
annotations:
spec:
containers:
- name: "zk-conf"
image: "rawmind/k8s-zk:3.4.8-10"
volumeMounts:
- mountPath: "/opt/tools"
name: "zk-conf"
ports:
imagePullPolicy: "IfNotPresent"
- name: "zk-volume"
image: "rawmind/alpine-volume:0.0.2-1"
env:
- name: SERVICE_UID
value: "10002"
- name: SERVICE_GID
value: "10002"
- name: SERVICE_VOLUME
value: "${kafka_log_dir}"
- name: KEEP_ALIVE
value: "1"
volumeMounts:
- mountPath: "${zk_data_dir}"
name: "zk-data"
ports:
imagePullPolicy: "IfNotPresent"
- name: "zk-service"
image: "rawmind/alpine-zk:3.4.9"
env:
- name: JVMFLAGS
value: "-Xmx${zk_mem}m -Xms${zk_mem}m"
- name: ZK_DATA_DIR
value: "${zk_data_dir}"
- name: ZK_INIT_LIMIT
value: "${zk_init_limit}"
- name: ZK_MAX_CLIENT_CXNS
value: "${zk_max_client_cxns}"
- name: ZK_SYNC_LIMIT
value: "${zk_sync_limit}"
- name: ZK_TICK_TIME
value: "${zk_tick_time}"
- name: POD_NAMESPACE
value: "${zk_namespace}"
volumeMounts:
- mountPath: "${zk_data_dir}"
name: "zk-data"
- mountPath: "/opt/tools"
name: "zk-conf"
ports:
- containerPort: 2181
name: "zk-client"
protocol: "TCP"
- containerPort: 2888
name: "zk-server"
protocol: "TCP"
- containerPort: 3888
name: "zk-leader"
protocol: "TCP"
imagePullPolicy: "IfNotPresent"
restartPolicy: "Always"
volumes:
- name: "zk-data"
emptyDir: {}
- name: "zk-conf"
emptyDir: {}

View File

@ -0,0 +1,23 @@
apiVersion: v1
kind: Service
metadata:
name: "${zk_name}"
namespace: "${zk_namespace}"
labels:
name: "${zk_name}"
spec:
ports:
- port: 2181
targetPort: 2181
name: "zk-client"
protocol: "TCP"
- port: 2888
targetPort: 2888
name: "zk-server"
protocol: "TCP"
- port: 3888
targetPort: 3888
name: "zk-leader"
protocol: "TCP"
selector:
name: "${zk_name}"

View File

@ -1,7 +1,7 @@
name: Apache Zookeeper
description: |
(Experimental) Zookeeper cluster
version: 3.4.8-k8s1
version: 3.4.9-k8s1
category: Clustering
maintainer: "Raul Sanchez <rawmind@gmail.com>"
projectURL: https://github.com/rawmind0/alpine-zk
projectURL: https://github.com/rawmind0/alpine-zk

View File

@ -0,0 +1,27 @@
# Apache Zookeeper (Experimental)
### Info:
This template creates, scale in and scale out a multinodes zk (zookeeper) cluster on top of Rancher. The configuration is generated with confd from Rancher metadata.
Cluster size are variable after deployment, and get reconfigured if refresh interval > 0.
### Usage:
Select Apache Zookeeper from catalog.
Enter the number of nodes, mem and refresh interval for the zk cluster. (set refresh data to 0 to disable dinamic config)
Change the following zookeeper default parameters, if you need:
- ZK_DATA_DIR="/opt/zk/data"
- ZK_INIT_LIMIT="10"
- ZK_MAX_CLIENT_CXNS="500"
- ZK_SYNC_LIMIT="5"
- ZK_TICK_TIME="2000"
Click deploy.
Zookeeper can now be accessed over the Rancher network.
Note: When you scale the cluster, zero downtime is expected...

View File

@ -0,0 +1,40 @@
zk:
tty: true
image: rawmind/alpine-zk:3.4.9
volumes_from:
- zk-volume
- zk-conf
environment:
- JVMFLAGS=-Xmx${zk_mem}m -Xms${zk_mem}m
- ZK_DATA_DIR=${zk_data_dir}
- ZK_INIT_LIMIT=${zk_init_limit}
- ZK_MAX_CLIENT_CXNS=${zk_max_client_cxns}
- ZK_SYNC_LIMIT=${zk_sync_limit}
- ZK_TICK_TIME=${zk_tick_time}
labels:
io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name}
io.rancher.container.hostname_override: container_name
io.rancher.sidekicks: zk-volume, zk-conf
zk-conf:
net: none
labels:
io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name}
io.rancher.container.hostname_override: container_name
io.rancher.container.start_once: true
image: rawmind/rancher-zk:3.4.8-5
volumes:
- /opt/tools
zk-volume:
net: none
labels:
io.rancher.scheduler.affinity:container_label_soft_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name}
io.rancher.container.hostname_override: container_name
io.rancher.container.start_once: true
environment:
- SERVICE_UID=10002
- SERVICE_GID=10002
- SERVICE_VOLUME=${zk_data_dir}
volumes:
- ${zk_data_dir}
volume_driver: local
image: rawmind/alpine-volume:0.0.2-1

View File

@ -0,0 +1,67 @@
.catalog:
name: Zookeeper
version: 3.4.9-rancher1
description: |
(Experimental) Apache Zookeeper cluster.
minimum_rancher_version: v0.59.0
maintainer: "Raul Sanchez <rawmind@gmail.com>"
uuid: zk-0
questions:
- variable: "zk_scale"
description: "Number of zk nodes. Note: Recommended an odd number"
label: "Zk Nodes:"
required: true
default: 3
type: "int"
- variable: "zk_mem"
description: "Amount of memory to config zk."
label: "Zk Memory (mb):"
required: true
default: 512
type: "int"
- variable: "zk_init_limit"
description: "Time to allow followers to connect and sync with leader"
label: "Zk init limit (ticks):"
required: true
default: 10
type: "int"
- variable: "zk_data_dir"
description: "Directory where zookeeper store data"
label: "Zk data dir:"
required: true
default: "/opt/zk/data"
type: "string"
- variable: "zk_max_client_cxns"
description: "Max client concurrent connections"
label: "Zk max client cxns:"
required: true
default: 500
type: "int"
- variable: "zk_sync_limit"
description: "Time to allow followers to sync with leader"
label: "Zk sync limit (ticks):"
required: true
default: 5
type: "int"
- variable: "zk_tick_time"
description: "Tick time length"
label: "Zk tick time (ms):"
required: true
default: 2000
type: "int"
- variable: "zk_interval"
description: "Interval to poll/apply configuration changes. 0 to disable, reconfiguration will be done when you restart zk nodes"
label: "Zk Interval (s):"
required: true
default: 60
type: "int"
zk:
scale: ${zk_scale}
retain_ip: true
health_check:
port: 2181
interval: 5000
unhealthy_threshold: 3
request_line: ''
healthy_threshold: 2
response_timeout: 5000

View File

@ -1,8 +1,8 @@
name: Apache Zookeeper
description: |
(Experimental) Zookeeper cluster
version: 3.4.8-rancher1
version: 3.4.9-rancher1
category: Clustering
maintainer: "Raul Sanchez <rawmind@gmail.com>"
projectURL: https://github.com/rawmind0/alpine-zk
license:
license: