mirror of https://github.com/helm/helm
parent
dd857d0da2
commit
b7c13c0b84
@ -0,0 +1,32 @@
|
|||||||
|
{% set REDIS_PORT = 6379 %}
|
||||||
|
{% set WORKERS = properties['workers'] or 2 %}
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- name: redis-master
|
||||||
|
type: https://raw.githubusercontent.com/kubernetes/deployment-manager/master/examples/replicatedservice/replicatedservice.py
|
||||||
|
properties:
|
||||||
|
# This has to be overwritten since service names are hard coded in the code
|
||||||
|
service_name: redis-master
|
||||||
|
service_port: {{ REDIS_PORT }}
|
||||||
|
target_port: {{ REDIS_PORT }}
|
||||||
|
container_port: {{ REDIS_PORT }}
|
||||||
|
replicas: 1
|
||||||
|
container_name: master
|
||||||
|
image: redis
|
||||||
|
|
||||||
|
- name: redis-slave
|
||||||
|
type: https://raw.githubusercontent.com/kubernetes/deployment-manager/master/examples/replicatedservice/replicatedservice.py
|
||||||
|
properties:
|
||||||
|
# This has to be overwritten since service names are hard coded in the code
|
||||||
|
service_name: redis-slave
|
||||||
|
service_port: {{ REDIS_PORT }}
|
||||||
|
container_port: {{ REDIS_PORT }}
|
||||||
|
replicas: {{ WORKERS }}
|
||||||
|
container_name: worker
|
||||||
|
image: kubernetes/redis-slave:v2
|
||||||
|
# An example of how to specify env variables.
|
||||||
|
env:
|
||||||
|
- name: GET_HOSTS_FROM
|
||||||
|
value: env
|
||||||
|
- name: REDIS_MASTER_SERVICE_HOST
|
||||||
|
value: redis-master
|
@ -0,0 +1,10 @@
|
|||||||
|
info:
|
||||||
|
title: Redis cluster
|
||||||
|
description: Defines a redis cluster, using a single replica
|
||||||
|
replicatedservice for master and replicatedservice for workers.
|
||||||
|
|
||||||
|
properties:
|
||||||
|
workers:
|
||||||
|
type: int
|
||||||
|
default: 2
|
||||||
|
description: Number of worker replicas.
|
Loading…
Reference in new issue