k8s redis

This commit is contained in:
2025-07-24 10:54:28 +02:00
committed by swordsteel
parent 3b8d20896c
commit ad0c180bd4
3 changed files with 97 additions and 4 deletions

View File

@@ -24,27 +24,30 @@
* [Config Map](#config-map-1)
* [Stateful Set](#stateful-set-2)
* [Service](#service-2)
* [Redis](#redis)
* [Stateful Set](#stateful-set-3)
* [Service](#service-3)
* [Hlæja](#hlæja)
* [Account Register](#account-register)
* [Secret](#secret-2)
* [Config Map](#config-map-2)
* [Deployment](#deployment)
* [Service](#service-3)
* [Service](#service-4)
* [Device Register](#device-register)
* [Secret](#secret-3)
* [Config Map](#config-map-3)
* [Deployment](#deployment-1)
* [Service](#service-4)
* [Service](#service-5)
* [Device Configuration](#device-configuration)
* [Secret](#secret-4)
* [Config Map](#config-map-4)
* [Deployment](#deployment-2)
* [Service](#service-5)
* [Service](#service-6)
* [Device Data](#device-data)
* [Secret](#secret-5)
* [Config Map](#config-map-5)
* [Deployment](#deployment-3)
* [Service](#service-6)
* [Service](#service-7)
<!-- TOC -->
----
@@ -284,6 +287,32 @@ kubectl apply -f .\kube\02-databases\03-infulxdb\04-service.yaml
---
### Redis
For now... run basic redis, we need to add authentication, replication later? need to think mor about this later.
#### Stateful Set
This is the specifications for redis.
```bash
kubectl apply -f .\kube\02-databases\04-redis\01-statefulset.yaml
```
Set storage size for permanent storage.
did add storage for restarts and some limits.
#### Service
this exposes port and ip.
```bash
kubectl apply -f .\kube\02-databases\04-redis\02-service.yaml
```
---
## Hlæja
To access service use `kubectl exec -it <pod-name> -n hlaeja -- /bin/sh`

View File

@@ -0,0 +1,43 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: redis
namespace: hlaeja
labels:
app: redis
environment: testing
tier: database
spec:
serviceName: redis
replicas: 1
selector:
matchLabels:
app: redis
template:
metadata:
labels:
app: redis
spec:
containers:
- name: redis
image: redis:8.0.3-alpine
ports:
- containerPort: 6379
resources:
requests:
memory: "256Mi"
cpu: "100m"
limits:
memory: "512Mi"
cpu: "500m"
volumeMounts:
- name: redis-data
mountPath: /data
volumeClaimTemplates:
- metadata:
name: redis-data
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 1Gi

View File

@@ -0,0 +1,21 @@
apiVersion: v1
kind: Service
metadata:
name: redis
namespace: hlaeja
labels:
app: redis
environment: testing
tier: database
annotations:
metallb.universe.tf/address-pool: default
spec:
type: LoadBalancer
loadBalancerIP: 10.0.3.144
selector:
app: redis
ports:
- port: 6379
targetPort: 6379
protocol: TCP
name: cql