Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MG-153 - Add Vault scripts as git subtree #157

Open
wants to merge 46 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
8cab8df
Squashed 'docker/addons/vault/' content from commit 54a134e7
JeffMboya Nov 18, 2024
aedfbae
Merge commit '8cab8df5a1cfd26191442818472cfc8ad0680da6' as 'docker/ad…
JeffMboya Nov 18, 2024
beba5e0
Remove docker/addons/vault directory
JeffMboya Nov 18, 2024
81356c9
Remove scripts/vault directory
JeffMboya Nov 18, 2024
22f2f60
Squashed 'vault/' content from commit a32634a1e
JeffMboya Nov 18, 2024
25db402
Merge commit '22f2f6083f30faec72f8fb72f9e7e8107739accf' as 'vault'
JeffMboya Nov 18, 2024
cffc3bb
Remove scripts/vault directory
JeffMboya Nov 18, 2024
eb6f4fc
Squashed 'vault/' content from commit a32634a1e
JeffMboya Nov 18, 2024
f4df847
Merge commit 'eb6f4fc1b399c3db293741619638ac7db06b2d29' as 'vault'
JeffMboya Nov 18, 2024
cf5b45d
Squashed 'scripts/vault/' content from commit a32634a1e
JeffMboya Nov 18, 2024
0b8ad42
Merge commit 'cf5b45de649d9b7df1f8a3711bc527a6bf87158d' as 'scripts/v…
JeffMboya Nov 18, 2024
ffd46e3
Add vault/scripts directory
JeffMboya Nov 18, 2024
d7314d9
Delete vault directory
JeffMboya Nov 18, 2024
04a24ae
Squashed 'scripts/vault/' content from commit a32634a1e
JeffMboya Nov 18, 2024
9c7145a
Merge commit '04a24aea9c420f527d7db15cb8a1b863328ce53a' as 'scripts/v…
JeffMboya Nov 18, 2024
cfc0100
Add scripts/vault directory
JeffMboya Nov 18, 2024
8fb2d05
Add .env, vault.md, and efk.sh
JeffMboya Nov 18, 2024
4f98a62
Add empty line
JeffMboya Nov 18, 2024
fdfd93f
Update vault docs
JeffMboya Nov 19, 2024
d05d2a8
Remove git pull command
JeffMboya Nov 19, 2024
fa8adb6
Address comments
JeffMboya Nov 19, 2024
483526c
Add empty line
JeffMboya Nov 19, 2024
6bb155f
move .env file
JeffMboya Nov 19, 2024
7cb578d
Squashed 'scripts/vault/' content from commit a32634a1e
JeffMboya Nov 19, 2024
4d0aa48
Merge commit '7cb578dbedee70ca0eac10a8c5caed7d8ac53d5c' as 'scripts/v…
JeffMboya Nov 19, 2024
1006b1c
Squashed 'vault/' content from commit a32634a1e
JeffMboya Nov 19, 2024
fc151d6
Merge commit '1006b1c66b57497784783f6b7414ba136dcf3d11' as 'vault'
JeffMboya Nov 19, 2024
e60cc9f
move .env file
JeffMboya Nov 19, 2024
e0b0ce3
Squashed 'vault/' content from commit a32634a1e
JeffMboya Nov 19, 2024
35e12b4
Merge commit 'e0b0ce33ba0600d7316f7bc8f2fa451c7b6da9a8' as 'vault'
JeffMboya Nov 19, 2024
f4f15f1
move .env file
JeffMboya Nov 19, 2024
42ab894
Squashed 'scripts/vault/' content from commit a32634a1e
JeffMboya Nov 19, 2024
3623b16
Merge commit '42ab894250fa1bf49f3d8a6a9e89fa3116c56ab8' as 'scripts/v…
JeffMboya Nov 19, 2024
ad4361b
move .env file
JeffMboya Nov 19, 2024
4e470fa
Add efk.sh
JeffMboya Nov 19, 2024
b98267d
Squashed 'docker/addons/vault/scripts/' content from commit d9f3bca47
JeffMboya Nov 19, 2024
1564491
Merge commit 'b98267df3d82f58f4d30ec7f34fb177f202fe030' as 'docker/ad…
JeffMboya Nov 19, 2024
ab3f879
Remove unnecessary files
JeffMboya Nov 19, 2024
fad3ac7
Address comments
JeffMboya Nov 19, 2024
36238f0
Remove duplicate instructions
JeffMboya Nov 21, 2024
70b83ae
Update README
JeffMboya Nov 28, 2024
ea26149
Fix users authentication error
JeffMboya Nov 28, 2024
58a7f37
Add AMA certs
JeffMboya Nov 28, 2024
dd608db
Bump chart version
JeffMboya Nov 28, 2024
33c16cf
Remove ref to magistrala
JeffMboya Nov 28, 2024
735284e
Remove vault config files
JeffMboya Nov 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions charts/magistrala/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ name: magistrala
description: Magistrala IoT Platform
icon: https://avatars1.githubusercontent.com/u/13207490
type: application
version: 0.14.2 # Incremented chart version if the chart is updated
appVersion: "0.14.0" # Update application version if the app is updated
version: 0.15.0 # Incremented chart version if the chart is updated
appVersion: "0.15.0" # Update application version if the app is updated
home: https://abstractmachines.fr/magistrala.html
sources:
- https://hub.docker.com/u/magistrala
Expand Down
21 changes: 19 additions & 2 deletions charts/magistrala/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Magistrala IoT Platform

![Version: 0.14.2](https://img.shields.io/badge/Version-0.14.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.14.0](https://img.shields.io/badge/AppVersion-0.14.0-informational?style=flat-square)
![Version: 0.15.0](https://img.shields.io/badge/Version-0.15.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.15.0](https://img.shields.io/badge/AppVersion-0.15.0-informational?style=flat-square)

**Homepage:** <https://abstractmachines.fr/magistrala.html>

Expand Down Expand Up @@ -44,6 +44,11 @@ Magistrala IoT Platform
| adapter_coap.port | int | `5683` | |
| adapter_http.httpPort | int | `8008` | |
| adapter_http.image | object | `{}` | |
| amcerts.enabled | bool | `true` | |
| amcerts.grpcPort | int | `7012` | |
| amcerts.httpPort | int | `9010` | |
| amcerts.image.repository | string | `"ghcr.io/absmach/certs"` | |
| amcerts.image.tag | string | `"latest"` | |
| auth.accessTokenDuration | string | `"1h"` | |
| auth.adminEmail | string | `"[email protected]"` | |
| auth.adminPassword | string | `"12345678"` | |
Expand Down Expand Up @@ -136,6 +141,18 @@ Magistrala IoT Platform
| nginxInternal.image.tag | string | `"1.19.1-alpine"` | |
| nginxInternal.mtls.intermediateCrt | string | `""` | |
| nginxInternal.mtls.tls | string | `""` | |
| postgresqlamcerts.database | string | `"certs"` | |
| postgresqlamcerts.enabled | bool | `true` | |
| postgresqlamcerts.global.postgresql.auth.database | string | `"certs"` | |
| postgresqlamcerts.global.postgresql.auth.password | string | `"magistrala"` | |
| postgresqlamcerts.global.postgresql.auth.postgresPassword | string | `"magistrala"` | |
| postgresqlamcerts.global.postgresql.auth.username | string | `"magistrala"` | |
| postgresqlamcerts.global.postgresql.service.ports.postgresql | int | `5432` | |
| postgresqlamcerts.host | string | `"postgresql-certs"` | |
| postgresqlamcerts.name | string | `"postgresql-certs"` | |
| postgresqlamcerts.password | string | `"magistrala"` | |
| postgresqlamcerts.port | int | `5432` | |
| postgresqlamcerts.username | string | `"magistrala"` | |
| postgresqlauth.database | string | `"auth"` | |
| postgresqlauth.enabled | bool | `true` | |
| postgresqlauth.global.postgresql.auth.database | string | `"auth"` | |
Expand Down Expand Up @@ -252,7 +269,7 @@ Magistrala IoT Platform
| spicedb.dispatch.enabled | bool | `false` | |
| spicedb.dispatch.port | int | `50053` | |
| spicedb.grpc.port | int | `50051` | |
| spicedb.grpc.presharedKey | string | `"helloworld"` | |
| spicedb.grpc.presharedKey | string | `"12345678"` | |
| spicedb.http.enabled | bool | `false` | |
| spicedb.http.port | int | `8443` | |
| spicedb.image.pullSecrets | object | `{}` | |
Expand Down
113 changes: 113 additions & 0 deletions charts/magistrala/templates/amcerts-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0

{{- if .Values.amcerts.enabled }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ .Release.Name }}-amcerts-config
data:
config.yml: |
common_name: "AbstractMachines_Selfsigned_ca"
organization:
- "AbstractMachines"
organizational_unit:
- "AbstractMachines_ca"
country:
- "France"
province:
- "Paris"
locality:
- "Quai de Valmy"
postal_code:
- "75010 Paris"
dns_names:
- "localhost"
ip_addresses:
- "localhost"
---

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ .Release.Name }}-amcerts
spec:
selector:
matchLabels:
app: {{ .Release.Name }}
component: amcerts
template:
metadata:
annotations:
prometheus.io/path: /metrics
prometheus.io/port: "{{ .Values.amcerts.httpPort }}"
prometheus.io/scrape: "true"
labels:
app: {{ .Release.Name }}
component: amcerts
spec:
{{- if (or .Values.amcerts.image.pullSecrets .Values.defaults.image.pullSecrets) }}
imagePullSecrets:
{{- range (or .Values.amcerts.image.pullSecrets .Values.defaults.image.pullSecrets) }}
- name: {{ . }}
{{- end }}
{{- end }}
dnsPolicy: ClusterFirst
restartPolicy: Always
volumes:
- configMap:
defaultMode: 256
name: {{ .Release.Name }}-amcerts-config
optional: false
name: amcerts-config
containers:
- name: {{ .Release.Name }}-amcerts
image: "{{ default (printf "%s/amcerts" .Values.defaults.image.rootRepository) .Values.amcerts.image.repository }}:{{ default .Values.defaults.image.tag .Values.amcerts.image.tag }}"
imagePullPolicy: {{ default .Values.defaults.image.pullPolicy .Values.amcerts.image.pullPolicy }}
env:
- name: AM_JAEGER_URL
value: "http://{{ .Values.jaeger.fullnameOverride }}-collector:{{ .Values.jaeger.collector.service.otlp.http.port }}/v1/traces"
- name: AM_CERTS_JAEGER_TRACE_RATIO
value: {{ default .Values.defaults.jaegerTraceRatio .Values.amcerts.jaegerTraceRatio | quote }}
- name: AM_CERTS_LOG_LEVEL
value: {{ default .Values.defaults.logLevel .Values.amcerts.logLevel | quote }}
- name: AM_CERTS_HTTP_HOST
value: "0.0.0.0"
- name: AM_CERTS_HTTP_PORT
value: {{ .Values.amcerts.httpPort | quote }}
- name: AM_CERTS_GRPC_HOST
value: "0.0.0.0"
- name: AM_CERTS_GRPC_PORT
value: {{ .Values.amcerts.grpcPort | quote }}
- name: AM_CERTS_AUTH_GRPC_URL
value: {{ .Release.Name }}-envoy:{{ .Values.auth.grpcPort }}
- name: MG_THINGS_URL
value: http://{{ .Release.Name }}-things:{{ .Values.things.httpPort }}
- name: AM_CERTS_DB_HOST
{{- if .Values.postgresqlamcerts.enabled }}
value: {{ .Release.Name }}-postgresqlcerts
{{- else }}
value: {{ .Values.postgresqlamcerts.host | quote }}
{{- end }}
- name: AM_CERTS_DB_PORT
value: {{ .Values.postgresqlamcerts.port | quote }}
- name: AM_CERTS_DB_NAME
value: {{ .Values.postgresqlamcerts.database | quote }}
- name: AM_CERTS_DB_USER
value: {{ .Values.postgresqlamcerts.username | quote }}
- name: AM_CERTS_DB_PASS
value: {{ .Values.postgresqlamcerts.password | quote }}
- name: MG_CERTS_SIGN_CA_PATH
value: {{ .Values.certs.signCAPath }}
- name: MG_CERTS_SIGN_CA_KEY_PATH
value: {{ .Values.certs.signCAKeyPath }}
ports:
- containerPort: {{ .Values.amcerts.httpPort }}
protocol: TCP
- containerPort: {{ .Values.amcerts.grpcPort }}
protocol: TCP
volumeMounts:
- name: amcerts-config
mountPath: /config/config.yml
subPath: config.yml
{{- end }}
20 changes: 20 additions & 0 deletions charts/magistrala/templates/amcerts-service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright (c) Abstract Machines
# SPDX-License-Identifier: Apache-2.0

{{- if .Values.amcerts.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ .Release.Name }}-amcerts
spec:
selector:
app: {{ .Release.Name }}
component: amcerts
ports:
- port: {{ .Values.amcerts.httpPort }}
protocol: TCP
name: {{ .Release.Name }}-amcerts-{{ .Values.amcerts.httpPort }}
- port: {{ .Values.amcerts.grpcPort }}
protocol: TCP
name: {{ .Release.Name }}-amcerts-grpc-{{ .Values.amcerts.grpcPort }}
{{- end }}
8 changes: 8 additions & 0 deletions charts/magistrala/templates/users-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ spec:
value: {{ .Values.postgresqlusers.username | quote }}
- name: MG_USERS_DB_PASS
value: {{ .Values.postgresqlusers.password | quote }}
- name: MG_USERS_GRPC_HOST
value: "0.0.0.0"
- name : MG_USERS_GRPC_PORT
value: {{ .Values.users.grpcPort | quote }}
- name: MG_SPICEDB_HOST
value: {{ .Release.Name }}-spicedb
- name: MG_SPICEDB_PORT
value: {{ .Values.spicedb.grpc.port | quote }}
- name : MG_AUTH_GRPC_URL
value: {{ .Release.Name }}-envoy:{{ .Values.auth.grpcPort }}
ports:
Expand Down
80 changes: 55 additions & 25 deletions charts/magistrala/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@
maxSize: 2Gi

adapter_coap:
image:
{}
image: {}
# pullSecrets: {}
# If your image repository requires authentication, you can specify image pull secrets here.
# Example:
Expand Down Expand Up @@ -147,8 +146,7 @@
# effect: "NoSchedule"

adapter_http:
image:
{}
image: {}
# pullSecrets: {}
# repository: "magistrala/adapter-http"
# tag: "latest"
Expand Down Expand Up @@ -198,7 +196,7 @@
tag: latest
# pullPolicy: "IfNotPresent"
grpc:
presharedKey: "helloworld"
presharedKey: "12345678"
port: 50051
datastore:
## engine can be any one of the two options: postgres (default) , memory
Expand Down Expand Up @@ -238,8 +236,7 @@

auth:
# logLevel: error
image:
{}
image: {}
# pullSecrets: {}
# rootRepository: "magistrala/auth"
# tag: "latest"
Expand Down Expand Up @@ -280,8 +277,7 @@
postgresql: *postgresqlAuthPort

users:
image:
{}
image: {}
# pullSecrets: {}
# repository: "magistrala/users"
# tag: "latest"
Expand Down Expand Up @@ -324,8 +320,7 @@
postgresql: *postgresqlUsersPort

things:
image:
{}
image: {}
# pullSecrets: {}
# repository: "magistrala/things"
# tag: "latest"
Expand Down Expand Up @@ -407,8 +402,7 @@

certs:
enabled: true
image:
{}
image: {}
# pullSecrets: {}
# repository: "magistrala/certs"
# tag: "latest"
Expand Down Expand Up @@ -449,11 +443,51 @@
service:
ports:
postgresql: *postgresqlCertsPort
amcerts:
enabled: true
image:
repository: "ghcr.io/absmach/certs"
tag: "latest"
# pullSecrets: {}
# pullPolicy: "IfNotPresent"
# jaegerTraceRatio: 1.0
# sendTelemetry: true
# logLevel: "info"
httpPort: 9010
grpcPort: 7012
# signCAPath: "/etc/ssl/certs/ca.crt"
# signCAKeyPath: "/etc/ssl/certs/ca.key"
# vault:
# url: "http://magistrala-vault:8200"
# approleRoleid: magistrala
# approleSecret: magistrala
# namespace: magistrala
# thingsCertsPkiPath: pki_int
# thingsCertsPkiRoleName: magistrala_things_certs

postgresqlamcerts:
## If you want to use an external database, set this to false and change host & port to external postgresql server host & port respectively
enabled: true
name: postgresql-certs
host: postgresql-certs
port: &postgresqlCertsPort 5432
database: &postgresqlCertsDatabase certs
username: &postgresqlCertsUsername magistrala
password: &postgresqlCertsPassword magistrala
global:
postgresql:
auth:
postgresPassword: *postgresqlCertsPassword
username: *postgresqlCertsUsername
password: *postgresqlCertsPassword
database: *postgresqlCertsDatabase
service:
ports:
postgresql: *postgresqlCertsPort

invitations:
enabled: true
image:
{}
image: {}
# pullSecrets: {}
# repository: "magistrala/invitations"
# tag: "latest"
Expand Down Expand Up @@ -488,8 +522,7 @@

journal:
enabled: true
image:
{}
image: {}
# pullSecrets: {}
# repository: "magistrala/journal"
# tag: "latest"
Expand Down Expand Up @@ -532,8 +565,7 @@
username: &messagesRwTimescaleUsername magistrala
password: &messagesRwTimescalePassword magistrala
reader:
image:
{}
image: {}
# pullSecrets: {}
# repository: "magistrala/timescale-reader"
# tag: "latest"
Expand All @@ -542,13 +574,12 @@
# sendTelemetry: true
# logLevel: "info"
enabled: true
http: {port: 9011}
http: { port: 9011 }

Check failure on line 577 in charts/magistrala/values.yaml

View workflow job for this annotation

GitHub Actions / lint-test

577:12 [braces] too many spaces inside braces

Check failure on line 577 in charts/magistrala/values.yaml

View workflow job for this annotation

GitHub Actions / lint-test

577:23 [braces] too many spaces inside braces
# nodeSelector: {}
# affinity: {}
# tolerations: {}
writer:
image:
{}
image: {}
# pullSecrets: {}
# repository: "magistrala/timescale-writer"
# tag: "latest"
Expand All @@ -560,7 +591,7 @@
# affinity: {}
# tolerations: {}
enabled: true
http: {port: 9012}
http: { port: 9012 }

Check failure on line 594 in charts/magistrala/values.yaml

View workflow job for this annotation

GitHub Actions / lint-test

594:12 [braces] too many spaces inside braces

Check failure on line 594 in charts/magistrala/values.yaml

View workflow job for this annotation

GitHub Actions / lint-test

594:23 [braces] too many spaces inside braces
## Configurations of Bitnami postgres
global:
postgresql:
Expand All @@ -579,8 +610,7 @@

ui:
enabled: true
image:
{}
image: {}
# pullSecrets: {}
# repository: "magistrala/ui"
# tag: "latest"
Expand Down
1 change: 0 additions & 1 deletion scripts/.gitignore

This file was deleted.

Loading
Loading