Skip to content
This repository was archived by the owner on Feb 22, 2022. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions incubator/redis-cache/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apiVersion: v1
description: A pure in-memory redis cache, using statefulset and redis-sentinel-micro
name: redis-cache
version: 0.2.0
version: 0.3.0
icon: https://redis.io/images/redis-white.png
sources:
- https://github.com/antirez/redis
- https://github.com/dhilipkumars/redis-sentinel-micro/tree/k8s
- https://github.com/antirez/redis
- https://github.com/dhilipkumars/redis-sentinel-micro/tree/k8s
maintainers:
- name: dhilipkumars
email: [email protected]
- name: dhilipkumars
email: [email protected]
2 changes: 1 addition & 1 deletion incubator/redis-cache/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
1. To Find which replica is the master
kubectl exec -i -t {{ template "fullname" . }}-0 -c redis -- redis-cli -h {{ template "fullname" . }}-0.{{ template "fullname" . }}.{{ .Release.Namespace }} -p 6379 info replication
kubectl exec -i -t {{ template "redis-cache.fullname" . }}-0 -c redis -- redis-cli -h {{ template "redis-cache.fullname" . }}-0.{{ template "redis-cache.fullname" . }}.{{ .Release.Namespace }} -p 6379 info replication
4 changes: 2 additions & 2 deletions incubator/redis-cache/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "name" -}}
{{- define "redis-cache.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "fullname" -}}
{{- define "redis-cache.fullname" -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
4 changes: 2 additions & 2 deletions incubator/redis-cache/templates/pdb.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
name: {{ template "fullname" . }}
name: {{ template "redis-cache.fullname" . }}
spec:
selector:
matchLabels:
app: {{ template "name" . }}
app: {{ template "redis-cache.name" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
Expand Down
6 changes: 3 additions & 3 deletions incubator/redis-cache/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ kind: Service
metadata:
annotations:
service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
name: {{ template "fullname" . }}
name: {{ template "redis-cache.fullname" . }}
labels:
app: {{ template "name" . }}
app: {{ template "redis-cache.name" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
Expand All @@ -15,4 +15,4 @@ spec:
name: {{ .Values.service.name }}
clusterIP: None
selector:
app: {{ template "name" . }}
app: {{ template "redis-cache.name" . }}
14 changes: 7 additions & 7 deletions incubator/redis-cache/templates/ss.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: "{{ template "fullname" . }}"
name: "{{ template "redis-cache.fullname" . }}"
labels:
app: {{ template "name" . }}
app: {{ template "redis-cache.name" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
spec:
serviceName: "{{ template "fullname" . }}"
serviceName: "{{ template "redis-cache.fullname" . }}"
replicas: {{ .Values.replicaCount }}
template:
metadata:
labels:
app: {{ template "name" . }}
app: {{ template "redis-cache.name" . }}
chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
release: "{{ .Release.Name }}"
heritage: "{{ .Release.Service }}"
Expand All @@ -28,23 +28,23 @@ spec:
- topologyKey: "kubernetes.io/hostname"
labelSelector:
matchLabels:
app: {{ template "name" . }}
app: {{ template "redis-cache.name" . }}
release: {{ .Release.Name | quote }}
{{- else if eq .Values.antiAffinity "soft" }}
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 5
podAffinityTerm:
labelSelector:
matchLabels:
app: {{ template "name" . }}
app: {{ template "redis-cache.name" . }}
release: {{ .Release.Name | quote }}
topologyKey: "kubernetes.io/hostname"
{{- end }}
initContainers :
- name: sentinel-micro
image: {{ .Values.microSentinel.image.repository }}:{{ .Values.microSentinel.image.tag }}
imagePullPolicy: {{ .Values.microSentinel.image.pullPolicy }}
args: ["-service",{{ template "fullname" . }}]
args: ["-service",{{ template "redis-cache.fullname" . }}]
resources:
{{ toYaml .Values.microSentinel.resources | indent 12 }}
env:
Expand Down