k8s hlaeja device configuration

This commit is contained in:
2025-07-23 13:03:34 +02:00
committed by swordsteel
parent a1038e9afc
commit 1a18ef90e4
5 changed files with 126 additions and 0 deletions

View File

@@ -30,6 +30,11 @@
* [Config Map](#config-map-2) * [Config Map](#config-map-2)
* [Deployment](#deployment-1) * [Deployment](#deployment-1)
* [Service](#service-3) * [Service](#service-3)
* [Device Configuration](#device-configuration)
* [Secret](#secret-3)
* [Config Map](#config-map-3)
* [Deployment](#deployment-2)
* [Service](#service-4)
<!-- TOC --> <!-- TOC -->
---- ----
@@ -223,6 +228,10 @@ kubectl apply -f .\kube\02-databases\02-cassandra\02-service.yaml
## Hlæja ## Hlæja
To access service use `kubectl exec -it <pod-name> -n hlaeja -- /bin/sh`
To tail a service log use `kubectl logs -f <pod-name> -n hlaeja`
### Account Register ### Account Register
This is only a ***concept*** and exist for testing rest of system. this need to be ***rewritten***. This is only a ***concept*** and exist for testing rest of system. this need to be ***rewritten***.
@@ -308,3 +317,43 @@ this service should not be accessible from world only open in testing
```bash ```bash
kubectl apply -f .\kube\03-hlaeja\02-device-registry\04-service.yaml kubectl apply -f .\kube\03-hlaeja\02-device-registry\04-service.yaml
``` ```
---
### Device Configuration
#### Secret
```bash
kubectl apply -f .\kube\03-hlaeja\03-device-configuration\01-secret.yaml
```
Set values:
- cassandra password (db have not turned this on yet)
#### Config Map
```bash
kubectl apply -f .\kube\03-hlaeja\03-device-configuration\02-configmap.yaml
```
Set values:
- spring profile
- cassandra username (db have not turned this on yet)
- cassandra contact points
#### Deployment
```bash
kubectl apply -f .\kube\03-hlaeja\03-device-configuration\03-deployment.yaml
```
#### Service
this service should not be accessible from world only open in testing
```bash
kubectl apply -f .\kube\03-hlaeja\03-device-configuration\04-service.yaml
```

View File

@@ -0,0 +1,12 @@
apiVersion: v1
kind: Secret
metadata:
name: device-configuration
namespace: hlaeja
labels:
app: device-configuration
environment: testing
tier: backend
type: Opaque
stringData:
SPRING_CASSANDRA_PASSWORD: "password"

View File

@@ -0,0 +1,13 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: device-configuration
namespace: hlaeja
labels:
app: device-configuration
environment: testing
tier: backend
data:
SPRING_PROFILES_ACTIVE: "testing"
SPRING_CASSANDRA_USERNAME: "cassandra"
SPRING_CASSANDRA_CONTACT_POINTS: "cassandra"

View File

@@ -0,0 +1,32 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: device-configuration
namespace: hlaeja
labels:
app: device-configuration
environment: testing
tier: backend
spec:
replicas: 1
selector:
matchLabels:
app: device-configuration
template:
metadata:
labels:
app: device-configuration
spec:
imagePullSecrets:
- name: github
containers:
- name: device-configuration-app
image: ghcr.io/swordsteel/hlaeja-device-configuration:0.1.0
imagePullPolicy: IfNotPresent
envFrom:
- configMapRef:
name: device-configuration
- secretRef:
name: device-configuration
ports:
- containerPort: 8080

View File

@@ -0,0 +1,20 @@
apiVersion: v1
kind: Service
metadata:
name: device-configuration
namespace: hlaeja
annotations:
metallb.universe.tf/address-pool: default
labels:
app: device-configuration
environment: testing
tier: backend
spec:
type: LoadBalancer
loadBalancerIP: 10.0.3.113
selector:
app: device-configuration
ports:
- protocol: TCP
port: 80
targetPort: 8080