Skip to content

Commit 44d162b

Browse files
committed
adding storage_class to values
1 parent 428f0b5 commit 44d162b

File tree

5 files changed

+141
-1
lines changed

5 files changed

+141
-1
lines changed

charts/redis-stack-server/Chart.yaml

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: v2
2+
name: redis-stack-server
3+
description: A Helm chart for Kubernetes
4+
5+
# A chart can be either an 'application' or a 'library' chart.
6+
#
7+
# Application charts are a collection of templates that can be packaged into versioned archives
8+
# to be deployed.
9+
#
10+
# Library charts provide useful utilities or functions for the chart developer. They're included as
11+
# a dependency of application charts to inject those utilities and functions into the rendering
12+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
13+
type: application
14+
15+
# This is the chart version. This version number should be incremented each time you make changes
16+
# to the chart and its templates, including the app version.
17+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18+
version: 0.1.0
19+
20+
# This is the version number of the application being deployed. This version number should be
21+
# incremented each time you make changes to the application. Versions are not expected to
22+
# follow Semantic Versioning. They should reflect the version the application is using.
23+
# It is recommended to use it with quotes.
24+
appVersion: "1.16.0"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "redis-stack.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "redis-stack.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "redis-stack.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "redis-stack.labels" -}}
37+
helm.sh/chart: {{ include "redis-stack.chart" . }}
38+
{{ include "redis-stack.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "redis-stack.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "redis-stack.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "redis-stack.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "redis-stack.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: "{{ .Values.name }}"
5+
labels:
6+
app: "{{ .Values.name }}"
7+
spec:
8+
ports:
9+
- port: {{ .Values.redis_stack_server.port }}
10+
name: db
11+
type: NodePort
12+
selector:
13+
app: "{{ .Values.name }}"
14+
---
15+
apiVersion: apps/v1
16+
kind: StatefulSet
17+
metadata:
18+
name: "{{ .Values.name }}"
19+
spec:
20+
selector:
21+
matchLabels:
22+
app: "{{ .Values.name }}"
23+
serviceName: "{{ .Values.name }}"
24+
replicas: {{ .Values.redis_stack_server.replicas }}
25+
template:
26+
metadata:
27+
labels:
28+
app: "{{ .Values.name }}"
29+
spec:
30+
terminationGracePeriodSeconds: 10
31+
containers:
32+
- name: "{{ .Values.name }}"
33+
image: {{ .Values.redis_stack_server.image }}:{{ .Values.redis_stack_server.tag }}
34+
imagePullPolicy: Always
35+
ports:
36+
- containerPort: {{ .Values.redis_stack_server.port }}
37+
name: db
38+
volumeClaimTemplates:
39+
- metadata:
40+
name: db
41+
spec:
42+
accessModes: [ "ReadWriteOnce" ]
43+
storageClassName: {{ .Values.redis_stack_server.storage_class }}
44+
resources:
45+
requests:
46+
storage: {{ .Values.redis_stack_server.storage }}

charts/redis-stack-server/values.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: redis-stack-server
2+
redis_stack_server:
3+
image: "redis/redis-stack-server"
4+
tag: "latest"
5+
port: 6379
6+
replicas: 1
7+
storage_class: "local-path"
8+
storage: 1Gi

charts/redis-stack/templates/service.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ spec:
1010
name: "{{ .Values.name }}"
1111
targetPort: {{ .Values.redis_stack.redis_server_port }}
1212
- port: {{ .Values.redis_stack.redis_insight_port }}
13-
name: "{{.Values.redis_stack.redis_insight}}"
13+
name: "{{.Values.redis_stack.redis_insight }}"
1414
targetPort: {{ .Values.redis_stack.redis_insight_port }}
1515
type: NodePort
1616
selector:

0 commit comments

Comments
 (0)