Skip to content

Commit

Permalink
redis init
Browse files Browse the repository at this point in the history
  • Loading branch information
petar-cvit committed Apr 9, 2024
1 parent 3ebfd32 commit 057f543
Show file tree
Hide file tree
Showing 5 changed files with 89 additions and 0 deletions.
3 changes: 3 additions & 0 deletions redis/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
apiVersion: v1
name: mysql
version: 0.0.0
35 changes: 35 additions & 0 deletions redis/templates/primary.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.name }}-redis
spec:
replicas: 1
selector:
matchLabels:
app: redis
role: primary
template:
metadata:
labels:
app: redis
role: primary
spec:
containers:
- name: redis
image: "redis:{{- .Values.name }}"
ports:
- containerPort: 6379
name: redis
---
apiVersion: v1
kind: Service
metadata:
name: {{ .Values.name }}-redis
spec:
selector:
app: redis
role: primary
ports:
- protocol: TCP
port: 6379
targetPort: 6379
23 changes: 23 additions & 0 deletions redis/templates/replica.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Values.name }}-redis-replica
spec:
replicas: 2
selector:
matchLabels:
app: redis
role: replica
template:
metadata:
labels:
app: redis
role: replica
spec:
containers:
- name: redis
image: redis:latest
command: ["redis-server", "--slaveof", "{{ .Values.name }}-redis", "6379"]
ports:
- containerPort: 6379
name: redis
26 changes: 26 additions & 0 deletions redis/values.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"properties": {
"name": {
"description": "Database name",
"type": "string"
},
"version": {
"description": "Container image version",
"type": "string",
"enum": [
"6.0",
"5.0"
]
}
},
"order": [
"name",
"version"
],
"required": [
"name",
"version"
],
"title": "Values",
"type": "object"
}
2 changes: 2 additions & 0 deletions redis/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
name: my-database
version: 6.0

0 comments on commit 057f543

Please sign in to comment.