34 Commits

Author SHA1 Message Date
bb81dc3062 Hlæja concept v0.7.0 2025-07-29 21:45:52 +02:00
68df9a1847 update dependency doc 2025-07-28 14:16:12 +02:00
f5c1707179 rename helm databases to dependency 2025-07-28 13:03:38 +02:00
fe01ad9125 rename kube to kubectl and add README.md 2025-07-28 11:37:04 +02:00
c91bafd272 rename helmfile for local version
update README.md
add helmfile.yaml to .gitignore
rename helmfile.yaml to helmfile.yaml-dev
2025-07-28 11:37:04 +02:00
0368a2c6fa helm hlaeja management
- add actuator.http
- add http-client.env.json-dev
- update helmfile.yaml
- add 04-service.yaml
- add 03-deployment.yaml
- add 02-configmap.yaml
- add 01-secret.yaml
- add values.yaml
- add Chart.yaml
2025-07-28 11:37:04 +02:00
d65799bc56 helm hlaeja registry api
- update actuator.http
- update helmfile.yaml
- add 03-service.yaml
- add 02-deployment.yaml
- add 01-configmap.yaml
- update 01 secret values.yaml with keystore
- add values.yaml
- add Chart.yaml
2025-07-28 11:37:04 +02:00
dd4b761d80 helm hlaeja device api
- update actuator.http
- update helmfile.yaml
- add 04-service.yaml
- add 03-deployment.yaml
- add 02-configmap.yaml
- add 01-secret.yaml
- update 01 secret values.yaml with keystore
- add values.yaml
- add Chart.yaml
2025-07-28 11:37:04 +02:00
60c236784a helm database redis
- update values.yaml for redis
- update Chart.yaml for redis
2025-07-28 11:37:04 +02:00
c0d0156da8 helm hlaeja device data
- update actuator.http
- update helmfile.yaml
- add 04-service.yaml
- add 03-deployment.yaml
- add 02-configmap.yaml
- add 01-secret.yaml
- add values.yaml
- add Chart.yaml
2025-07-28 11:37:04 +02:00
67c92fa4c7 helm database influxdb
- update values.yaml for influxdb
- update Chart.yaml for influxdb
2025-07-28 11:37:04 +02:00
638be7dc51 helm hlaeja device configuration
- update actuator.http
- update helmfile.yaml
- add 04-service.yaml
- add 03-deployment.yaml
- add 02-configmap.yaml
- add 01-secret.yaml
- add values.yaml
- add Chart.yaml
2025-07-28 11:37:04 +02:00
dae1879dbb helm database cassandra
- update values.yaml for cassandra
- update Chart.yaml for cassandra
2025-07-28 11:37:04 +02:00
d800579673 helm hlaeja device registry
- update actuator.http
- update helmfile.yaml
- add 04-service.yaml
- add 03-deployment.yaml
- add 02-configmap.yaml
- add 01-secret.yaml
- update 01 secret values.yaml with jwt
- add values.yaml
- add Chart.yaml
2025-07-28 11:37:04 +02:00
6c906ec522 helm hlaeja account registry
- update actuator.http
- update helmfile.yaml
- add 04-service.yaml
- add 03-deployment.yaml
- add 02-configmap.yaml
- add 01-secret.yaml
- update 01 secret values.yaml with jwt
- add values.yaml
- add Chart.yaml
2025-07-28 11:37:04 +02:00
1d0346d5e2 helm database postgresql
- add Chart.lock to .gitignore
- update helmfile.yaml with database
- add values.yaml with postgresql
- add Chart.yaml with postgresql
2025-07-28 11:37:04 +02:00
cecdb1a627 helm secrets
- add docker registry config
   - update values.yaml with values from 03-keystore.yaml
   - add 03-keystore.yaml
- add docker registry config
   - update values.yaml with values from 02-json-web-token.yaml
   - add 02-json-web-token.yaml
- add docker registry config
   - update values.yaml with values from 01-docker-registry.yaml
   - add 01-docker-registry.yaml
   - update kube/01-initialize/02-registry-secret.yaml
   - extract docker registry /doc/k8s-testing.md to doc/k8s-docker-registry.md
- add values.yaml
- add Chart.yaml
- add helmfile.yaml
2025-07-28 11:37:04 +02:00
8ead30676a set up helm structure 2025-07-28 11:37:04 +02:00
202c3fdf8a k8s hlaeja registry api 2025-07-25 01:24:24 +02:00
5fa338e576 k8s hlaeja device api 2025-07-25 01:24:24 +02:00
ad0c180bd4 k8s redis 2025-07-25 01:24:24 +02:00
3b8d20896c k8s hlaeja device data 2025-07-25 01:24:24 +02:00
bde856e378 k8s influxdb 2025-07-25 01:24:24 +02:00
1a18ef90e4 k8s hlaeja device configuration 2025-07-25 01:24:24 +02:00
a1038e9afc k8s cassandra 2025-07-25 01:24:24 +02:00
03e9d0a703 k8s hlaeja device registry 2025-07-25 01:24:24 +02:00
203acf6a76 k8s hlaeja account registry 2025-07-25 01:24:24 +02:00
91eef1911f k8s postgres 2025-07-25 01:24:24 +02:00
2d1b25e40e k8s initialize 2025-07-25 01:24:24 +02:00
203150749d add http files 2025-07-25 01:24:24 +02:00
97991f243f Hlæja concept v0.6.0 2025-04-05 13:28:42 +02:00
785095aa80 update dependency.md with missing/planed usages 2025-02-17 10:45:11 +01:00
a4de9872f7 Hlæja concept v0.5.0 2025-02-07 17:50:43 +01:00
e2b0c475fc Hlæja concept v0.4.0 2025-01-21 12:43:46 +01:00
136 changed files with 3401 additions and 33 deletions

4
.gitignore vendored
View File

@@ -1,2 +1,6 @@
.idea/ .idea/
cert/ cert/
http/*/http-client.env.json
helm/values/*/
helm/charts/02-dependency/Chart.lock
helm/helmfile.yaml

View File

@@ -36,6 +36,14 @@ Plugin containing gradle task and setting used by common, library, and service r
Library containing all internal messages for services. GitHub [Hlæja Common Messages](https://github.com/swordsteel/hlaeja-common-messages) Library containing all internal messages for services. GitHub [Hlæja Common Messages](https://github.com/swordsteel/hlaeja-common-messages)
#### JWT
Library containing JWT for services. GitHub [Hlæja JWT](https://github.com/swordsteel/hlaeja-jwt)
#### Test
Library containing test assertion extension and test container annotation. GitHub [Hlæja Test](https://github.com/swordsteel/hlaeja-test)
### Services ### Services
#### Device Data #### Device Data
@@ -56,4 +64,12 @@ Store configurations for electronic devices. GitHub [Hlæja Device Configuration
#### Registry API #### Registry API
Store configurations for electronic devices. GitHub [Hlæja Registry API](https://github.com/swordsteel/hlaeja-registry-api) API for register devices when flashed. GitHub [Hlæja Registry API](https://github.com/swordsteel/hlaeja-registry-api)
#### Account Registry
Store Information of accounts. GitHub [Hlæja Account Registry](https://github.com/swordsteel/hlaeja-account-registry)
#### Management
Management ui. GitHub [Hlæja Account Registry](https://github.com/swordsteel/hlaeja-management)

View File

@@ -15,7 +15,7 @@ volumes:
services: services:
influxdb: influxdb:
image: influxdb:2.7.10-alpine image: influxdb:2.7.12-alpine
container_name: InfluxDB container_name: InfluxDB
restart: unless-stopped restart: unless-stopped
environment: environment:
@@ -34,7 +34,7 @@ services:
- influx-config:/etc/influxdb2 - influx-config:/etc/influxdb2
postgres: postgres:
image: postgres:17.1-alpine image: postgres:17.5-alpine
container_name: PostgreSQL container_name: PostgreSQL
restart: unless-stopped restart: unless-stopped
environment: environment:
@@ -48,7 +48,7 @@ services:
- postgres:/var/lib/postgresql/data - postgres:/var/lib/postgresql/data
cassandra: cassandra:
image: cassandra:5.0.2 image: cassandra:5.0.4
container_name: Cassandra container_name: Cassandra
restart: unless-stopped restart: unless-stopped
environment: environment:
@@ -62,7 +62,7 @@ services:
- cassandra:/var/lib/cassandra - cassandra:/var/lib/cassandra
redis: redis:
image: redis:7.4.1-alpine image: redis:8.0.3-alpine
container_name: Redis container_name: Redis
restart: unless-stopped restart: unless-stopped
environment: environment:

View File

@@ -8,7 +8,7 @@ networks:
services: services:
device-registry: device-registry:
image: hlaeja-device-registry:0.3.0 image: ghcr.io/swordsteel/hlaeja-device-registry:0.6.0
container_name: DeviceRegistry container_name: DeviceRegistry
restart: unless-stopped restart: unless-stopped
environment: environment:
@@ -22,7 +22,7 @@ services:
- ./cert/device_private_key.pem:/app/resources/cert/private_key.pem - ./cert/device_private_key.pem:/app/resources/cert/private_key.pem
device-data: device-data:
image: hlaeja-device-data:0.1.1 image: ghcr.io/swordsteel/hlaeja-device-data:0.2.0
container_name: DeviceData container_name: DeviceData
restart: unless-stopped restart: unless-stopped
environment: environment:
@@ -34,7 +34,7 @@ services:
- 9020:8080 - 9020:8080
device-configuration: device-configuration:
image: hlaeja-device-configuration:0.1.0 image: ghcr.io/swordsteel/hlaeja-device-configuration:0.2.0
container_name: DeviceConfiguration container_name: DeviceConfiguration
restart: unless-stopped restart: unless-stopped
environment: environment:
@@ -45,7 +45,7 @@ services:
- 9030:8080 - 9030:8080
device-api: device-api:
image: hlaeja-device-api:0.3.0 image: ghcr.io/swordsteel/hlaeja-device-api:0.5.0
container_name: DeviceApi container_name: DeviceApi
restart: unless-stopped restart: unless-stopped
environment: environment:
@@ -61,7 +61,7 @@ services:
- ./cert/device_api_keystore.p12:/app/resources/cert/keystore.p12 - ./cert/device_api_keystore.p12:/app/resources/cert/keystore.p12
registry-api: registry-api:
image: hlaeja-registry-api:0.1.0 image: ghcr.io/swordsteel/hlaeja-registry-api:0.3.0
container_name: RegistryApi container_name: RegistryApi
restart: unless-stopped restart: unless-stopped
environment: environment:
@@ -71,6 +71,35 @@ services:
- develop - develop
ports: ports:
- 9040:8443 - 9040:8443
# mount a local `registry_api_keystore.p12` into the container. # mount a local `account_public_key.pem` and `registry_api_keystore.p12` into the container.
volumes: volumes:
- ./cert/registry_api_keystore.p12:/app/resources/cert/keystore.p12 - ./cert/registry_api_keystore.p12:/app/resources/cert/keystore.p12
- ./cert/account_public_key.pem:/app/resources/cert/public_key.pem
account-registry:
image: ghcr.io/swordsteel/hlaeja-account-registry:0.3.0
container_name: AccountRegistry
restart: unless-stopped
environment:
SPRING_PROFILES_ACTIVE: docker
networks:
- develop
ports:
- 9050:8080
# mount a local `account_private_key.pem` into the container.
volumes:
- ./cert/account_private_key.pem:/app/resources/cert/private_key.pem
management:
image: ghcr.io/swordsteel/hlaeja-management:0.3.0
container_name: Management
restart: unless-stopped
environment:
SPRING_PROFILES_ACTIVE: docker
networks:
- develop
ports:
- 9060:8080
# mount a local `account_public_key.pem` into the container.
volumes:
- ./cert/account_public_key.pem:/app/resources/cert/public_key.pem

View File

@@ -1,10 +1,43 @@
# Hlæja dependency # Hlæja dependency
## Build Release Order
*need to make pipeline for this.*
Level 1
- hlaeja-version-catalog
Level 2
- hlaeja-core-plugin
Level 3
- hlaeja-common-plugin
Level 4
- hlaeja-common-messages
- hlaeja-jwt
- test-library
Level 5
- hlaeja-account-registry
- hlaeja-device-registry
- hlaeja-device-configuration
- hlaeja-device-data
- hlaeja-device-api
- hlaeja-registry-api
- hlaeja-management
## Service dependency ## Service dependency
```mermaid ```mermaid
graph TD graph TD
; ;
subgraph BE[Backend Services] subgraph BE[Backend Services]
subgraph HDR[Hlæja Device Registry] subgraph HDR[Hlæja Device Registry]
HDRS[Service] --> HDRD[(Postgres)] HDRS[Service] --> HDRD[(Postgres)]
@@ -20,23 +53,26 @@ graph TD
end end
end end
subgraph HDA[Hlæja Device API] subgraph HDA[Hlæja Device API]
HDAS[Service] --> HDAD[(Redis)] HDAS[Service] --> HDAR[(Redis)]
end end
subgraph HRA[Hlæja Registry API] subgraph HRA[Hlæja Registry API]
HRAS[Service] HRAS[Service]
end end
subgraph HM[Hlæja Management] subgraph HM[Hlæja Management]
HMS[Service] HMS[Service] -.-> HMR[(Redis)]
end end
HM --> HAR
HM --> HDR
HM -.-> HDC
HRA --> HAR
HRA --> HDR
HDA --> HDR HDA --> HDR
HDA --> HDC HDA --> HDC
HDA --> HDD HDA --> HDD
HRA --> HDR
HRA -.-> HAR
HM -.-> HDC
HM -.-> HDR
HM -.-> HAR
``` ```
## Library and Gradle plugin dependency ## Library and Gradle plugin dependency
@@ -44,6 +80,7 @@ graph TD
```mermaid ```mermaid
graph RL graph RL
; ;
CP[Core Plugin] CP[Core Plugin]
subgraph SCP [Common Plugin] subgraph SCP [Common Plugin]
PL[Plugin Library] PL[Plugin Library]
@@ -52,48 +89,72 @@ graph RL
PCo[Plugin Common] PCo[Plugin Common]
PCoD[Plugin Common Detekt] PCoD[Plugin Common Detekt]
PCoK[Plugin Common Ktlint] PCoK[Plugin Common Ktlint]
PCe[Plugin Certificate]
PS[Plugin Service] PS[Plugin Service]
PSC[Plugin Service Container] PSC[Plugin Service Container]
PSIT[Plugin Service Integration Test] PSIT[Plugin Service Integration Test]
PSPR[Plugin Service Process Resource] PSPR[Plugin Service Process Resource]
PCe[Plugin Certificate]
end end
PCo --> PL
PLM --> PL PLM --> PL
PLP --> PL PLP --> PL
CP --> PCo PCo ---> PL
PCoD --> PCo PCoD --> PCo
CP ---> PCo
PCoK --> PCo PCoK --> PCo
PCo --> PS PCo ---> PS
PSC --> PS PSC --> PS
PSIT --> PS PSIT --> PS
PSPR --> PS PSPR --> PS
CML[Common Messages Library] CML[Common Messages Library]
PL --> CML PL --> CML
JL[JWT Library]
PL --> JL
TL[Test Library]
PL --> TL
DRS[Device Registry Service] DRS[Device Registry Service]
CML --> DRS
PS --> DRS PS --> DRS
PCe --> DRS PCe --> DRS
TL -.-> DRS
CML --> DRS
JL --> DRS
DDS[Device Data Service] DDS[Device Data Service]
CML --> DDS
PS --> DDS PS --> DDS
TL -.-> DDS
CML --> DDS
DCS[Device Configuration Service] DCS[Device Configuration Service]
CML --> DCS TL -.-> DCS
PS --> DCS PS --> DCS
CML --> DCS
AS[Account Service]
TL --> AS
CML --> AS
PS --> AS
PCe --> AS
JL --> AS
DAS[Device API Service] DAS[Device API Service]
CML --> DAS
PS --> DAS PS --> DAS
CML --> DAS
JL --> DAS
PCe --> DAS PCe --> DAS
RAS[Registry API Service] RAS[Registry API Service]
CML --> RAS CML --> RAS
JL --> RAS
PS --> RAS PS --> RAS
PCe --> RAS PCe --> RAS
AS[Account Service]
CML -.-> AS
PS -.-> AS
PCe -.-> AS
MUS[Management UI Service] MUS[Management UI Service]
CML -.-> MUS CML --> MUS
PS -.-> MUS JL --> MUS
PS --> MUS
PCe -.-> MUS PCe -.-> MUS
``` ```

View File

@@ -23,7 +23,7 @@ PostgreSQL is a powerful, open-source relational database management system (RDB
```text ```text
POSTGRES_USER: postgres POSTGRES_USER: postgres
POSTGRES_PASSWORD : password POSTGRES_PASSWORD: password
``` ```
## Apache Cassandra ## Apache Cassandra

View File

@@ -67,9 +67,50 @@ SPRING_PROFILES_ACTIVE: docker
### Volume ### Volume
Mount a local public key into the container. Read [rsa_key.md](./rsa_key.md) for how to generate.
Mount a local keystore into the container. Read [keystore.md](./keystore.md) for how to generate. Mount a local keystore into the container. Read [keystore.md](./keystore.md) for how to generate.
```text ```text
volumes: volumes:
- ./cert/account_public_key.pem:/app/resources/cert/public_key.pem
- ./cert/registry_api_keystore.p12:/app/resources/cert/keystore.p12 - ./cert/registry_api_keystore.p12:/app/resources/cert/keystore.p12
``` ```
## Account Registry
### Environment
```text
SPRING_R2DBC_URL: r2dbc:postgresql://localhost:5432/account_registry
SPRING_R2DBC_USERBAME: services
SPRING_R2DBC_PASSWORD: password
JWT_PRIVATE_KEY: cert/private_key.pem
```
### Volume
Mount a local private key into the container. Read [`rsa_key.md`](./rsa_key.md) for how to generate.
```text
volumes:
- ./cert/account_private_key.pem:/app/resources/cert/private_key.pem
```
## Management
### Environment
```text
SPRING_PROFILES_ACTIVE: docker
```
### Volume
Mount a local public key into the container. Read [rsa_key.md](./rsa_key.md) for how to generate.
```text
volumes:
- ./cert/account_public_key.pem:/app/resources/cert/public_key.pem
```

View File

@@ -0,0 +1,37 @@
# K8s Docker Registry Configuration
**How to make JSON Configuration**
```json=
{
"auths": {
"<your-registry>": {
"username": "<your-username>",
"password": "<your-password>",
"email": "<your-email@example.com>",
"auth": "<base64-of-your-username:your-password>"
}
}
}
```
**Replace Values**
- **Replace** <your-registry>: Use the hostname of your Gitea instance (e.g., registry.example.com).
- **Replace** <your-username>: Use your Gitea username (e.g., user1).
- **Replace** <your-password>: Use your Gitea personal access token generated with read:package scope (e.g., abc123).
- **Replace** <your-email>: Use your email address (e.g., user1@example.com).
**Linux Command**
```bash
echo -n 'your-username:your-password' | base64 -w 0
```
witch gives `eW91ci11c2VybmFtZTp5b3VyLXBhc3N3b3Jk` then we use it in the `auth`
```bash
echo -n '{"auths":{"<your-registry>":{"username":"your-username","password":"your-password","email":"your-email","auth":"eW91ci11c2VybmFtZTp5b3VyLXBhc3N3b3Jk"}}}' | base64 -w 0
```
witch give `eyJhdXRocyI6eyI8eW91ci1yZWdpc3RyeT4iOnsidXNlcm5hbWUiOiJ5b3VyLXVzZXJuYW1lIiwicGFzc3dvcmQiOiJ5b3VyLXBhc3N3b3JkIiwiZW1haWwiOiJ5b3VyLWVtYWlsIiwiYXV0aCI6ImVXOTFjaTExYzJWeWJtRnRaVHA1YjNWeUxYQmhjM04zYjNKayJ9fX0=`

583
doc/k8s-testing.md Normal file
View File

@@ -0,0 +1,583 @@
# Hlæja K8s
## Table of Contents
<!-- TOC -->
* [Hlæja K8s](#hlæja-k8s)
* [Table of Contents](#table-of-contents)
* [Initialize](#initialize)
* [Namespace](#namespace)
* [Registry Secret](#registry-secret)
* [JSON Web Token (JWT)](#json-web-token-jwt)
* [Keystore](#keystore)
* [Databases](#databases)
* [Postgres](#postgres)
* [Secret](#secret)
* [Config Map](#config-map)
* [Stateful Set](#stateful-set)
* [Service](#service)
* [Cassandra](#cassandra)
* [Stateful Set](#stateful-set-1)
* [Service](#service-1)
* [InfluxDb](#influxdb)
* [Secret](#secret-1)
* [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-4)
* [Device Register](#device-register)
* [Secret](#secret-3)
* [Config Map](#config-map-3)
* [Deployment](#deployment-1)
* [Service](#service-5)
* [Device Configuration](#device-configuration)
* [Secret](#secret-4)
* [Config Map](#config-map-4)
* [Deployment](#deployment-2)
* [Service](#service-6)
* [Device Data](#device-data)
* [Secret](#secret-5)
* [Config Map](#config-map-5)
* [Deployment](#deployment-3)
* [Service](#service-7)
* [Device API](#device-api)
* [Config Map](#config-map-6)
* [Deployment](#deployment-4)
* [Service](#service-8)
* [Registry API](#registry-api)
* [Config Map](#config-map-7)
* [Deployment](#deployment-5)
* [Service](#service-9)
<!-- TOC -->
----
## Initialize
### Namespace
Create the Namespace for the environment.
```bash
kubectl apply -f .\kube\01-initialize\01-namespace.yaml
```
---
### Registry Secret
Create [Docker Registry Configuration](./k8s-docker-registry.md) secret.
```bash
kubectl apply -f .\kube\01-initialize\02-registry-secret.yaml
```
---
### JSON Web Token (JWT)
For JWT we are using public and private keys, read more about [RSA keys](./rsa_key.md).
Account private key for account service to make access token.
```bash
kubectl apply -f .\kube\01-initialize\03-account-jwt-private-key-secret.yaml
```
Account public key for all services identifying users
```bash
kubectl apply -f .\kube\01-initialize\04-account-jwt-public-key-secret.yaml
```
Device private key for device service to make device token.
```bash
kubectl apply -f .\kube\01-initialize\05-device-jwt-private-key-secret.yaml
```
Device public key for all services identifying devices
```bash
kubectl apply -f .\kube\01-initialize\06-device-jwt-public-key-secret.yaml
```
---
### Keystore
Keystore with password read more about [Keystore.p12](./keystore.md).
check cert:
```
keytool -list -v -storetype PKCS12 -keystore keystore.p12 -storepass <password>
```
option:
```
kubectl create secret generic <name> \
--from-file=keystore.p12=<keystore.p12> \
--from-literal=keystore-password=<your-keystore-password> \
-n <namespace>
```
Device API Keystore
```bash
kubectl apply -f .\kube\01-initialize\07-device-api-keystore.yaml
```
Registry API Keystore
```bash
kubectl apply -f .\kube\01-initialize\08-register-api-keystore.yaml
```
---
## Databases
### Postgres
Remember that you don't run replicas but many instances with its own storage and service.
#### Secret
```bash
kubectl apply -f .\kube\02-databases\01-postgres\01-secret.yaml
```
Set values:
- postgres root password
using something a bit more secure `SCRAM-SHA-256$4096:f/IWlCTGdMT9qOjQlPbWtA==$qePy5ArW+7ykg3yHqW7qYH0j2384OIoV2IcBcz0mIRM=:KuU1xgnAVtOVpCZhdUJlI8F7Viz0ApmYxYEo5yXNCW0=` in this case we use `password`, to make this... use postgres to make a user and password, copy this value and now will use as admin password.
#### Config Map
```bash
kubectl apply -f .\kube\02-databases\01-postgres\02-configmap.yaml
```
Set values:
- postgres root user
#### Stateful Set
This is the specifications for postgres.
```bash
kubectl apply -f .\kube\02-databases\01-postgres\03-statefulset.yaml
```
Set storage size for permanent storage
#### Service
this exposes port and ip.
```bash
kubectl apply -f .\kube\02-databases\01-postgres\04-service.yaml
```
---
### Cassandra
For now... run basic cassandra, we need to add authentication later.
to get a clean cassandra configuration:
```bash
docker run --rm cassandra:5.0 cat /etc/cassandra/cassandra.yaml > cassandra-default.yaml
```
modify `authenticator` and `authorizer` and som how get that change inside... local file get to big 262144 bytes limitation.
some help things for later
```bashe
kubectl exec -it -n hlaeja cassandra-0 -- bash
```
run one of this
```bash
nodetool status
```
or
```bash
cqlsh
SELECT data_center FROM system.local;
```
#### Stateful Set
This is the specifications for cassandra.
```bash
kubectl apply -f .\kube\02-databases\02-cassandra\01-statefulset.yaml
```
Set storage size for permanent storage
#### Service
this exposes port and ip.
```bash
kubectl apply -f .\kube\02-databases\02-cassandra\02-service.yaml
```
---
### InfluxDb
#### Secret
```bash
kubectl apply -f .\kube\02-databases\03-influxdb\01-secret.yaml
```
Set values:
- influx root password
- influx token
using something a bit more secure `SCRAM-SHA-256$4096:f/IWlCTGdMT9qOjQlPbWtA==$qePy5ArW+7ykg3yHqW7qYH0j2384OIoV2IcBcz0mIRM=:KuU1xgnAVtOVpCZhdUJlI8F7Viz0ApmYxYEo5yXNCW0=` in this case we use `password`, to make this... use postgres to make a user and password, copy this value and now will use as admin password.
#### Config Map
```bash
kubectl apply -f .\kube\02-databases\03-influxdb\02-configmap.yaml
```
Set values:
- influx root username
- influx mode
- influx organisation
- influx bucket
#### Stateful Set
This is the specifications for influxdb.
```bash
kubectl apply -f .\kube\02-databases\03-infulxdb\03-statefulset.yaml
```
Set storage size for permanent storage
#### Service
this exposes port and ip.
```bash
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`
To tail a service log use `kubectl logs -f <pod-name> -n hlaeja`
### Account Register
This is only a ***concept*** and exist for testing rest of system. this need to be ***rewritten***.
#### Secret
```bash
kubectl apply -f .\kube\03-hlaeja\01-account-registry\01-secret.yaml
```
Set values:
- postgres password
#### Config Map
```bash
kubectl apply -f .\kube\03-hlaeja\01-account-registry\02-configmap.yaml
```
Set values:
- spring profile
- postgres username
- postgres url
- account private jwt file location
#### Deployment
Account Registry Service, using `account-jwt-private-key`
```bash
kubectl apply -f .\kube\03-hlaeja\01-account-registry\03-deployment.yaml
```
#### Service
this service should not be accessible from world only open in testing
```bash
kubectl apply -f .\kube\03-hlaeja\01-account-registry\04-service.yaml
```
---
### Device Register
#### Secret
```bash
kubectl apply -f .\kube\03-hlaeja\02-device-registry\01-secret.yaml
```
Set values:
- postgres password
#### Config Map
```bash
kubectl apply -f .\kube\03-hlaeja\02-device-registry\02-configmap.yaml
```
Set values:
- spring profile
- postgres username
- postgres url
- device private jwt file location
#### Deployment
Account Registry Service, using `account-jwt-private-key`
```bash
kubectl apply -f .\kube\03-hlaeja\02-device-registry\03-deployment.yaml
```
#### Service
this service should not be accessible from world only open in testing
```bash
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
```
---
### Device Data
#### Secret
```bash
kubectl apply -f .\kube\03-hlaeja\04-device-data\01-secret.yaml
```
Set values:
- influxdb token
#### Config Map
```bash
kubectl apply -f .\kube\03-hlaeja\04-device-data\02-configmap.yaml
```
Set values:
- spring profile
- influxdb url
#### Deployment
```bash
kubectl apply -f .\kube\03-hlaeja\04-device-data\03-deployment.yaml
```
#### Service
this service should not be accessible from world only open in testing
```bash
kubectl apply -f .\kube\03-hlaeja\04-device-data\04-service.yaml
```
---
### Device API
#### Config Map
```bash
kubectl apply -f .\kube\03-hlaeja\05-device-api\01-configmap.yaml
```
Set values:
- spring profile
- spring data redis database
- spring data redis host
- device configuration url
- device data url
- device register url
#### Deployment
```bash
kubectl apply -f .\kube\03-hlaeja\05-device-api\02-deployment.yaml
```
#### Service
this service should not be accessible from world only open in testing
```bash
kubectl apply -f .\kube\03-hlaeja\05-device-api\03-service.yaml
```
---
### Registry API
#### Config Map
```bash
kubectl apply -f .\kube\03-hlaeja\06-registry-api\01-configmap.yaml
```
Set values:
- spring profile
- device register url
- registry register url
#### Deployment
```bash
kubectl apply -f .\kube\03-hlaeja\06-registry-api\02-deployment.yaml
```
#### Service
this service should not be accessible from world only open in testing
```bash
kubectl apply -f .\kube\03-hlaeja\06-registry-api\03-service.yaml
```
---
# Management
#### Config Map
```bash
kubectl apply -f .\kube\03-hlaeja\07-management\01-configmap.yaml
```
Set values:
- spring profile
- spring data redis database
- spring data redis host
- device register url
- registry register url
#### Deployment
```bash
kubectl apply -f .\kube\03-hlaeja\07-management\02-deployment.yaml
```
#### Service
this service should not be accessible from world only open in testing
```bash
kubectl apply -f .\kube\03-hlaeja\07-management\03-service.yaml
```

23
helm/.helmignore Normal file
View File

@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/

49
helm/README.md Normal file
View File

@@ -0,0 +1,49 @@
# Hlæja Helm
Copy `helmfile.yaml-dev` to `helmfile.yaml` and start to add your environment.
## Set up helm environment
how to set up [Enviorment](./values/README.md)
## Command using kubectl and helmfile
> ⚠️**Warning:** always use `--selector namespace=<releasesEnviorment>` when running `helmfile` or **risk** lose it all!!! ⚠️
> **Info:** limit even more by using `--selector namespace=<releasesEnviorment>,name=<releasesName>`
**Info:** Create everything for a name space
```shell
helmfile --selector namespace=testing apply
```
⚠️**Warning:** Destroy everything for a name space
```shell
helmfile --selector namespace=testing destroy
```
**Info:** Create initialize for a name space
```shell
helmfile --selector namespace=testing,name=initialize apply
```
⚠️**Warning:** Destroy initialize for a name space
```shell
helmfile --selector namespace=testing,name=initialize destroy
```
**Info:** Get status
```shell
kubectl get secret,cm,pvc,pod,svc -n testing
```
⚠️**Warning:** Delete everything!
```shell
kubectl delete ns testing
```

View File

@@ -0,0 +1,5 @@
# Chart.yaml
apiVersion: v2
name: hlaeja-secret
description: A Helm chart for the hlaeja docker register, jwt, and keystore
version: 0.1.0

View File

@@ -0,0 +1,13 @@
{{- range .Values.secrets.dockerRegistry }}
apiVersion: v1
kind: Secret
metadata:
name: {{ .name }}
namespace: {{ $.Values.namespace }}
labels:
environment: {{ $.Values.environment }}
type: kubernetes.io/dockerconfigjson
data:
.dockerconfigjson: {{ .dockerRegistryConfigJson | quote }}
---
{{- end }}

View File

@@ -0,0 +1,15 @@
{{- range .Values.secrets.jwt }}
apiVersion: v1
kind: Secret
metadata:
name: {{ .name }}
namespace: {{ $.Values.namespace }}
labels:
app: {{ .app }}
environment: {{ $.Values.environment }}
tier: {{ .tier }}
type: Opaque
data:
{{ .jwtFilename }}: {{ .jwtFile | quote }}
---
{{- end }}

View File

@@ -0,0 +1,16 @@
{{- range .Values.secrets.keystore }}
apiVersion: v1
kind: Secret
metadata:
name: {{ .name }}
namespace: {{ $.Values.namespace }}
labels:
app: {{ .app }}
environment: {{ $.Values.environment }}
tier: {{ .tier }}
type: Opaque
data:
keystore.p12: {{ .keystoreFile | quote }}
keystore-password: {{ .keystorePassword | b64enc | quote }}
---
{{- end }}

View File

@@ -0,0 +1,46 @@
namespace: hlaeja-testing
environment: testing
secrets:
# Look at /doc/k8s-docker-registry.md to make these values
dockerRegistry:
# - name: dockerRegistry
# dockerRegistryConfigJson: DockerRegistryBase64==
# Look at /doc/rsa_key.md to make these values (we use rsa so and need a public and privet key)
jwt:
# - name: account-jwt-private-key
# app: account-register
# tier: backend
# jwtFilename: private_key.pem
# jwtFile: AccountJwtPrivateKeyFileBase64==
# - name: account-jwt-public-key
# app: account-register
# tier: frontend
# jwtFilename: private_key.pem
# jwtFile: AccountJwtPublicKeyFileBase64==
# - name: device-jwt-private-key
# app: device-register
# tier: backend
# jwtFilename: private_key.pem
# jwtFile: DeviceJwtPrivateKeyFileBase64==
# - name: device-jwt-public-key
# app: device-register
# tier: frontend
# jwtFilename: private_key.pem
# jwtFile: DeviceJwtPublicKeyFileBase64==
# Look at /doc/keystore.md to make these values
keystore:
# - name: device-api-keystore
# app: device-api
# tier: frontend
# keystorePassword: ServiceKeystorePassword
# keystoreFile: ServiceKeystoreFileBase64==
# - name: registry-api-keystore
# app: registry-api
# tier: frontend
# keystorePassword: ServiceKeystorePassword
# keystoreFile: ServiceKeystoreFileBase64==

View File

@@ -0,0 +1,26 @@
apiVersion: v2
name: hlaeja-dependency
description: A Helm chart for the hlaeja dependency chart wrapper
version: 0.1.0
dependencies:
# https://artifacthub.io/packages/helm/bitnami/postgresql
- name: postgresql
version: 16.7.21
repository: "oci://registry-1.docker.io/bitnamicharts"
# https://artifacthub.io/packages/helm/bitnami/cassandra
- name: cassandra
version: 12.3.9
repository: "oci://registry-1.docker.io/bitnamicharts"
# https://artifacthub.io/packages/helm/bitnami/influxdb
- name: influxdb
version: 6.6.16
repository: "oci://registry-1.docker.io/bitnamicharts"
# https://artifacthub.io/packages/helm/bitnami/redis
- name: redis
version: 21.2.13
repository: "oci://registry-1.docker.io/bitnamicharts"

View File

@@ -0,0 +1,76 @@
postgresql:
auth:
postgresPassword: mySecretPassword
primary:
persistence:
size: 10Gi
resources:
requests:
memory: 512Mi
cpu: 250m
# service:
# type: LoadBalancer
# loadBalancerIP: 10.0.3.31
cassandra:
cluster:
name: hlaeja-cassandra
dbUser:
password: mySecretPassword
persistence:
enabled: true
size: 10Gi
resources:
requests:
cpu: 250m
memory: 512Mi
# service:
# type: LoadBalancer
# loadBalancerIP: 10.0.3.32
influxdb:
auth:
admin:
username: influxdb
password: mySecretPassword
token: influxdbAdminToken==
user:
username: service
password: mySecretPassword
token: influxdbServiceToken==
org: hlaeja
bucket: device-data
persistence:
enabled: true
size: 10Gi
resources:
requests:
memory: 512Mi
cpu: 250m
influxdb:
service:
extraPorts:
- name: http-alt
port: 80
targetPort: 8086
protocol: TCP
# type: LoadBalancer
# loadBalancerIP: 10.0.3.33
redis:
architecture: standalone
auth:
enabled: true
password: mySecretPassword
resources:
requests:
cpu: 250m
memory: 256Mi
master:
persistence:
enabled: true
size: 1Gi
# service:
# type: LoadBalancer
# loadBalancerIP: 10.0.3.34

View File

@@ -0,0 +1,4 @@
apiVersion: v2
name: hlaeja-account-registry
description: A Helm chart for the hlaeja account registry
version: 0.1.0

View File

@@ -0,0 +1,11 @@
apiVersion: v1
kind: Secret
metadata:
name: account-register-environment
labels:
app: account-register
environment: {{ .Values.environment }}
tier: backend
type: Opaque
data:
SPRING_R2DBC_PASSWORD: {{ .Values.secrets.r2dbcPassword | b64enc | quote }}

View File

@@ -0,0 +1,13 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: account-register-environment
labels:
app: account-register
environment: {{ .Values.environment }}
tier: backend
data:
SPRING_PROFILES_ACTIVE: {{ .Values.config.profiles | quote }}
SPRING_R2DBC_URL: {{ .Values.config.r2dbcUrl | quote }}
SPRING_R2DBC_USERNAME: {{ .Values.config.r2dbcUsername | quote }}
JWT_PRIVATE_KEY: "cert/{{ .Values.jwtPrivetKey.filename }}"

View File

@@ -0,0 +1,42 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: account-register
labels:
app: account-register
environment: {{ .Values.environment }}
tier: backend
spec:
replicas: {{ .Values.replicas }}
selector:
matchLabels:
app: account-register
template:
metadata:
labels:
app: account-register
spec:
imagePullSecrets:
- name: {{ .Values.docker.registry }}
containers:
- name: account-register-app
image: {{ .Values.docker.image }}
imagePullPolicy: IfNotPresent
envFrom:
- configMapRef:
name: account-register-environment
- secretRef:
name: account-register-environment
volumeMounts:
- name: jwt-key-volume
mountPath: /app/resources/cert
readOnly: true
ports:
- containerPort: 8080
volumes:
- name: jwt-key-volume
secret:
secretName: {{ .Values.jwtPrivetKey.name }}
items:
- key: {{ .Values.jwtPrivetKey.filename }}
path: {{ .Values.jwtPrivetKey.filename }}

View File

@@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
name: account-register
labels:
app: account-register
environment: {{ .Values.environment }}
tier: backend
spec:
{{- if and .Values.loadBalancerIP (ne .Values.loadBalancerIP "") }}
type: LoadBalancer
loadBalancerIP: {{ .Values.loadBalancerIP }}
{{- end }}
selector:
app: account-register
ports:
- protocol: TCP
port: 80
targetPort: 8080

View File

@@ -0,0 +1,19 @@
environment: testing
replicas: 1
#loadBalancerIP: 10.0.3.21
docker:
registry: dockerRegistry
image: lulz.ltd/hlaeja/hlaeja-account-registry:0.1.0
secrets:
r2dbcPassword: "password"
config:
profiles: testing
r2dbcUrl: r2dbc:postgresql://dependency-postgresql:5432/account_registry
r2dbcUsername: services
jwtPrivetKey:
name: account-jwt-private-key
filename: private_key.pem

View File

@@ -0,0 +1,4 @@
apiVersion: v2
name: hlaeja-device-register
description: A Helm chart for the hlaeja device registry
version: 0.1.0

View File

@@ -0,0 +1,11 @@
apiVersion: v1
kind: Secret
metadata:
name: device-register-environment
labels:
app: device-register
environment: {{ .Values.environment }}
tier: backend
type: Opaque
data:
SPRING_R2DBC_PASSWORD: {{ .Values.secrets.r2dbcPassword | b64enc | quote }}

View File

@@ -0,0 +1,13 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: device-register-environment
labels:
app: device-register
environment: {{ .Values.environment }}
tier: backend
data:
SPRING_PROFILES_ACTIVE: {{ .Values.config.profiles | quote }}
SPRING_R2DBC_URL: {{ .Values.config.r2dbcUrl | quote }}
SPRING_R2DBC_USERNAME: {{ .Values.config.r2dbcUsername | quote }}
JWT_PRIVATE_KEY: "cert/{{ .Values.jwtPrivetKey.filename }}"

View File

@@ -0,0 +1,42 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: device-register
labels:
app: device-register
environment: {{ .Values.environment }}
tier: backend
spec:
replicas: {{ .Values.replicas }}
selector:
matchLabels:
app: device-register
template:
metadata:
labels:
app: device-register
spec:
imagePullSecrets:
- name: {{ .Values.docker.registry }}
containers:
- name: device-register-app
image: {{ .Values.docker.image }}
imagePullPolicy: IfNotPresent
envFrom:
- configMapRef:
name: device-register-environment
- secretRef:
name: device-register-environment
volumeMounts:
- name: jwt-key-volume
mountPath: /app/resources/cert
readOnly: true
ports:
- containerPort: 8080
volumes:
- name: jwt-key-volume
secret:
secretName: {{ .Values.jwtPrivetKey.name }}
items:
- key: {{ .Values.jwtPrivetKey.filename }}
path: {{ .Values.jwtPrivetKey.filename }}

View File

@@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
name: device-register
labels:
app: device-register
environment: {{ .Values.environment }}
tier: backend
spec:
{{- if and .Values.loadBalancerIP (ne .Values.loadBalancerIP "") }}
type: LoadBalancer
loadBalancerIP: {{ .Values.loadBalancerIP }}
{{- end }}
selector:
app: device-register
ports:
- protocol: TCP
port: 80
targetPort: 8080

View File

@@ -0,0 +1,19 @@
environment: testing
replicas: 1
#loadBalancerIP: 10.0.3.22
docker:
registry: dockerRegistry
image: lulz.ltd/hlaeja/hlaeja-device-registry:0.1.0
secrets:
r2dbcPassword: "password"
config:
profiles: testing
r2dbcUrl: r2dbc:postgresql://dependency-postgresql:5432/device_registry
r2dbcUsername: services
jwtPrivetKey:
name: device-jwt-private-key
filename: private_key.pem

View File

@@ -0,0 +1,4 @@
apiVersion: v2
name: hlaeja-device-configuration
description: A Helm chart for the hlaeja device configuration
version: 0.1.0

View File

@@ -0,0 +1,11 @@
apiVersion: v1
kind: Secret
metadata:
name: device-configuration-environment
labels:
app: device-configuration
environment: {{ .Values.environment }}
tier: backend
type: Opaque
data:
SPRING_CASSANDRA_PASSWORD: {{ .Values.secrets.cassandraPassword | b64enc | quote }}

View File

@@ -0,0 +1,12 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: device-configuration-environment
labels:
app: device-configuration
environment: {{ .Values.environment }}
tier: backend
data:
SPRING_PROFILES_ACTIVE: {{ .Values.config.profiles | quote }}
SPRING_CASSANDRA_CONTACT_POINTS: {{ .Values.config.cassandraContactPoints | quote }}
SPRING_CASSANDRA_USERNAME: {{ .Values.config.cassandraUsername | quote }}

View File

@@ -0,0 +1,31 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: device-configuration
labels:
app: device-configuration
environment: {{ .Values.environment }}
tier: backend
spec:
replicas: {{ .Values.replicas }}
selector:
matchLabels:
app: device-configuration
template:
metadata:
labels:
app: device-configuration
spec:
imagePullSecrets:
- name: {{ .Values.docker.registry }}
containers:
- name: device-configuration-app
image: {{ .Values.docker.image }}
imagePullPolicy: IfNotPresent
envFrom:
- configMapRef:
name: device-configuration-environment
- secretRef:
name: device-configuration-environment
ports:
- containerPort: 8080

View File

@@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
name: device-configuration
labels:
app: device-configuration
environment: {{ .Values.environment }}
tier: backend
spec:
{{- if and .Values.loadBalancerIP (ne .Values.loadBalancerIP "") }}
type: LoadBalancer
loadBalancerIP: {{ .Values.loadBalancerIP }}
{{- end }}
selector:
app: device-configuration
ports:
- protocol: TCP
port: 80
targetPort: 8080

View File

@@ -0,0 +1,15 @@
environment: testing
replicas: 1
#loadBalancerIP: 10.0.3.23
docker:
registry: dockerRegistry
image: lulz.ltd/hlaeja/hlaeja-device-configuration:0.1.0
secrets:
cassandraPassword: "password"
config:
profiles: testing
cassandraContactPoints: dependency-cassandra
cassandraUsername: service

View File

@@ -0,0 +1,4 @@
apiVersion: v2
name: hlaeja-device-data
description: A Helm chart for the hlaeja device data
version: 0.1.0

View File

@@ -0,0 +1,11 @@
apiVersion: v1
kind: Secret
metadata:
name: device-data-environment
labels:
app: device-data
environment: {{ .Values.environment }}
tier: backend
type: Opaque
data:
INFLUXDB_TOKEN: {{ .Values.secrets.influxdbToken | b64enc | quote }}

View File

@@ -0,0 +1,17 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: device-data-environment
labels:
app: device-data
environment: {{ .Values.environment }}
tier: backend
data:
SPRING_PROFILES_ACTIVE: {{ .Values.config.profiles | quote }}
INFLUXDB_URL: {{ .Values.config.influxdbUrl | quote }}
{{- if and .Values.config.influxdbBucket (ne .Values.config.influxdbBucket "") }}
INFLUXDB_BUCKET: {{ .Values.config.influxdbBucket | quote }}
{{- end }}
{{- if and .Values.config.influxdbOrg (ne .Values.config.influxdbOrg "") }}
INFLUXDB_ORG: {{ .Values.config.influxdbOrg | quote }}
{{- end }}

View File

@@ -0,0 +1,31 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: device-data
labels:
app: device-data
environment: {{ .Values.environment }}
tier: backend
spec:
replicas: {{ .Values.replicas }}
selector:
matchLabels:
app: device-data
template:
metadata:
labels:
app: device-data
spec:
imagePullSecrets:
- name: {{ .Values.docker.registry }}
containers:
- name: device-data-app
image: {{ .Values.docker.image }}
imagePullPolicy: IfNotPresent
envFrom:
- configMapRef:
name: device-data-environment
- secretRef:
name: device-data-environment
ports:
- containerPort: 8080

View File

@@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
name: device-data
labels:
app: device-data
environment: {{ .Values.environment }}
tier: backend
spec:
{{- if and .Values.loadBalancerIP (ne .Values.loadBalancerIP "") }}
type: LoadBalancer
loadBalancerIP: {{ .Values.loadBalancerIP }}
{{- end }}
selector:
app: device-data
ports:
- protocol: TCP
port: 80
targetPort: 8080

View File

@@ -0,0 +1,16 @@
environment: testing
replicas: 1
#loadBalancerIP: 10.0.3.24
docker:
registry: dockerRegistry
image: lulz.ltd/hlaeja/hlaeja-device-data:0.1.0
secrets:
influxdbToken: influxdbToken==
config:
profiles: testing
influxdbUrl: http://dependency-influxdb
# influxdbOrg: hlaeja
# influxdbBucket: hlaeja_ltd

View File

@@ -0,0 +1,4 @@
apiVersion: v2
name: hlaeja-device-api
description: A Helm chart for the hlaeja device api
version: 0.1.0

View File

@@ -0,0 +1,11 @@
apiVersion: v1
kind: Secret
metadata:
name: device-api-environment
labels:
app: device-api
environment: {{ .Values.environment }}
tier: frontend
type: Opaque
data:
SPRING_DATA_REDIS_PASSWORD: {{ .Values.secrets.redisPassword | b64enc | quote }}

View File

@@ -0,0 +1,28 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: device-api-environment
labels:
app: device-api
environment: {{ .Values.environment }}
tier: frontend
data:
SPRING_PROFILES_ACTIVE: {{ .Values.config.profiles | quote }}
SPRING_DATA_REDIS_DATABASE: {{ .Values.config.redis.database | quote }}
SPRING_DATA_REDIS_HOST: {{ .Values.config.redis.host | quote }}
DEVICE_CONFIGURATION_URL: {{ .Values.config.deviceConfigurationUrl | quote }}
DEVICE_DATA_URL: {{ .Values.config.deviceDataUrl | quote }}
DEVICE_REGISTRY_URL: {{ .Values.config.deviceRegistryUrl | quote }}
# all of this should be preset in application.yaml
SERVER_PORT: "8443"
SERVER_SSL_ENABLED: "true"
SERVER_SSL_KEY_STORE: "/app/resources/cert/keystore.p12"
SERVER_SSL_KEY_STORE_TYPE: "PKCS12"
# This was experimental and should be removed in later versions
MANAGEMENT_METRICS_TAGS_APPLICATION: "device-api"
MANAGEMENT_INFLUX_METRICS_EXPORT_ENABLED: "false"
MANAGEMENT_INFLUX_METRICS_EXPORT_URL: "http://influxdb"
# adding this here as it's going to be deleted and is not sued internally
MANAGEMENT_INFLUX_METRICS_EXPORT_TOKEN: "invalidInfluxDbToken=="

View File

@@ -0,0 +1,59 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: device-api
labels:
app: device-api
environment: {{ .Values.environment }}
tier: frontend
spec:
replicas: {{ .Values.replicas }}
selector:
matchLabels:
app: device-api
template:
metadata:
labels:
app: device-api
spec:
imagePullSecrets:
- name: {{ .Values.docker.registry }}
containers:
- name: device-api-app
image: {{ .Values.docker.image }}
imagePullPolicy: IfNotPresent
envFrom:
- configMapRef:
name: device-api-environment
- secretRef:
name: device-api-environment
env:
- name: SERVER_SSL_KEY_STORE_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Values.keystoreRef }}
key: keystore-password
ports:
- containerPort: 8443
volumeMounts:
- name: keystore-volume
mountPath: /app/resources/cert/keystore.p12
subPath: keystore.p12
readOnly: true
- name: jwt-volume
mountPath: /app/resources/cert/{{ .Values.jwtPublicKey.filename }}
subPath: {{ .Values.jwtPublicKey.filename }}
readOnly: true
volumes:
- name: keystore-volume
secret:
secretName: {{ .Values.keystoreRef }}
items:
- key: keystore.p12
path: keystore.p12
- name: jwt-volume
secret:
secretName: {{ .Values.jwtPublicKey.name }}
items:
- key: {{ .Values.jwtPublicKey.filename }}
path: {{ .Values.jwtPublicKey.filename }}

View File

@@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
name: device-api
labels:
app: device-api
environment: {{ .Values.environment }}
tier: frontend
spec:
{{- if and .Values.loadBalancerIP (ne .Values.loadBalancerIP "") }}
type: LoadBalancer
loadBalancerIP: {{ .Values.loadBalancerIP }}
{{- end }}
selector:
app: device-api
ports:
- protocol: TCP
port: 443
targetPort: 8443

View File

@@ -0,0 +1,26 @@
environment: testing
replicas: 1
#loadBalancerIP: 10.0.3.12
docker:
registry: dockerRegistry
image: lulz.ltd/hlaeja/hlaeja-device-api:0.1.0
secrets:
redisPassword: redisPassword
config:
profiles: testing
redis:
database: 1
host: dependency-redis-master
deviceConfigurationUrl: http://device-configuration
deviceDataUrl: http://device-data
deviceRegistryUrl: http://device-register
jwtPublicKey:
name: device-jwt-public-key
filename: public_key.pem
keystoreRef: device-api-keystore

View File

@@ -0,0 +1,4 @@
apiVersion: v2
name: hlaeja-registry-api
description: A Helm chart for the hlaeja registry api
version: 0.1.0

View File

@@ -0,0 +1,25 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: registry-api-environment
labels:
app: registry-api
environment: {{ .Values.environment }}
tier: frontend
data:
SPRING_PROFILES_ACTIVE: {{ .Values.config.profiles | quote }}
ACCOUNT_REGISTRY_URL: {{ .Values.config.accountRegistryUrl | quote }}
DEVICE_REGISTRY_URL: {{ .Values.config.deviceRegistryUrl | quote }}
# all of this should be preset in application.yaml
SERVER_PORT: "8443"
SERVER_SSL_ENABLED: "true"
SERVER_SSL_KEY_STORE: "/app/resources/cert/keystore.p12"
SERVER_SSL_KEY_STORE_TYPE: "PKCS12"
# This was experimental and should be removed in later versions
MANAGEMENT_METRICS_TAGS_APPLICATION: "register-api"
MANAGEMENT_INFLUX_METRICS_EXPORT_ENABLED: "false"
MANAGEMENT_INFLUX_METRICS_EXPORT_URL: "http://influxdb"
# adding this here as it's going to be deleted and is not sued internally
MANAGEMENT_INFLUX_METRICS_EXPORT_TOKEN: "invalidInfluxDbToken=="

View File

@@ -0,0 +1,57 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: registry-api
labels:
app: registry-api
environment: {{ .Values.environment }}
tier: frontend
spec:
replicas: {{ .Values.replicas }}
selector:
matchLabels:
app: registry-api
template:
metadata:
labels:
app: registry-api
spec:
imagePullSecrets:
- name: {{ .Values.docker.registry }}
containers:
- name: registry-api-app
image: {{ .Values.docker.image }}
imagePullPolicy: IfNotPresent
envFrom:
- configMapRef:
name: registry-api-environment
env:
- name: SERVER_SSL_KEY_STORE_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Values.keystoreRef }}
key: keystore-password
ports:
- containerPort: 8443
volumeMounts:
- name: keystore-volume
mountPath: /app/resources/cert/keystore.p12
subPath: keystore.p12
readOnly: true
- name: jwt-volume
mountPath: /app/resources/cert/{{ .Values.jwtPublicKey.filename }}
subPath: {{ .Values.jwtPublicKey.filename }}
readOnly: true
volumes:
- name: keystore-volume
secret:
secretName: {{ .Values.keystoreRef }}
items:
- key: keystore.p12
path: keystore.p12
- name: jwt-volume
secret:
secretName: {{ .Values.jwtPublicKey.name }}
items:
- key: {{ .Values.jwtPublicKey.filename }}
path: {{ .Values.jwtPublicKey.filename }}

View File

@@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
name: registry-api
labels:
app: registry-api
environment: {{ .Values.environment }}
tier: frontend
spec:
{{- if and .Values.loadBalancerIP (ne .Values.loadBalancerIP "") }}
type: LoadBalancer
loadBalancerIP: {{ .Values.loadBalancerIP }}
{{- end }}
selector:
app: registry-api
ports:
- protocol: TCP
port: 443
targetPort: 8443

View File

@@ -0,0 +1,18 @@
environment: testing
replicas: 1
#loadBalancerIP: 10.0.3.13
docker:
registry: dockerRegistry
image: lulz.ltd/hlaeja/hlaeja-registry-api:0.1.0
config:
profiles: testing
accountRegistryUrl: http://account-register
deviceRegistryUrl: http://device-register
jwtPublicKey:
name: account-jwt-public-key
filename: public_key.pem
keystoreRef: registry-api-keystore

View File

@@ -0,0 +1,4 @@
apiVersion: v2
name: hlaeja-management
description: A Helm chart for the hlaeja management
version: 0.1.0

View File

@@ -0,0 +1,11 @@
apiVersion: v1
kind: Secret
metadata:
name: management-environment
labels:
app: management
environment: {{ .Values.environment }}
tier: frontend
type: Opaque
data:
SPRING_DATA_REDIS_PASSWORD: {{ .Values.secrets.redisPassword | b64enc | quote }}

View File

@@ -0,0 +1,14 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: management-environment
labels:
app: management
environment: {{ .Values.environment }}
tier: frontend
data:
SPRING_PROFILES_ACTIVE: {{ .Values.config.profiles | quote }}
SPRING_DATA_REDIS_DATABASE: {{ .Values.config.redis.database | quote }}
SPRING_DATA_REDIS_HOST: {{ .Values.config.redis.host | quote }}
ACCOUNT_REGISTRY_URL: {{ .Values.config.accountRegistryUrl | quote }}
DEVICE_REGISTRY_URL: {{ .Values.config.deviceRegistryUrl | quote }}

View File

@@ -0,0 +1,43 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: management
labels:
app: management
environment: {{ .Values.environment }}
tier: frontend
spec:
replicas: {{ .Values.replicas }}
selector:
matchLabels:
app: management
template:
metadata:
labels:
app: management
spec:
imagePullSecrets:
- name: {{ .Values.docker.registry }}
containers:
- name: management-app
image: {{ .Values.docker.image }}
imagePullPolicy: IfNotPresent
envFrom:
- configMapRef:
name: management-environment
- secretRef:
name: management-environment
ports:
- containerPort: 8080
volumeMounts:
- name: jwt-volume
mountPath: /app/resources/cert/{{ .Values.jwtPublicKey.filename }}
subPath: {{ .Values.jwtPublicKey.filename }}
readOnly: true
volumes:
- name: jwt-volume
secret:
secretName: {{ .Values.jwtPublicKey.name }}
items:
- key: {{ .Values.jwtPublicKey.filename }}
path: {{ .Values.jwtPublicKey.filename }}

View File

@@ -0,0 +1,19 @@
apiVersion: v1
kind: Service
metadata:
name: management
labels:
app: management
environment: {{ .Values.environment }}
tier: frontend
spec:
{{- if and .Values.loadBalancerIP (ne .Values.loadBalancerIP "") }}
type: LoadBalancer
loadBalancerIP: {{ .Values.loadBalancerIP }}
{{- end }}
selector:
app: management
ports:
- protocol: TCP
port: 80
targetPort: 8080

View File

@@ -0,0 +1,22 @@
environment: testing
replicas: 1
#loadBalancerIP: 10.0.3.11
docker:
registry: dockerRegistry
image: lulz.ltd/hlaeja/hlaeja-management:0.1.0
secrets:
redisPassword: redisPassword
config:
profiles: testing
redis:
database: 2
host: dependency-redis-master
accountRegistryUrl: http://account-register
deviceRegistryUrl: http://device-register
jwtPublicKey:
name: account-jwt-public-key
filename: public_key.pem

54
helm/helmfile.yaml-dev Normal file
View File

@@ -0,0 +1,54 @@
releases:
- name: secrets
namespace: hlaeja-testing
chart: ./charts/01-secrets
values: []
historyMax: 3
- name: dependency
namespace: hlaeja-testing
chart: ./charts/02-dependency
values: []
historyMax: 3
- name: account-register
namespace: hlaeja-testing
chart: ./charts/03-account-registry
values: []
historyMax: 3
- name: device-registry
namespace: hlaeja-testing
chart: ./charts/04-device-registry
values: []
historyMax: 3
- name: device-configuration
namespace: hlaeja-testing
chart: ./charts/05-device-configuration
values: []
historyMax: 3
- name: device-data
namespace: hlaeja-testing
chart: ./charts/06-device-data
values: []
historyMax: 3
- name: device-api
namespace: hlaeja-testing
chart: ./charts/07-device-api
values: []
historyMax: 3
- name: registry-api
namespace: hlaeja-testing
chart: ./charts/08-registry-api
values: []
historyMax: 3
- name: management
namespace: hlaeja-testing
chart: ./charts/09-management
values: []
historyMax: 3

39
helm/values/README.md Normal file
View File

@@ -0,0 +1,39 @@
# Hlæja Helm Environment
To make the environment copy `values.yaml` file from `charts/<name>` to `values/<releasesEnviorment>` then change the values you need. or make the file and add the value you like to overwrite.
```
helm/
├── helmfile.yaml
├── values/
│ ├── <releasesEnviorment>/
│ │ ├── <name>.yaml
| │ └── ...
│ └── ...
└── charts/
├── <name>/
│ ├── Chart.yaml
│ ├── values.yaml
│ └── templates/
│ └── <template>.yaml
└── ...
```
Then we need to update `helmfile.yaml` one for each environment.
```
releases:
- name: <releasesName>
namespace: <releasesEnviorment>
chart: ./charts/<name>
values: []
- name: <releasesName>
namespace: <releasesEnviorment>
chart: ./charts/<name>
values: [./values/<environment>/<name>]
- ...
```
> **Info:** using default fake base64 values and not specify custom values can break execution.

View File

@@ -0,0 +1,41 @@
### get user by id
GET {{hostname}}/account-00000000-0000-7000-0000-000000000001
### add user
POST {{hostname}}/account
Content-Type: application/json
{
"username": "user01010101",
"password": "p4ssw0rd",
"enabled": true,
"roles": [
"ROLE_ADMIN",
"ROLE_TEST"
]
}
### update user all information
PUT {{hostname}}/account-00000000-0000-7000-0000-000000000002
Content-Type: application/json
{
"username": "user",
"password": "pass",
"enabled": true,
"roles": [
"ROLE_TEST"
]
}
### update user information
PUT {{hostname}}/account-00000000-0000-7000-0000-000000000002
Content-Type: application/json
{
"username": "user",
"enabled": true,
"roles": [
"ROLE_TEST"
]
}

View File

@@ -0,0 +1,8 @@
### Get accounts
GET {{hostname}}/accounts
### Get accounts by page
GET {{hostname}}/accounts/page-1
### Get accounts by page and size
GET {{hostname}}/accounts/page-1/show-1

View File

@@ -0,0 +1,5 @@
### get actuator
GET {{hostname}}/actuator
### get actuator health
GET {{hostname}}/actuator/health

View File

@@ -0,0 +1,44 @@
### Get admin information
POST {{hostname}}/authenticate
Content-Type: application/json
{
"username": "admin",
"password": "pass"
}
### Get user information
POST {{hostname}}/authenticate
Content-Type: application/json
{
"username": "user",
"password": "pass"
}
### Get bad user
POST {{hostname}}/authenticate
Content-Type: application/json
{
"username": "bad user",
"password": "pass"
}
### Get bad pass
POST {{hostname}}/authenticate
Content-Type: application/json
{
"username": "user",
"password": "bad pass"
}
### Get disabled user
POST {{hostname}}/authenticate
Content-Type: application/json
{
"username": "disabled",
"password": "pass"
}

View File

@@ -0,0 +1,11 @@
{
"development": {
"hostname": "http://localhost:8080"
},
"docker": {
"hostname": "http://localhost:9050"
},
"testing": {
"hostname": "http://10.0.x.x"
}
}

View File

@@ -0,0 +1,5 @@
### get actuator
GET {{hostname}}/actuator
### get actuator health
GET {{hostname}}/actuator/health

View File

@@ -0,0 +1,3 @@
### get configuration
GET {{hostname}}/configuration
Identity: {{identity}}

View File

@@ -0,0 +1,14 @@
{
"development": {
"hostname": "https://localhost:8443",
"identity": "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
},
"docker": {
"hostname": "https://localhost:9000",
"identity": "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
},
"testing": {
"hostname": "https://10.0.x.x",
"identity": "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
}
}

View File

@@ -0,0 +1,23 @@
### get measurement
GET {{hostname}}/measurement
Identity: {{identity}}
### add measurement for all
POST {{hostname}}/measurement
Content-Type: application/json
Identity: {{identity}}
{
"button0": 0,
"button1": 1,
"button2": 0
}
### add measurement for one
POST {{hostname}}/measurement
Content-Type: application/json
Identity: {{identity}}
{
"button0": 1
}

View File

@@ -0,0 +1,5 @@
### get actuator
GET {{hostname}}/actuator
### get actuator health
GET {{hostname}}/actuator/health

View File

@@ -0,0 +1,11 @@
{
"development": {
"hostname": "http://localhost:8080"
},
"docker": {
"hostname": "http://localhost:9030"
},
"testing": {
"hostname": "http://10.0.x.x"
}
}

View File

@@ -0,0 +1,11 @@
###
GET {{hostname}}/node-00000000-0000-7000-0000-000000000001
### add measurement for one
PUT {{hostname}}/node-01983d73-3a1e-792e-b910-5673f366fb3b
Content-Type: application/json
{
"configuration": "test"
}

View File

@@ -0,0 +1,5 @@
### get actuator
GET {{hostname}}/actuator
### get actuator health
GET {{hostname}}/actuator/health

View File

@@ -0,0 +1,11 @@
{
"development": {
"hostname": "http://localhost:8080"
},
"docker": {
"hostname": "http://localhost:9020"
},
"testing": {
"hostname": "http://10.0.x.x"
}
}

View File

@@ -0,0 +1,34 @@
### add measurement for all
POST {{hostname}}/client-00000000-0000-7000-0001-000000000001
Content-Type: application/json
{
"tags": {
"device": "00000000-0000-7000-0002-000000000001",
"node": "00000000-0000-7000-0003-000000000001"
},
"fields": {
"button0": 1,
"button1": 0,
"button2": 1
}
}
### add measurement for one
POST {{hostname}}/client-00000000-0000-7000-0001-000000000001
Content-Type: application/json
{
"tags": {
"device": "00000000-0000-7000-0002-000000000001",
"node": "00000000-0000-7000-0003-000000000001"
},
"fields": {
"button1": 0
}
}
### add measurement
GET {{hostname}}/client-00000000-0000-7000-0001-000000000001/node-00000000-0000-7000-0003-000000000001

View File

@@ -0,0 +1,5 @@
### get actuator
GET {{hostname}}/actuator
### get actuator health
GET {{hostname}}/actuator/health

View File

@@ -0,0 +1,10 @@
### register device for a type
POST {{hostname}}/device
Content-Type: application/json
{
"type": "00000000-0000-0000-0000-000000000000"
}
### register device for a type
GET {{hostname}}/device-00000000-0000-0000-0000-000000000000

View File

@@ -0,0 +1,11 @@
{
"development": {
"hostname": "http://localhost:8080"
},
"docker": {
"hostname": "http://localhost:9050"
},
"testing": {
"hostname": "http://10.0.x.x"
}
}

View File

@@ -0,0 +1,2 @@
### get identity
GET {{hostname}}/identity/device-00000000-0000-0000-0000-000000000001

View File

@@ -0,0 +1,9 @@
### register node for a client and device with name
POST {{hostname}}/node
Content-Type: application/json
{
"client": "00000000-0000-0000-0000-000000000000",
"device": "01983d72-476e-77ab-9b17-5ba7045b15fa",
"name": "my test device"
}

View File

@@ -0,0 +1,20 @@
### add type
POST {{hostname}}/type
Content-Type: application/json
{
"name": "Test Device 001",
"description": "Description of test device."
}
### get type by id
GET {{hostname}}/type-00000000-0000-0000-0000-000000000000
### update type by id
PUT {{hostname}}/type-00000000-0000-0000-0000-000000000000
Content-Type: application/json
{
"name": "Test Device 001",
"description": "Description of test device."
}

View File

@@ -0,0 +1,17 @@
### get all types
GET {{hostname}}/types
### get all types
GET {{hostname}}/types/page-1
### get all types
GET {{hostname}}/types/page-1/show-2
### get all types
GET {{hostname}}/types/filter-{filter}
### get all types
GET {{hostname}}/types/filter-{filter}/page-1
### get all types
GET {{hostname}}/types/filter-{filter}/page-1/show-2

View File

@@ -0,0 +1,5 @@
### get actuator
GET {{hostname}}/actuator
### get actuator health
GET {{hostname}}/actuator/health

View File

@@ -0,0 +1,11 @@
{
"development": {
"hostname": "http://localhost:8080"
},
"docker": {
"hostname": "http://localhost:9060"
},
"testing": {
"hostname": "http://10.0.x.x"
}
}

View File

@@ -0,0 +1,5 @@
### get actuator
GET {{hostname}}/actuator
### get actuator health
GET {{hostname}}/actuator/health

View File

@@ -0,0 +1,8 @@
### account login
POST {{hostname}}/login
Content-Type: application/json
{
"username": "admin",
"password": "pass"
}

View File

@@ -0,0 +1,14 @@
{
"development": {
"hostname": "https://localhost:8443",
"token": "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
},
"docker": {
"hostname": "https://localhost:9040",
"token": "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
},
"testing": {
"hostname": "https://10.0.x.x",
"token": "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ.0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
}
}

View File

@@ -0,0 +1,8 @@
### register device for a type
POST {{hostname}}/register
Authorization: Bearer {{token}}
Content-Type: application/json
{
"type": "00000000-0000-0000-0000-000000000000"
}

View File

@@ -0,0 +1,6 @@
apiVersion: v1
kind: Namespace
metadata:
name: hlaeja
labels:
environment: testing

View File

@@ -0,0 +1,11 @@
apiVersion: v1
kind: Secret
metadata:
name: github
namespace: hlaeja
labels:
environment: testing
type: kubernetes.io/dockerconfigjson
data:
# Look at /doc/k8s-docker-registry.md to this value
.dockerconfigjson: DockerRegistryBase64==

View File

@@ -0,0 +1,15 @@
apiVersion: v1
kind: Secret
metadata:
name: account-jwt-private-key
namespace: hlaeja
labels:
app: account-register
environment: testing
tier: backend
type: Opaque
data:
# Look at /doc/rsa_key.md, for how to make real values
private_key.pem: AccountJwtPrivateKeyFileBase64==

View File

@@ -0,0 +1,13 @@
apiVersion: v1
kind: Secret
metadata:
name: account-jwt-public-key
namespace: hlaeja
labels:
app: account-register
environment: testing
tier: frontend
type: Opaque
data:
# Look at /doc/rsa_key.md, for how to make real values
public_key.pem: AccountJwtPublicKeyFileBase64==

View File

@@ -0,0 +1,13 @@
apiVersion: v1
kind: Secret
metadata:
name: device-jwt-private-key
namespace: hlaeja
labels:
app: device-register
environment: testing
tier: backend
type: Opaque
data:
# Look at /doc/rsa_key.md, for how to make real values
private_key.pem: DeviceJwtPrivateKeyFileBase64==

View File

@@ -0,0 +1,13 @@
apiVersion: v1
kind: Secret
metadata:
name: device-jwt-public-key
namespace: hlaeja
labels:
app: device-register
environment: testing
tier: frontend
type: Opaque
data:
# Look at /doc/rsa_key.md, for how to make real values
public_key.pem: DeviceJwtPublicKeyFileBase64==

View File

@@ -0,0 +1,12 @@
apiVersion: v1
kind: Secret
metadata:
name: device-api-keystore
namespace: hlaeja
labels:
environment: testing
type: Opaque
data:
# Look at /doc/keystore.md, for how to make real values
keystore.p12: DeviceApiKeystoreFileBase64==
keystore-password: DeviceApiKeystorePasswordBase64==

View File

@@ -0,0 +1,12 @@
apiVersion: v1
kind: Secret
metadata:
name: registry-api-keystore
namespace: hlaeja
labels:
environment: testing
type: Opaque
data:
# Look at /doc/keystore.md, for how to make real values
keystore.p12: RegistryApiKeystoreFileBase64==
keystore-password: RegistryApiKeystorePasswordBase64==

View File

@@ -0,0 +1,12 @@
apiVersion: v1
kind: Secret
metadata:
name: postgres
namespace: hlaeja
labels:
app: postgres
environment: testing
tier: database
type: Opaque
stringData:
POSTGRES_PASSWORD: "password"

View File

@@ -0,0 +1,11 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: postgres
namespace: hlaeja
labels:
app: postgres
environment: testing
tier: database
data:
POSTGRES_USER: "postgres"

View File

@@ -0,0 +1,42 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: postgres
namespace: hlaeja
labels:
app: postgres
environment: testing
tier: database
spec:
serviceName: postgres
replicas: 1
selector:
matchLabels:
app: postgres
template:
metadata:
labels:
app: postgres
spec:
containers:
- name: postgres
image: postgres:17
ports:
- containerPort: 5432
envFrom:
- configMapRef:
name: postgres
- secretRef:
name: postgres
volumeMounts:
- name: postgres-data
mountPath: /var/lib/postgresql/data
volumeClaimTemplates:
- metadata:
name: postgres-data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi

Some files were not shown because too many files have changed in this diff Show More